kula85
kula85

Reputation: 73

perf record: can I specify multiple events and use different sample-after value for each of them

I'm trying use perf tool from the linux kernel package to measure several raw PMU events. In the manpage of perf-record there is an "-l" option (Scale counter values), which is useful for my case because I want to know the total counter value, not just sample count. However it seems the -l is not recognized, is this expected? How can I get a total count?

Another question is that how can I specify multiple events and use different sample-after value for each of them? like perf record -c 10000,2000000,2000000 -e r2d4,r03c,r0c0

thank you

Upvotes: 3

Views: 1727

Answers (1)

levinth
levinth

Reputation: 21

in the example, I am showing I have already installed libpfm4 so that perf knows the user-friendly event names. There is a rather clumsy default syntax that can be used that allows the sampling period to be set per event

levinth@ubuntu18-2:~$ perf record -e cpu/inst_retired.any_p,period=2000000/,cpu/cpu_clk_unhalted.thread_any,period=3000000/ -- sleep 5
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.017 MB perf.data ]

Upvotes: 2

Related Questions