I would like to use gcc's gprof line-by-line profiling. But after compiling my program, running it and executing gprof -l binary_name
I get messages like:
gprof: somebody miscounted: ltab.len=9403 instead of 9391
gprof binary_name
runs without error but I have not been able to run with the -l
option. I was not able to find documentation on this. Google autocomplete indicates I am not the first to get this error but I could not find any threads on it. I have tried g++-9 g++-10 and g++-11. I have tried compiling with -g
and -ggdb
. I considered that maybe gprof did not like my program being multithreaded but even removing the OpenMP dependency and telling libtorch to use 1 thread I get the same behavior.
I have the suspicion that this error was not meant to be seen by the end user as it gives no hints on resolution and mentions ltab.len
which is most likely a variable in gcc code no user would be familiar with.