Comments (8)
I'm not entirely sure how time factors into this, since the collapsed stacks don't have any timing information from the original execution in them
There's no specific time axis, but assuming a regular sample rate and the sampling source simply writes sample as they go (which seems like the intent given the format) each sample represents a time interval of sort, and so the entire sequence (and flamechart) is a timeline even if not specifically labelled thus.
from inferno.
@masklinn I guess what makes me feel weird about this is the fact that stackcollapse
still happens first, and it also sorts the stacks, so what kind of timing information is still left at that point for flamegraph
to draw from?
from inferno.
@jonhoo AFAIK flamegraph(.pl anyway) doesn’t stackcollapse itself, so you can feed it an ordered sequence of stacks if you output your data in that format from the start.
Also it looks like the sorting is mostly an artefact from copy/pasting (most of the stackcollapse scripts take after the original and fold stacks in a collapsed
hash with a non-1 count), some do without (eg stackcollapse-bpftrace or stackcollapse-ljp)
from inferno.
Ah, interesting, so the expectation is that in chart mode you don't collapse the stacks? They still need to be in the right format though, no? Sorting is also necessary in non-chart mode, otherwise the algorithm wouldn't correctly identify shared parents.
from inferno.
Ah, interesting, so the expectation is that in chart mode you don't collapse the stacks?
That's what I'd guess / assume. If I remember correctly flamegraph.pl does its own sorting and grouping. Unless I'm mistaken what the stackcollapse scripts do is mostly reformat stacks to the input format of flamegraph (usually from some multiline stack dump to the single-line stacks of flamegraph.pl).
They still need to be in the right format though, no?
Sure but the input format of flamegraph.pl isn't exactly complex, IIRC brendan gregg had an example where he dumped one out of a dtrace script.
Sorting is also necessary in non-chart mode, otherwise the algorithm wouldn't correctly identify shared parents.
Indeed, but as you link to in the issue description flamegraph.pl does that internally, it does not need a sorted and merged input.
from inferno.
Ah, I see what you mean. I think what this suggests is that we really want our collapsers to be split into two "halves". One that turns a particular input format into the "standard" collapsed format, and one that actually collapses stacks expressed in that format. For flame charts, you'd only use the first part, and not sort the flamegraph input. For regular flame graphs, you would use both parts, and also sort the flamegraph input. Does that seem right?
/cc @jasonrhansen
from inferno.
possibly? I’m not too sure what you mean collapsing stacks. As far as I can tell all that was changed in pl is not sorting stacks before merging, such that it’s only merging stacks (frames?) which are adjacent in the input rather than across the entire file.
from inferno.
Ah, I see what you mean. I think what this suggests is that we really want our collapsers to be split into two "halves". One that turns a particular input format into the "standard" collapsed format, and one that actually collapses stacks expressed in that format. For flame charts, you'd only use the first part, and not sort the flamegraph input. For regular flame graphs, you would use both parts, and also sort the flamegraph input. Does that seem right?
Hi @jonhoo. I've recently discovered inferno and its support for --flamechart
.
However, if I try to generate a flamechart using
$ perf script --no-inline -i perf.data | inferno-collapse-perf | inferno-flamegraph --flamechart > a.svg
I still get a flamegraph with merged (collapsed? whatever it's called) stacks. I think what you were trying to say in that comment could be the thing that I need. I think inferno-collapse-perf
is in fact merging the stacks.
By any chance, do you know any tool that can convert from perf.data
to a format accepted by inferno-flamegraph, that does not perform stack merging?
Thanks
from inferno.
Related Issues (20)
- More Firefox rendering issues HOT 1
- `inferno 0.11.8` removed sealed `CollapsePrivate` trait from public API HOT 1
- Lower level API to flamegraph renderer HOT 1
- 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
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.