Reputation: 535
I use perf to profile certain function in my code. CPI (cycles per instruction) is informative for me in particular. Call to this function is surrounded by test code. To get CPI I run 'perf -e cycles,instructions ...'. Then form 'perf report' I get number of cycles and number of instructions by multiplying percentage value (displayed for my function) and total number of captured events. This approach gives me reasonable results but is rather complicated. I could write a script to parse the output, but perhaps there is simpler way to handle this? Or maybe it's possible to tell 'perf record' or 'perf stat' which function should be profiled?
Upvotes: 2
Views: 1600
Reputation: 535
Actually found the answer on my own. 'perf report' has option for this: --symbol-filter
Upvotes: 1