Code Monkey home page Code Monkey logo

Comments (8)

masklinn avatar masklinn commented on July 30, 2024 1

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.

jonhoo avatar jonhoo commented on July 30, 2024

@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.

masklinn avatar masklinn commented on July 30, 2024

@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.

jonhoo avatar jonhoo commented on July 30, 2024

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.

masklinn avatar masklinn commented on July 30, 2024

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.

jonhoo avatar jonhoo commented on July 30, 2024

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.

masklinn avatar masklinn commented on July 30, 2024

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.

chenlijun99 avatar chenlijun99 commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.