linux - How can I get perf to find symbols in my program -


when using perf report, don't see symbols program, instead output this:

$ perf record /path/to/racket ints.rkt 10000 $ perf report --stdio  # overhead   command      shared object  symbol # ........  ........  .................  ...... #     70.06%  ints.rkt  [unknown]          [.] 0x5f99b8             26.28%  ints.rkt  [kernel.kallsyms]  [k] 0xffffffff8103d0ca      3.66%  ints.rkt  perf-32046.map     [.] 0x7f1d9be46650   

which uninformative.

the relevant program built debugging symbols, , sysprof tool shows appropriate symbols, zoom, think using perf under hood.

note on x86-64, binary compiled -fomit-frame-pointer, that's case when running under other tools well.

this post on year old, since came out @ top of google search results when had same problem, thought i'd answer here. after more searching around, found answer given in related stackoverflow question helpful. on ubuntu raring system, ended doing following:

  1. compile c++ sources -g (fairly obvious, need debug symbols)
  2. run perf as

    record -g dwarf -f 97 /path/to/my/program 

    this way perf able handle dwarf 2 debug format, standard format gcc uses on linux. -f 97 parameter reduces sampling rate 97 hz. default sampling rate apparently large system , resulted in messages this:

    warning: processed 172390 events , lost 126 chunks!  check io/cpu overload! 

    and perf report call afterwards fail segmentation fault. reduced sampling rate worked out fine.

  3. once perf.data file has been generated without errors in previous step, can run perf report etc. flamegraph tools generate svg visualizations.
  4. other people reported running

    echo 0 > /proc/sys/kernel/kptr_restrict 

    as root can well, if kernel symbols required.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -