Comments (7)
A follow-up comment to brendangregg/FlameGraph#201 points out that they're actually adding direct support for the perf
output format in bpftrace
, so I'm going to close this for the same reason we cut the bpftrace
parts from #56.
For interested readers, the hope is that with bpftrace/bpftrace#438 + bpftrace/bpftrace#430 + bpftrace/bpftrace#56, it should be possible to simply run
# bpftrace -e 'profile:hz:49 { @[kstack(folded), ustack(folded)]++ } interval:s:30 { exit() }' | flamegraph > out.svg
The folding happens entirely within bpftrace
, and produces a format that is directly consumable by flamegraph
(both ours and theirs hopefully).
from inferno.
Hey @jonhoo I lost track of this but thanks for you kind reply and I'm glad things worked!
from inferno.
Hey @jonhoo,
I stumbled upon this project and I'm not sure I understand it yet, let alone this issue 😬 , but I'd like to contribute.
How should I start and what's the outcome for this?
from inferno.
Hi @felippemr! I'd recommend you start either with the video where this started or read up on flamegraph on your own!
from inferno.
It does look like parsing the output of bpftrace
should be pretty easy given the code in stackcollapse-bpftrace.pl. I'm struggling with producing the relevant bpftrace
command, though, to produce the kind of file that gets fed to the stackcollapse script (Since I don't really know perl, I think I need to generate some sample input to play around with as opposed to just reading the original code). Do you know what the magic bpftrace
incantations are to produce the kind of file stackcollapse-bpftrace.pl
is designed to ingest?
from inferno.
To get you started, something like
$ sudo bpftrace -e 'profile:hz:99 { @[kstack()] = count(); }'
There's some example output here, and here's some stuff I just got:
@[
pipe_poll+5
do_sys_poll+594
__se_sys_poll+44
do_syscall_64+91
entry_SYSCALL_64_after_hwframe+68
]: 1
@[
_raw_spin_unlock_irq+19
finish_task_switch+132
__sched_text_start+675
schedule+50
futex_wait_queue_me+187
futex_wait+317
do_futex+711
__se_sys_futex+312
do_syscall_64+91
entry_SYSCALL_64_after_hwframe+68
]: 1
@[
_nv031488rm+19
]: 2
@[]: 5
@[
cpuidle_enter_state+185
do_idle+535
cpu_startup_entry+25
start_kernel+1320
secondary_startup_64+164
]: 89
@[
cpuidle_enter_state+185
do_idle+535
cpu_startup_entry+25
start_secondary+426
secondary_startup_64+164
]: 982
from inferno.
(you can also use ustack
to get the user part of the stack, but then you should probably also be running some user-space program that has debug symbols and limit to its PID)
from inferno.
Related Issues (20)
- Color diffusion mode gives less useful results in flamechart mode HOT 2
- Support for simplifying recursive function calls as stackcollapse perl scripts HOT 7
- Support for collapsing source lines from -F+srcline in `perf script` outputs HOT 1
- atty 0.2 has a potential unaligned read HOT 3
- 0.11.15 build fails on Rust 1.62 HOT 1
- Single stack detection can be wrong if the event contains multiple colon HOT 3
- `Input data ends in the middle of a stack.` when using on result of attaching HOT 1
- Differential output tooltips are confusing HOT 4
- Differential output only calculates diff correctly for leaves (most specific frames) HOT 4
- support hot/cold flamegraphs HOT 1
- Document cargo features in readme HOT 1
- flamegraph does not contain sys_enter_* calls with params HOT 3
- Documentation, especially of folded format HOT 3
- publish packages HOT 5
- Error in generated SVG: PCDATA invalid Char value (macos) HOT 5
- Dependencies versions too loose HOT 1
- wallClockProfiler support
- graph diffs from perl flamegraph HOT 3
- Upgrade quick-xml
- Align FlameGraph color scheme to match original Perl script output HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inferno.