You are not logged in.

#1 2019-05-19 08:35:03

sticnarf
Member
Registered: 2016-12-04
Posts: 1

Linux perf records a lot fewer user backtrace when specifying PID

I'm sorry that the title is not that precise due to the length limit. But my problem is limited to using --call-graph=dwarf.

If I run a program first and then start perf record with PID, I will get a lot of user backtrace missing. However, if I use perf record to start the program, I will get full backtrace. It's really weird to me.

I can confirm the problem on Archlinux with kernel 5.0.9 and 5.1.2. I haven't tried an older kernel.

I tried on Fedora 30 with kernel 5.0.16 and both ways work. Kernel variables about perf are the same on Fedora and Archlinux. So I doubt there's something wrong with some kernel patches specific to ArchLinux.

It is easy to reproduce:

1. Compile the hello example of hyper in release mode (a HTTP library in Rust). (precompiled binary: https://drive.google.com/open?id=1dXHNt … ONDJ6ifri)
2. Run the hello server and add pressure to it using wrk.
3. Find the pid of the hello server, and perf: sudo perf record -F 99 --call-graph=dwarf -p $PID sleep 10
4. Now, stop the server and try the other way: sudo perf record -F 99 --call-graph=dwarf ./hello.
5. Add pressure same as before. Stop perf after a few seconds.
6. Generate flamegraph or just use perf report to check each result.

It's the result on my PC: https://gist.github.com/sticnarf/efb6f3 … 09b5e510b0

Last edited by sticnarf (2019-05-19 12:11:20)

Offline

Board footer

Powered by FluxBB