Fix not profiling when /proc/mounts is more than 4KB
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.
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.
5f4cccaa fixes this in a better way.
Thanks! 5f4ccca works on my setup :)