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

Support multiple --skip-after #231

Merged
merged 3 commits into from Mar 3, 2022
Merged

Conversation

bsilver8192
Copy link
Contributor

perf is stopping short on some of my backtraces (I think it's related to
complex C++ code in the stack), which fragments the relevant functions
in the flamegraph. --skip-after works great to avoid this, but I want
to do it for multiple functions.

perf is stopping short on some of my backtraces (I think it's related to
complex C++ code in the stack), which fragments the relevant functions
in the flamegraph. `--skip-after` works great to avoid this, but I want
to do it for multiple functions.
@codecov
Copy link

codecov bot commented Mar 1, 2022

Codecov Report

Merging #231 (6a8dbdb) into master (4732660) will decrease coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #231      +/-   ##
==========================================
- Coverage   87.01%   86.85%   -0.16%     
==========================================
  Files          17       17              
  Lines        2379     2396      +17     
==========================================
+ Hits         2070     2081      +11     
- Misses        309      315       +6     
Impacted Files Coverage Δ
src/collapse/perf.rs 97.97% <100.00%> (+0.12%) ⬆️
src/flamegraph/svg.rs 76.07% <0.00%> (-1.85%) ⬇️
src/flamegraph/mod.rs 86.89% <0.00%> (-1.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4732660...6a8dbdb. Read the comment docs.

Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, and definitely sounds useful! Could you add a test with multiple skip-afters though? Or just update the current one to have multiple filters?

@bsilver8192
Copy link
Contributor Author

This looks great, and definitely sounds useful! Could you add a test with multiple skip-afters though? Or just update the current one to have multiple filters?

Done. I went with adding a new one to make sure all the branches are covered (I assume that's what codecov is saying? I haven't dug into what numbers it's reporting).

// without `skip_after` some collapsed lines would look like:
// go;[unknown];x_cgo_notify_runtime_init_done;runtime.main;main.init;...
if line.contains("main.init") {
assert!(line.contains("main.init;")); // we removed the frames above "main.init"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, reading this test again. I think this should be line.starts_with, not line.contains. Otherwise it doesn't seem to test much?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Fixed them both, and confirmed that the tests fail if I remove things from skip_after.

Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks!

@jonhoo jonhoo merged commit cab45b3 into jonhoo:master Mar 3, 2022
@bsilver8192 bsilver8192 deleted the multiple-skip-after branch March 3, 2022 04:04
@jonhoo jonhoo mentioned this pull request Mar 3, 2022
martinxyz added a commit to martinxyz/flamegraph that referenced this pull request Mar 12, 2022
This follows jonhoo/inferno#231

Now we also support multiple --skip-after arguments.
Update docu to reflect this.

A semver bump will be required because FlamegraphOptions is public.
martinxyz added a commit to martinxyz/flamegraph that referenced this pull request Mar 12, 2022
This follows jonhoo/inferno#231

Now we also support multiple --skip-after arguments.
Update docu to reflect this.

A semver bump will be required because FlamegraphOptions is public.
djc pushed a commit to flamegraph-rs/flamegraph that referenced this pull request Mar 21, 2022
This follows jonhoo/inferno#231

Now we also support multiple --skip-after arguments.
Update docu to reflect this.

A semver bump will be required because FlamegraphOptions is public.
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