Live data from Hacker News

Evaluation of CPU profiling tools: gperftools, Valgrind and gprof (2015)

gernotklingler.com

11–20 of 29 posts

Re: Evaluation of CPU profiling tools: gperftools, Valgrind and gprof (2015)

#17

Also worth mentioning here is perf[1], which is great for low overhead profiling. Also, perf profiles can be turned into profiles compatible with GCC and LLVM PGO to build optimized binaries based on production runs, using autofdo[2]. In my use case, the instrumentation overhead was too high to use regular profiling on production workloads. [1]: https://en.m.wikipedia.org/wiki/Perf_%28Linux%29 [2]: https://github.com…

For anyone looking to use perf, Brendan Gregg's page on it is the best resource I know of: http://www.brendangregg.com/perf.html

Re: Evaluation of CPU profiling tools: gperftools, Valgrind and gprof (2015)

#18

A problem with google perftools is the `SIGPROF` signal used in sampling will interrupt polling such as used in ZeroMQ. Otherwise, it is a good tool in the toolbox.

that is/was a problem with zeroMQ, not gperftools:

   27    SIGPROF      terminate process    profiling timer alarm (see setitimer(2))
its use is specifically what that signal is for.

Additionally, it seems fixed in zeroMQ for some things already in 2016... so i doubt thats still valid issue.

Re: Evaluation of CPU profiling tools: gperftools, Valgrind and gprof (2015)

#19

Also worth mentioning here is perf[1], which is great for low overhead profiling. Also, perf profiles can be turned into profiles compatible with GCC and LLVM PGO to build optimized binaries based on production runs, using autofdo[2]. In my use case, the instrumentation overhead was too high to use regular profiling on production workloads. [1]: https://en.m.wikipedia.org/wiki/Perf_%28Linux%29 [2]: https://github.com…

Fun fact: the pprof tool that comes in gperftools can read perf data files, so you can use them together if you prefer pprof’s reporting.

Re: Evaluation of CPU profiling tools: gperftools, Valgrind and gprof (2015)

#20

gcc has an address and thread sanitizer built in these days. gcc -fsanitize=address ... gcc -fsanitize=thread ... They perform better than valgrind.

This article refers to valgrind's profiling features (callgrind) and not its more common/popular 'memcheck' feature.

Sanitizers and memcheck are unrelated to the profiling discussion here.

Post reply on HN