0
votes

I've got gperftools installed and collecting data, which looks reasonable so far. I see one node (?) that gets sampled a lot - but I'm interested in the callers to that node - I don't see them? I've tried callgrind/kcachegrind also, I feel like I'm missing something? Here's a snippet of the output when using --text

Total: 1844 samples
     573  31.1%  31.1%      573  31.1% US_strcpy
     185  10.0%  41.1%      185  10.0% US_strstr
     167   9.1%  50.2%      167   9.1% US_strlen
      63   3.4%  53.6%       63   3.4% PS_CompressTable
      58   3.1%  56.7%       58   3.1% LX_LexInternal
      51   2.8%  59.5%       51   2.8% US_CStrEql
      47   2.5%  62.0%       47   2.5% 0x40472984
      40   2.2%  64.2%       40   2.2% PS_DoSets
      38   2.1%  66.3%       38   2.1% LX_ProcessCatRange

So I'm interested in seeing the callers to US_strcpy, but I don't seem to have any? I do get a nice call graph from kcachegrind for 0x40472984 (still trying to match that to a symbol)

1
Take ten or twenty samples this way. For any function that accounts for significant time, it tells exactly who calls it, and why. Point 3 here discusses call graphs.Mike Dunlavey

1 Answers

0
votes

There are several ways:

a) pprof --web or kcachgrind will show you callers nicely if it is captured correctly. It is sometimes useful to do pprof --traces (only with github.com/google/pprof version). Which will be somewhat like low-tech method that Mike mentioned above.

b) if the data is really unavailable, you're having problem with stacktrace capturing and/or symbolization. For that, build gperftools with libunwind and build all of your program with debug info.