tracy icon indicating copy to clipboard operation
tracy copied to clipboard

Fix not profiling when /proc/mounts is more than 4KB

Open oscaaaaaaar opened this issue 3 months ago • 1 comments

The first read of /proc/mounts does not return the full contents of the file despite the buffer having enough room. This results in tracefs not being found, and data not being being collected.

This proposed fix reads from the fd until EOF is found, or the buffer is full.

Tested on a docker container within Ubuntu 24.04, Kernel version 6.14.0. My /proc/mounts file is around 6.5KB. The first call to read consistently returns the first 4KB, and the second call gives the latter 2.5KB.

oscaaaaaaar avatar Nov 13 '25 12:11 oscaaaaaaar

Apparently some projects require confirmation of this: I'm happy for my changes to be released under the same 3-clause BSD license that Tracy is already available under.

oscaaaaaaar avatar Nov 13 '25 12:11 oscaaaaaaar

5f4cccaa fixes this in a better way.

wolfpld avatar Nov 13 '25 18:11 wolfpld

Thanks! 5f4ccca works on my setup :)

oscaaaaaaar avatar Nov 13 '25 18:11 oscaaaaaaar