tikv / pprof-rs

A Rust CPU profiler implemented with the help of backtrace-rs
Apache License 2.0
1.29k stars 99 forks source link

Profiler does not run properly on Linux #157

Closed viglia closed 4 months ago

viglia commented 2 years ago

In the past I've used the profiler on a Mac with Intel processor (with default features) and on a M1 Mac (with frame-pointer feature). Everything worked fine.

I've tried to run the same program on Linux (default features) and got several problem:

  1. if I didn't remove pthread from the blocklist ["libc", "libgcc", "pthread", "vdso"] it would not collect samples. Actually it would collect 2 samples in total, no matter how long I profiled, with only 2 frames belonging to the signal_handler and nothing else
  2. removing pthread (or the whole blocklist) most of the time resulted in the program crashing, for the reason explained in the readme as well
  3. when the program was not crashing, the resulting stack traces were incoherent. For example, the frame belonging to the main function sometimes appears twice in the same stack traces and in different positions

I've run this on the following system: Debian 4.19.249-2 x86_64 GNU/Linux And the version of the pprof-rs crate I've used is: 0.10.0

mornyx commented 1 year ago

Should be resolved by https://github.com/tikv/pprof-rs/pull/172.

breezewish commented 4 months ago

Closing the issue according to feedbacks in https://github.com/tikv/pprof-rs/issues/135.