Lines Matching +full:child +full:- +full:node
1 # flamegraph.py - create flame graphs from perf samples
2 # SPDX-License-Identifier: GPL-2.0
6 # perf record -a -g -F 99 sleep 60
11 # perf script flamegraph -a -F 99 sleep 60
15 # Works in tandem with d3-flame-graph by Martin Spier <mspier@netflix.com>
25 class Node: class
44 self.stack = Node("root")
49 "the js-d3-flame-graph (RPM) or libjs-d3-flame-graph (deb) "
51 "(--template PATH) or another output format "
52 "(--format FORMAT).".format(self.args.template),
56 def find_or_create_node(self, node, name, dso): argument
61 for child in node.children:
62 if child.name == name and child.libtype == libtype:
63 return child
65 child = Node(name, libtype)
66 node.children.append(child)
67 return child
70 node = self.find_or_create_node(self.stack, event["comm"], None)
73 node = self.find_or_create_node(
74 node, entry.get("sym", {}).get("name"), event.get("dso"))
76 node = self.find_or_create_node(
77 node, entry.get("symbol"), event.get("dso"))
78 node.value += 1
85 with io.open(self.args.template, encoding="utf-8") as f:
96 if output_fn == "-":
97 with io.open(sys.stdout.fileno(), "w", encoding="utf-8", closefd=False) as out:
102 with io.open(output_fn, "w", encoding="utf-8") as out:
111 parser.add_argument("-f", "--format",
114 parser.add_argument("-o", "--output",
116 parser.add_argument("--template",
117 default="/usr/share/d3-flame-graph/d3-flamegraph-base.html",
119 parser.add_argument("-i", "--input",