简体   繁体   English

perf记录-c选项和溢出事件之间的关系是什么?

[英]perf record what is relation between -c option and overflow events?

I am trying to use perf record to record 15 hardware and trace point events. 我正在尝试使用性能记录来记录15个硬件和跟踪点事件。

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. 基于事件的采样:据我了解,文档中的perf记录将在与该事件相对应的64位计数器溢出时进行采样。 Is that right? 那正确吗? The counter will overflow after ~ 2^64 such events? 计数器会在〜2 ^ 64个此类事件后溢出吗?

  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. 当我要测量的事件多于PMU /计数器的数量时,是否必须传递任何特定的开关才能使用多路复用。 How does overflow-event behave in the presence of multiplexing. 在多路复用的情况下,溢出事件如何表现。

  3. What is the purpose/use of the switch "-c" ? 开关“ -c”的用途是什么? Can I make the counters to overflow every n-events using this switch? 我可以使用此开关使计数器每n个事件溢出一次吗?

Please help. 请帮忙。

The counter will overflow after ~ 2^64 such events? 计数器会在〜2 ^ 64个此类事件后溢出吗?

That is correct . 这是正确的

do I have to pass any specific switch to use multiplexing. 我必须通过任何特定的开关才能使用多路复用。

No. (Using the -C option will effectively bar it though). 否。(使用-C选项将有效地禁止它)。

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. 如果事件多于计数器,则内核使用时间多路复用(开关频率= HZ,通常为100或1000)为每个事件提供访问监视硬件的机会。

What is the purpose of the switch "-c" ? 开关“ -c”的作用是什么?

Yes, you are right. 是的,你是对的。 The switch -c allows you to specify the sampling period. 开关-c允许您指定采样周期。 This means if you specify the sampling period to be 2, at every 2nd event, the counter will overflow. 这意味着,如果您将采样周期指定为2,则在每个第二事件中,计数器都会溢出。 And then all the information (like architectural state, etc.) when the event occurred will be recorded into the buffer. 然后,事件发生时的所有信息(例如架构状态等)都将记录到缓冲区中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM