summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/hud/hud_context.c
diff options
context:
space:
mode:
authorEdmondo Tommasina <[email protected]>2016-12-21 22:58:09 +0100
committerMarek Olšák <[email protected]>2017-01-01 00:03:06 +0100
commit22cd9040da75cac6e1c61b821e1ac6906ac4a8ac (patch)
tree09cb6095ef2e83054de36813a549112e4ed226f3 /src/gallium/auxiliary/hud/hud_context.c
parent1f13cb8b153b92bf1da8caa62c9176b875fe7e0f (diff)
gallium/hud: dump hud_driver_query values to files
Dump values for every selected data source in GALLIUM_HUD. Every data source has its own file and the filename is equal to the data source identifier. Set GALLIUM_HUD_DUMP_DIR to dump values to files in this directory. No values are dumped if the environment variable is not set, the directory doesn't exist or the user doesn't have write access. Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/hud/hud_context.c')
-rw-r--r--src/gallium/auxiliary/hud/hud_context.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index ceb157adafe..edd831a7f7b 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -33,6 +33,7 @@
* Set GALLIUM_HUD=help for more info.
*/
+#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
@@ -829,6 +830,9 @@ hud_graph_add_value(struct hud_graph *gr, uint64_t value)
gr->current_value = value;
value = value > gr->pane->ceiling ? gr->pane->ceiling : value;
+ if (gr->fd)
+ fprintf(gr->fd, "%" PRIu64 "\n", value);
+
if (gr->index == gr->pane->max_num_vertices) {
gr->vertices[0] = 0;
gr->vertices[1] = gr->vertices[(gr->index-1)*2+1];
@@ -856,6 +860,8 @@ hud_graph_destroy(struct hud_graph *graph)
FREE(graph->vertices);
if (graph->free_query_data)
graph->free_query_data(graph->query_data);
+ if (graph->fd)
+ fclose(graph->fd);
FREE(graph);
}