Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using PERF_RECORD_MISC_SWITCH_OUT_PREEMPT #233

Open
tilsche opened this issue Nov 18, 2022 · 3 comments
Open

Using PERF_RECORD_MISC_SWITCH_OUT_PREEMPT #233

tilsche opened this issue Nov 18, 2022 · 3 comments

Comments

@tilsche
Copy link
Member

tilsche commented Nov 18, 2022

I happened to stumble across PERF_RECORD_MISC_SWITCH_OUT_PREEMPT. It is a flag that available in the misc header for PERF_RECORD_SWITCH and PERF_RECORD_SWITCH_CPU_WIDE events. It exists since 2018 (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=101592b4904ecf6b8ed2a4784d41d180319d95a1).

Now that could be useful information, but

  • It is not documented in the manpage (only in the header)
  • I have no idea how to map that to OTF2 in system monitoring mode.
@bertwesarg
Copy link
Contributor

better ask "how should this be visualized"? from this we might figure a way to map it to OTF2

@bertwesarg
Copy link
Contributor

how is the SWITCH event modeled into OTF2? If it is a function, why not use an attribute to the enter event, whether the bit is set or not. In Vampir you could then create a metric out of it (assuming its a numeric value) and visualize where preempt switches occurred (perf radar/overlay).

@tilsche
Copy link
Member Author

tilsche commented Nov 21, 2022

how is the SWITCH event modeled into OTF2? If it is a function, why not use an attribute to the enter event, whether the bit is set or not. In Vampir you could then create a metric out of it (assuming its a numeric value) and visualize where preempt switches occurred (perf radar/overlay).

The "switch out" correspond to CALLING_CONTEXT_LEAVE events. I'm not really sure how this works in the process mode, but in system monitoring mode it might be difficult to find a scalable visualization - the preemption corresponds to the specific process (region). With some tracking it might be possible to derive a metric "number of currently preempted processes" to indicate over-subscription. That said I can imagine many corner cases where this tracking fails (e.g., migrations, killed threads). But also having an indication just when showing the details of the preempted process interval could already be helpful.

This might also be interesting for a current analysis we do on lo2s traces, even without any visualization.

In any case, so far it's just brainstorming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants