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

Omitting --per-thread leads to split traces (and other weird behavior) #236

Open
Lamoreauxaj opened this issue Jun 30, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Lamoreauxaj
Copy link
Contributor

As of #234 (when merged), --per-thread will be disabled sometimes even when not running with -multi-thread. However this means that a single snapshot can contain outdated data if a program switched CPUs. For example see the following traces:

image
image

The first image at the start zoomed in looks like this:

image

Both of these have large gaps in time between two parts of the trace because the data was stored in two separate buffers. Additionally the first image also has a decode error with pid of 0, and a cbr event with a unrealistic timestamp and incorrect pid.

Some potential changes could be made here. This issue is just to document this and lead to potential future investigation.

  • magic-trace could always run with --per-thread if perf no longer fails to mmap extra events with this flag.
  • magic-trace could detect that this single trace included multiple CPUs and instead only take the last contiguous chunk of data from the last CPU the process was running on when snapshotted. This would prevent the split traces even without --per-thread.
  • magic-trace could filter the decode errors with pid of 0. It should be investigated why perf outputs these at all.
  • magic-trace could try to detect invalid pids to eliminate that extraneous cbr event or figure out why perf gave this event at all.
@Lamoreauxaj Lamoreauxaj added the bug Something isn't working label Jun 30, 2022
@Lamoreauxaj Lamoreauxaj changed the title --per-thread leads to split traces (and other weird behavior) Omitting --per-thread leads to split traces (and other weird behavior) Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant