Function inferno::flamegraph::from_lines

source ·
pub fn from_lines<'a, I, W>(
    opt: &mut Options<'_>,
    lines: I,
    writer: W
) -> Result<()>
where I: IntoIterator<Item = &'a str>, W: Write,
Expand description

Produce a flame graph from an iterator over folded stack lines.

This function expects each folded stack to contain the following whitespace-separated fields:

  • A semicolon-separated list of frame names (e.g., main;foo;bar;baz).
  • A sample count for the given stack.
  • An optional second sample count.

If two sample counts are provided, a differential flame graph is produced. In this mode, the flame graph uses the difference between the two sample counts to show how the sample counts for each stack has changed between the first and second profiling.

The resulting flame graph will be written out to writer in SVG format.