* Set GALLIUM_HUD=help for more info.
*/
+#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
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];
FREE(graph->vertices);
if (graph->free_query_data)
graph->free_query_data(graph->query_data);
+ if (graph->fd)
+ fclose(graph->fd);
FREE(graph);
}
{
struct hud_graph *gr;
struct query_info *info;
+ const char *hud_dump_dir = getenv("GALLIUM_HUD_DUMP_DIR");
+ char *dump_file;
gr = CALLOC_STRUCT(hud_graph);
if (!gr)
info->result_index = result_index;
}
+ if (hud_dump_dir && access(hud_dump_dir, W_OK) == 0) {
+ dump_file = malloc(strlen(hud_dump_dir) + sizeof(gr->name));
+ if (dump_file) {
+ strcpy(dump_file, hud_dump_dir);
+ strcat(dump_file, gr->name);
+ gr->fd = fopen(dump_file, "w+");
+ free(dump_file);
+ }
+ }
+
hud_pane_add_graph(pane, gr);
pane->type = type; /* must be set before updating the max_value */