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

Correctly annotate jitdump stack frames #202

Merged
merged 3 commits into from
Dec 27, 2020
Merged

Conversation

asherkin
Copy link
Contributor

When using perf with the modern jitdump format, perf inject creates an ELF object for each JITted function and replaces the function entries in the recording to point to those SOs. This causes stackcollapse-perf to not recognise the functions as the module is no longer displayed as being the perf JIT map for the process.

When using perf with the modern jitdump format, `perf inject` creates an
ELF object for each JITted function and replaces the function entries in
the recording to point to those SOs. This causes `stackcollapse-perf` to
not recognise the functions as the module is no longer displayed as
being the perf JIT map for the process.
@codecov
Copy link

codecov bot commented Dec 27, 2020

Codecov Report

Merging #202 (7e2da84) into master (f2f1e9a) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #202   +/-   ##
=======================================
  Coverage   90.08%   90.08%           
=======================================
  Files          17       17           
  Lines        2239     2239           
=======================================
  Hits         2017     2017           
  Misses        222      222           
Impacted Files Coverage Δ
src/collapse/perf.rs 97.35% <100.00%> (ø)

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 f2f1e9a...7e2da84. Read the comment docs.

@jonhoo
Copy link
Owner

jonhoo commented Dec 27, 2020

Good catch! Could you please include a test case with this new format as well?

@asherkin
Copy link
Contributor Author

Very happy to add some tests, but it looks like the existing test infrastructure does not test with any of the options enabled (so this would be a no-op) - so I could do with some guidance on how you'd like them added.

@jonhoo
Copy link
Owner

jonhoo commented Dec 27, 2020

Not sure I follow? The Java flamegraph test for example specifically runs with the java color palette:

inferno/tests/flamegraph.rs

Lines 135 to 146 in f2f1e9a

#[test]
fn flamegraph_colors_java() {
let input_file = "./flamegraph/test/results/perf-java-stacks-01-collapsed-all.txt";
let expected_result_file = "./tests/data/flamegraph/colors/java.svg";
let mut options = flamegraph::Options::default();
options.colors = Palette::from_str("java").unwrap();
options.bgcolors = Some(BackgroundColor::from_str("blue").unwrap());
options.hash = true;
test_flamegraph(input_file, expected_result_file, options).unwrap();
}

@asherkin
Copy link
Contributor Author

Test added - I had only seen the unit tests and completely missed the integration tests 😄

@jonhoo
Copy link
Owner

jonhoo commented Dec 27, 2020

I also just realized I linked you to the flamegraph tests 🤦 But glad you found them!

jonhoo
jonhoo previously approved these changes Dec 27, 2020
@jonhoo
Copy link
Owner

jonhoo commented Dec 27, 2020

Would you mind also updating the CHANGELOG?

@jonhoo jonhoo merged commit 2e07925 into jonhoo:master Dec 27, 2020
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.

2 participants