[Mesa-dev] Empty files when dumping hud values selected with GALLIUM_HUD

Edmondo Tommasina edmondo.tommasina at gmail.com
Tue Apr 4 19:38:33 UTC 2017


On Tue, Apr 4, 2017 at 12:47 PM, Julien Isorce <julien.isorce at gmail.com> wrote:
> Thx Edmondo, let me know the result! Also is the pane on screen supposed to
> work with llvmpipe driver because I cannot see it with GALLIUM_HUD=fps
> LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=llvmpipe glxgears
>
> Cheers.
> Julien
>
> On 4 April 2017 at 11:29, Edmondo Tommasina <edmondo.tommasina at gmail.com>
> wrote:
>>
>>
>>
>> On Apr 4, 2017 11:26, "Julien Isorce" <julien.isorce at gmail.com> wrote:
>>
>> Hi,
>>
>> I noticed that GALLIUM_HUD does not write hud values into files properly.
>>
>> The destination files look empty at least for 5 min and then are filed in
>> with some burst. I wonder if it could be a problem with the
>> GALLIUM_HUD_PERIOD which would be wrong when writing values into files. Or
>> write is not committed or not flushed.
>>
>> I can see these values properly updated in the pane on screen but
>> destination files are empty for some minutes.
>>
>> This is happening with various recent version of mesa + radeonsi. With
>> older mesa like 12.0.6, it is even worst, the destinations are not created
>> at all.
>>
>> Does it happen for anybody else before I fill in a bug ?
>> TEST:  GALLIUM_HUD=fps+VRAM-usage+temperature GALLIUM_HUD_DUMP_DIR=/tmp
>> glxgears
>>
>> -
>> Julien
>>
>>
>>
>> Hi Julien
>>
>> I think this could be a buffering issue.
>> The values are printed with fprintf, I'm using default
>> buffer sizes and never explicitly flushing.
>> This evening I'll try to make it more reliable.
>>
>> Btw. the dump functionality is not implemented in Mesa 12.
>>
>> Thanks
>> edmondo
>>

Hi Julien

This simple patch below sets the dump stream to line buffered. It should now
be better. Any chances to test it?

I'll do some more testing and then submit it.

edmondo


diff --git a/src/gallium/auxiliary/hud/hud_context.c
b/src/gallium/auxiliary/hud/hud_context.c
index 29ef9eee31..af235d5887 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -972,6 +972,7 @@ hud_graph_set_dump_file(struct hud_graph *gr)
          strcat(dump_file, "/");
          strcat_without_spaces(dump_file, gr->name);
          gr->fd = fopen(dump_file, "w+");
+         setvbuf(gr->fd, NULL, _IOLBF, 0);
          free(dump_file);
       }
    }


More information about the mesa-dev mailing list