Skip to content

Commit

Permalink
Links to flamegraph renderers (#11)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: facebookexperimental/allocative#11

Reviewed By: ndmitchell

Differential Revision: D52630519

Pulled By: stepancheg

fbshipit-source-id: 0ce683c4cdcdf00dde904a2368aa2032e571b513
  • Loading branch information
JustusAdam authored and facebook-github-bot committed Jan 9, 2024
1 parent be21c30 commit b990c20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion allocative/allocative/src/flamegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ use crate::visitor::VisitorImpl;
use crate::Allocative;

/// Node in flamegraph tree.
///
/// Can be written to flamegraph format with [`write`](FlameGraph::write).
#[derive(Debug, Default, Clone)]
pub struct FlameGraph {
children: HashMap<Key, FlameGraph>,
Expand Down Expand Up @@ -82,7 +84,10 @@ impl FlameGraph {
}
}

/// Write flamegraph in format suitable for `flamegraph.pl` or `inferno`.
/// Write flamegraph in format suitable for [`flamegraph.pl`] or [inferno].
///
/// [flamegraph.pl]: https://github.com/brendangregg/FlameGraph
/// [inferno]: https://github.com/jonhoo/inferno
pub fn write(&self) -> String {
let mut r = String::new();
self.write_flame_graph_impl(&[], &mut r);
Expand Down

0 comments on commit b990c20

Please sign in to comment.