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

add support for bpftrace #56

Merged
merged 7 commits into from
Feb 22, 2019
Merged

add support for bpftrace #56

merged 7 commits into from
Feb 22, 2019

Conversation

bcmyers
Copy link
Contributor

@bcmyers bcmyers commented Feb 22, 2019

Hopefully this does the trick. Git is still quite confusing to me. Thanks for the help!

src/collapse/bpftrace.rs Outdated Show resolved Hide resolved
@bcmyers
Copy link
Contributor Author

bcmyers commented Feb 22, 2019

I'll investigate why Windows is failing. I now have a Virtualbox setup for Windows after all that num-format system locale business...

src/collapse/mod.rs Outdated Show resolved Hide resolved
.gitattributes Outdated Show resolved Hide resolved
src/bin/collapse-perf.rs Outdated Show resolved Hide resolved
src/collapse/bpftrace.rs Outdated Show resolved Hide resolved
src/collapse/bpftrace.rs Outdated Show resolved Hide resolved
src/collapse/mod.rs Outdated Show resolved Hide resolved
src/collapse/perf.rs Outdated Show resolved Hide resolved
src/collapse/perf.rs Outdated Show resolved Hide resolved
src/collapse/perf.rs Outdated Show resolved Hide resolved
@bcmyers
Copy link
Contributor Author

bcmyers commented Feb 22, 2019

Think I got all the comments. Let me know what you think.

src/collapse/bpftrace.rs Outdated Show resolved Hide resolved
src/collapse/bpftrace.rs Outdated Show resolved Hide resolved
src/collapse/mod.rs Outdated Show resolved Hide resolved
src/collapse/bpftrace.rs Outdated Show resolved Hide resolved
src/collapse/bpftrace.rs Outdated Show resolved Hide resolved
@jonhoo
Copy link
Owner

jonhoo commented Feb 22, 2019

Ah, @brendangregg just responded in brendangregg/FlameGraph#201 and pointed out that they're actually adding direct support for the perf output format in bpftrace (in bpftrace/bpftrace#438), so maybe we simply shouldn't make this change? I think it'd still be worthwhile to keep the trait changes though, as that'll make it much easier to adopt more formats later!

@bcmyers
Copy link
Contributor Author

bcmyers commented Feb 22, 2019

Ok, so pull out all the bpftrace-related stuff, but keep our trait / architecture / documentation stuff? (means I don't have to re-write the parser :))

Apparently perl scripts won't just run in travis'
windows environment; so instead of running stackcollapse-bfptrace.pl
in the test, let's just use it's pre-computed output.
Since hopefully inferno will eventually have as many binary
applications as the original perl version (one for each "frontend"
such as perf and bpftrace), this is an initial attempt at creating
an abstraction that will make writing all those very similar
applications easier.

Also - Unrelated to the above, this commit incorporates a suggested
change to the test in bptrace.rs.
…dows problem by telling git not to mess with the line endings of our test data
* Documentation
* Rename `collapse_with` to `collapse_file`
* Make sure git leaves the line-endings of all our data files alone
* Prefer `use super::foo` to `use crate::foo`
* Keep separate modules for each `Frontend` implementation
* Rename `PerfOptions` back to `Options`
* Remane `Perf` constructor to `with_options` (and change arg back to `opt`)
* Eliminate `Bpftrace::new`
* Other minor changes
@bcmyers
Copy link
Contributor Author

bcmyers commented Feb 22, 2019

I hope I just did that right. I still don't understand git very well.

@jonhoo
Copy link
Owner

jonhoo commented Feb 22, 2019

Looks perfect! I'm not sure you needed to do a force-push or rebase, but it's fine either way :) Let's see what Travis says, and then merge. Sorry for all the effort you had to go through 😅

@codecov-io
Copy link

codecov-io commented Feb 22, 2019

Codecov Report

Merging #56 into master will decrease coverage by 0.69%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #56     +/-   ##
=========================================
- Coverage   76.48%   75.78%   -0.7%     
=========================================
  Files          13       14      +1     
  Lines        1199     1210     +11     
=========================================
  Hits          917      917             
- Misses        282      293     +11
Impacted Files Coverage Δ
src/flamegraph/mod.rs 82.6% <ø> (ø) ⬆️
src/bin/collapse-perf.rs 0% <0%> (ø) ⬆️
src/collapse/mod.rs 0% <0%> (ø)
tests/collapse-perf.rs 93.87% <100%> (+0.12%) ⬆️
src/collapse/perf.rs 81.37% <76.47%> (-1.2%) ⬇️

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 81b1caa...0ef871c. Read the comment docs.

@jonhoo jonhoo merged commit ff4ae74 into jonhoo:master Feb 22, 2019
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.

3 participants