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

Added warnings to -callgraph-mode and added option for stitched LBR. #228

Merged
merged 1 commit into from
Jun 30, 2022

Conversation

Lamoreauxaj
Copy link
Contributor

@Lamoreauxaj Lamoreauxaj commented Jun 24, 2022

This feature has two changes related to callgraph_mode.

  • Based on user feedback from Allow running with sampling if Intel PT is unavailable #224, I added warnings when the -callgraph-mode defaults to either Dwarf or Last_branch_record to notify the user of potential drawbacks from such selection. These warnings only show if they do not explicitly set the flag.
  • Added a fourth option to run with Last_branch_record { stitched = true } which calls perf report --call-graph lbr and perf script --stitch-lbr. There are a few design decisions here though. First I decided to add it as a variant of Callgraph_mode for simplicity of interface for the user. However this has the awkward effect of this now being a parameter needed for both decoding and recording (which Backend_intf doesn't support). I would think this could perhaps be useful in other scenarios and so instead of pulling this out to trace.ml I decided to add a way for decode_events to have access to a Recording.Data.t record. Open to alternative ideas though.

I also added a wiki page to document the options for -callgraph-mode. This is not in the PR, but here is the link to the wiki repo: https://github.com/Lamoreauxaj/magic-trace.wiki.git. See this page. If this PR is merged, this wiki page would need to be merged too (I referenced it in the cli help documentation). And since I referenced it, the domain would need to redirect to the wiki page.

@Lamoreauxaj Lamoreauxaj changed the title Added warnings to [callgraph-mode] and added option for [Stiched_last_branch_record]. Added warnings to callgraph-mode and added option for Stitched_last_branch_record. Jun 24, 2022
@Lamoreauxaj Lamoreauxaj changed the title Added warnings to callgraph-mode and added option for Stitched_last_branch_record. Added warnings to -callgraph-mode and added option for stitched LBR. Jun 24, 2022
src/callgraph_mode.ml Outdated Show resolved Hide resolved
src/callgraph_mode.ml Outdated Show resolved Hide resolved
Lamoreauxaj added a commit to Lamoreauxaj/magic-trace that referenced this pull request Jun 29, 2022
This PR should be merged after janestreet#228 since I referenced that wiki page. And the
wiki (and domain) should be updated when this is merged.

The only code change is a reference to a wiki page within the `-sampling` flag
help message. However the new wiki page draft this is intended to link to can be
seen [here](https://github.com/Lamoreauxaj/magic-trace/wiki/Sampling-Backend).
Additionally I updated the [timer resolution
page](https://github.com/Lamoreauxaj/magic-trace/wiki/Timer-resolution-configuration)
to describe changes to configuration.

Signed-off-by: Aaron Lamoreaux <alamoreaux@janestreet.com>
This feature has two changes related to `callgraph_mode`.

* Based on user feedback from janestreet#224, I added warnings when the `-callgraph-mode`
  defaults to either `Dwarf` or `Last_branch_record` to notify the user of
  potential drawbacks from such selection. These warnings only show if they do
  not explicitly set the flag.

* Added a fourth option to run with `Last_branch_record { stitched = true }`
  which calls `perf report --call-graph lbr` and `perf script --stitch-lbr`.
  There are a few design decisions here though. First I decided to add it as a
  variant of `Callgraph_mode` for simplicity of interface for the user. However
  this has the awkward effect of this now being a parameter needed for both
  decoding and recording (which `Backend_intf` doesn't support). I would think
  this could perhaps be useful in other scenarios and so instead of pulling this
  out to `trace.ml` I decided to add a way for `decode_events` to have access to
  a `Recording.Data.t` record. Open to alternative ideas though.

I also added a wiki page to document the options for `-callgraph-mode`. This is
not in the PR, but here is the link to the wiki repo:
https://github.com/Lamoreauxaj/magic-trace.wiki.git. See [this
page](https://github.com/Lamoreauxaj/magic-trace/wiki/Sampling-callgraph-modes).
If this PR is merged, this wiki page would need to be merged too (I referenced
it in the cli help documentation). And since I referenced it, the domain would
need to redirect to the wiki page.

Signed-off-by: Aaron Lamoreaux <alamoreaux@janestreet.com>
@Lamoreauxaj Lamoreauxaj marked this pull request as ready for review June 29, 2022 20:58
@Xyene Xyene merged commit 5dc8bf6 into janestreet:master Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants