Question

I am trying to use perf record to record 15 hardware and trace point events.

I want to understand the following:

  1. event based sampling: from the docs I understood perf record will sample whenever 64-bit counter corresponding to that events will over flow. Is that right? The counter will overflow after ~ 2^64 such events?

  2. When I have more events to measure than the number of PMUs/counters, do I have to pass any specific switch to use multiplexing. How does overflow-event behave in the presence of multiplexing.

  3. What is the purpose/use of the switch "-c" ? Can I make the counters to overflow every n-events using this switch?

Please help.

Was it helpful?

Solution

The counter will overflow after ~ 2^64 such events?

That is correct.

do I have to pass any specific switch to use multiplexing.

No. (Using the -C option will effectively bar it though).

On multiplexing:

If there are more events than counters, the kernel uses time multiplexing (switch frequency = HZ, generally 100 or 1000) to give each event a chance to access the monitoring hardware.

What is the purpose of the switch "-c" ?

Yes, you are right. The switch -c allows you to specify the sampling period. This means if you specify the sampling period to be 2, at every 2nd event, the counter will overflow. And then all the information (like architectural state, etc.) when the event occurred will be recorded into the buffer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top