Function trace_tools::subscriber::layer::flamegraph_layer
source · [−]pub fn flamegraph_layer<P: AsRef<Path>>(
stack_filename: P
) -> Result<(FlamegraphLayer, Flamegrapher), Error>
Expand description
Creates a new FlamegraphLayer
.
The given path describes the desired output location of the folded stack file that is generated by
this layer during runtime. This file can then be used to produce a flamegraph by a Flamegrapher
instance, or by the inferno
tool.
Returns a Result
of the tuple containing the FlamegraphLayer
and a Flamegrapher
that
can be used to produce the flamegraph image at the end of profiling. This can be ignored if you just
need the folded stack file, or will use inferno
externally for the graph generation.
Errors
This function can fail in the following ways:
- There was an error creating/truncating the folded stack file at the given location.
Panics
This function will panic if the program is not built with --cfg tokio_unstable
.