2

I'm running callgrind on an executable in an attempt to see what functions are being called and from where in my application. I'm converting the output of callgrind into a dot file using gprof2dot so that I can view the call graph.

The issue is that all function calls show up in callgrind, including all external libraries my application is linked against, including system calls. I'd like to be able to tell callgrind to limit the resolution only to functions defined within a list of libraries which I'm interested in.

Is this possible using callgrind? are there other tools better suited for this job?

nbubis
  • 2,304
  • 5
  • 31
  • 46
  • 1
    You could possibly create a _suppression file_ to suppress everything but the stuff you're interested in. I've never created one from scratch myself, but I've used pre-made ones with great success. Checkout suppression here: https://valgrind.org/docs/manual/manual-core.html – Ted Lyngmo Jul 06 '20 at 20:39
  • Does this answer your question? [Filter calls to libc from valgrind's callgrind output](https://stackoverflow.com/questions/7761448/filter-calls-to-libc-from-valgrinds-callgrind-output) – MSpiller Jul 07 '20 at 08:19
  • @M.Spiller - That's about filtering out libc, I want to filter out all external libraries. I suppose I can hack my way through that script. – nbubis Jul 07 '20 at 13:00
  • If you read the post, you will see that it is just a matter of adjusting the first two variables in the perl script. – MSpiller Jul 07 '20 at 13:17
  • @M.Spiller - Adjusting the script, it does filter out external libraries in ob & cob lines, but still shows function calls from external libraries, such as `std::vector::operator[]` - I'd like to just see my "own" callgraph, without caring about what functions are called underneath the hood. – nbubis Jul 07 '20 at 19:14

0 Answers0