Code:
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index 95eed26..b2ba8d8 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -50,7 +50,9 @@ #include "util/u_upload_mgr.h" #include "tgsi/tgsi_text.h" #include "tgsi/tgsi_dump.h" +#include <sys/time.h> +unsigned long time_in_micros = 0; struct hud_context { struct pipe_context *pipe; @@ -349,6 +351,7 @@ hud_pane_accumulate_vertices(struct hud_context *hud, number_to_human_readable(gr->current_value, pane->max_value, pane->type, str); hud_draw_string(hud, x, y, " %s: %s", gr->name, str); + fprintf(stderr, "[HUD_OUTPUT]\t%lu\t%s\t%s\n", time_in_micros, &gr->name, &str); i++; } @@ -510,6 +513,10 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex) hud_alloc_vertices(hud, &hud->text, 4 * 512, 4 * sizeof(float)); /* prepare all graphs */ + struct timeval tv; + gettimeofday(&tv,NULL); + time_in_micros = 1000000 * tv.tv_sec + tv.tv_usec; + LIST_FOR_EACH_ENTRY(pane, &hud->pane_list, head) { LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) { gr->query_new_value(gr);
Code:
$ GALLIUM_HUD="fps,GPU-load+cpu,draw-calls,num-compilations+num-shaders-created+num-cs-flushes,buffer-wait-time,VRAM-usage+GTT-usage" unigine-heaven 2> hud.txt $ grep "HUD_OUTPUT" hud.txt | cut -f 3 -d$'\t' | sort | uniq | \ while read line do grep "HUD_OUTPUT" hud.txt | cut -f 1 --complement -d$'\t' | grep "$line" | sed 's/\%//g' | gnuplot -e 'set term png; set output "'"$line"'.png"; set datafile separator "\t"; plot "<cat" using 1:3 with lines title "'"$line"'"' done
Anyone who knows c and mesa well enough to do this in a way that makes sure it doesn't hurt performance and is in line with how things in mesa are done can probably do it properly pretty quickly .
Leave a comment: