diff options
Diffstat (limited to 'tools/perf/util/callchain.c')
-rw-r--r-- | tools/perf/util/callchain.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index f231f43424d2..f0b23f309edc 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c | |||
@@ -86,10 +86,10 @@ __sort_chain_flat(struct rb_root *rb_root, struct callchain_node *node, | |||
86 | * sort them by hit | 86 | * sort them by hit |
87 | */ | 87 | */ |
88 | static void | 88 | static void |
89 | sort_chain_flat(struct rb_root *rb_root, struct callchain_node *node, | 89 | sort_chain_flat(struct rb_root *rb_root, struct callchain_root *root, |
90 | u64 min_hit, struct callchain_param *param __used) | 90 | u64 min_hit, struct callchain_param *param __used) |
91 | { | 91 | { |
92 | __sort_chain_flat(rb_root, node, min_hit); | 92 | __sort_chain_flat(rb_root, &root->node, min_hit); |
93 | } | 93 | } |
94 | 94 | ||
95 | static void __sort_chain_graph_abs(struct callchain_node *node, | 95 | static void __sort_chain_graph_abs(struct callchain_node *node, |
@@ -108,11 +108,11 @@ static void __sort_chain_graph_abs(struct callchain_node *node, | |||
108 | } | 108 | } |
109 | 109 | ||
110 | static void | 110 | static void |
111 | sort_chain_graph_abs(struct rb_root *rb_root, struct callchain_node *chain_root, | 111 | sort_chain_graph_abs(struct rb_root *rb_root, struct callchain_root *chain_root, |
112 | u64 min_hit, struct callchain_param *param __used) | 112 | u64 min_hit, struct callchain_param *param __used) |
113 | { | 113 | { |
114 | __sort_chain_graph_abs(chain_root, min_hit); | 114 | __sort_chain_graph_abs(&chain_root->node, min_hit); |
115 | rb_root->rb_node = chain_root->rb_root.rb_node; | 115 | rb_root->rb_node = chain_root->node.rb_root.rb_node; |
116 | } | 116 | } |
117 | 117 | ||
118 | static void __sort_chain_graph_rel(struct callchain_node *node, | 118 | static void __sort_chain_graph_rel(struct callchain_node *node, |
@@ -133,11 +133,11 @@ static void __sort_chain_graph_rel(struct callchain_node *node, | |||
133 | } | 133 | } |
134 | 134 | ||
135 | static void | 135 | static void |
136 | sort_chain_graph_rel(struct rb_root *rb_root, struct callchain_node *chain_root, | 136 | sort_chain_graph_rel(struct rb_root *rb_root, struct callchain_root *chain_root, |
137 | u64 min_hit __used, struct callchain_param *param) | 137 | u64 min_hit __used, struct callchain_param *param) |
138 | { | 138 | { |
139 | __sort_chain_graph_rel(chain_root, param->min_percent / 100.0); | 139 | __sort_chain_graph_rel(&chain_root->node, param->min_percent / 100.0); |
140 | rb_root->rb_node = chain_root->rb_root.rb_node; | 140 | rb_root->rb_node = chain_root->node.rb_root.rb_node; |
141 | } | 141 | } |
142 | 142 | ||
143 | int register_callchain_param(struct callchain_param *param) | 143 | int register_callchain_param(struct callchain_param *param) |
@@ -380,7 +380,7 @@ static void filter_context(struct ip_callchain *old, struct resolved_chain *new, | |||
380 | } | 380 | } |
381 | 381 | ||
382 | 382 | ||
383 | int append_chain(struct callchain_node *root, struct ip_callchain *chain, | 383 | int append_chain(struct callchain_root *root, struct ip_callchain *chain, |
384 | struct map_symbol *syms, u64 period) | 384 | struct map_symbol *syms, u64 period) |
385 | { | 385 | { |
386 | struct resolved_chain *filtered; | 386 | struct resolved_chain *filtered; |
@@ -398,7 +398,10 @@ int append_chain(struct callchain_node *root, struct ip_callchain *chain, | |||
398 | if (!filtered->nr) | 398 | if (!filtered->nr) |
399 | goto end; | 399 | goto end; |
400 | 400 | ||
401 | __append_chain_children(root, filtered, 0, period); | 401 | __append_chain_children(&root->node, filtered, 0, period); |
402 | |||
403 | if (filtered->nr > root->max_depth) | ||
404 | root->max_depth = filtered->nr; | ||
402 | end: | 405 | end: |
403 | free(filtered); | 406 | free(filtered); |
404 | 407 | ||