I am trying to setup a profiler for my Linux dev machine. I have tried KCacheGrind with no success. Ran into issues which probably need to be addressed in another forum.You can tell the details here as well.
I am trying to setup a profiler for my Linux dev machine. I have tried KCacheGrind with no success. Ran into issues which probably need to be addressed in another forum.You can tell the details here as well.
Did you run "valgrind --tool=callgrind ..."?
Did it produce an output file?
For me it has worked extremely well. The visualization provided by KCacheGrind is almost ecstatic. It does complex analysis and complex graphics output very fast. I can see they have profiled and optimized their own application well.
Valgrind slows down the profiled program a lot, but that is true with any high quality profiler.
Read the wiki page provided by trev.
It is just painfully slow doing anything with my program using valgrind.Yes. In practice you need a fast machine. For example my old ASRock Beebox TV-box gadget with Manjaro Linux is fast enough for anything I do, including Lazarus development, except for valgrind / callgrind. I use a faster machine for that.
--484764-- WARNING: unhandled amd64-linux syscall: 315I don't get that. Sounds like a kernel problem. What is your Linux distro and how old is the kernel?
--484764-- WARNING: unhandled amd64-linux syscall: 315
https://bugs.launchpad.net/ubuntu/+source/valgrind/+bug/1909683 (https://bugs.launchpad.net/ubuntu/+source/valgrind/+bug/1909683)Ok, yes. My Manjaro has a newer version of valgrind.
$ valgrind --version
valgrind-3.17.0
As I go through the callgrind output file I am realizing it doesnt exactly show my function names. It shows thousands of functions, mostly GTK stuff... trying to make sense of this all is beyond my ability at the moment.
It is the consequent automation of the "poor man's profiler": You press pause in the debugger and write down inside which function you currently are. If you do this often enough you see where it spends most of the time or how many percent of the time it spends in this function. Oprofile can do this tens of thousands of times within a few seconds and give you very accurate reults.Do you have any data about how accurate it is compared to other profilers?
It is the consequent automation of the "poor man's profiler": You press pause in the debugger and write down inside which function you currently are. If you do this often enough you see where it spends most of the time or how many percent of the time it spends in this function. Oprofile can do this tens of thousands of times within a few seconds and give you very accurate reults.Do you have any data about how accurate it is compared to other profilers?
My understanding is that a sampling profiler is not the most accurate but I may be wrong.
I just tried to get OProfile working again an hour ago (after 5 years not using it) and it seems they changed some things (at least in the Ubuntu distribution) and I can't get it to work like I used to (or I am still missing something). But there is also perf, it needs a kernel module and can be installed with apt-get, it comes with it's own GUI (hotspot) to visualize the results, and from a quick look at it it seems it should be able to replace OProfile for most needs.Ok, I found that recent versions of OProfile use the Linux Kernel Performance Events Subsystem.
and then there are google gperftools, this is also a sampling profiler.
just for fun I ran it on fpdoc (see attachment)