1

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.

1
  • 1
    Ideally, you should shoot for one question per question.
    – Brian Cain
    Oct 22, 2012 at 23:05

1 Answer 1

1

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.

1
  • Why does the -C option prevent multiplexing? Mar 30, 2020 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.