Can punching show the number of raw samples?

I would like perf to output raw sample samples, not percentages. This is useful for determining whether I have accelerated the function I'm trying to optimize.

To be clear, I would like to do something like

perf record ./a.out perf report 

and see how many times the performance selected each function in a.out.

A shark can do this on a Mac, as it can (I believe) Xperf . Is this possible on Linux with perf?

+4
source share
2 answers

The first report (version 2.6.35.7) now supports the -n flag, which does what I want.

+4
source

You want to know if your changes to a function have changed. I suppose you also want what help you can get to figure out which function you need to change. These two goals do not match.

Many tools provide you with a wide range of statistics or counters as they can come up as if more statistics would help any purpose.

Can you get RotateRight / Zoom or any tool that gives you stack samples during a wall clock, preferably under user control? Such a tool will give you time and interest spent in any routine or line of code, in particular, inclusive.

The reason including time is so important that every single line of code that is executed is responsible for a certain fraction of the time, so if the line were not there, that part of the time would not be spent, and the total time would be reduced by this fraction. During this part of the time, regardless of whether it is spent on one large piece or thousands of small pieces, this line of code is on the call stack, where the stack samples will determine it at a speed equal to its share. That's why stack fetching is so effective at finding code that is worth optimizing, whether from leaf instructions or calls in the call tree.

Personally, this link gives how and why the method I use, which is not fancy, but is or more efficient than any method or tool I've seen. Here is a discussion.

+1
source

All Articles