Announcement

Collapse
No announcement yet.

AMD RadeonSI & R600g Gallium3D Tests On Mesa 11.0 + DRM-Next

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by SystemCrasher View Post
    Hmm, btw... it's quite big omission there is no way to dump raw gallium hud data into file. I found HUD quite useful for getting idea what goes on, but sometimes I need to do automated/batch processing of this kind of data and Gallium HUD would not help with that. This is very sad, since it actually got most code and data in hand and it literally about being able to write it to some file.
    Patches welcome.

    Comment


    • #22
      Hm. It actually looks relatively easy.

      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);
      And then
      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
      Result: https://imgur.com/a/OB0hC

      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 .
      Last edited by haagch; 31 August 2015, 01:15 PM.

      Comment

      Working...
      X