I want to profiling per core or per thread (event driven or time driven). But perf aggregates all values together.
For example, if I want to profiling core 0~3 every 1 second with perf:
perf stat -I 1000 -a -c 0-3 -e instructions,cycles command
There will be instructions and cycles of all 4 cores every second.
What I really want is instructions and cycles of each core per second.
Is there other tools that can implement the function?
Or can I modify source code of perf to implement it by myself? Is the aggregration coded in user space or kernel space?
BTW: perf record can sample per thread but it cannot profiling in real-time.
It's possible! You have to add -A
or --no-aggr
per pef-stat man page.
perf stat -C 0-3 --no-aggr -e instructions,cycles command
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With