Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

perf on running process in Linux

Tags:

linux

perf

For profiling, we can use perf in Linux. But all examples showing only executables.

In CentOS, is it possible to run perf tool on running process or daemon?

like image 237
rajarajan2809 Avatar asked Aug 29 '26 21:08

rajarajan2809


1 Answers

perf record and perf stat support the -p option which you can use to specify the PID of the process to attach to. For example , the command:

perf stat -p 3129

tells perf stat to attach to the currently running process with PID 3129.

like image 123
gbajson Avatar answered Sep 03 '26 04:09

gbajson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!