mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
perf top: Decay periods in callchains
It missed to decay periods in callchains when decaying hist entries. This resulted in more than 100 percent overhead in callchains in the fractal style output. Reported-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Cc: Andi Kleen <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
915b0882c3
commit
42b276a235
3 changed files with 30 additions and 0 deletions
|
|
@ -925,6 +925,34 @@ void free_callchain(struct callchain_root *root)
|
|||
free_callchain_node(&root->node);
|
||||
}
|
||||
|
||||
static u64 decay_callchain_node(struct callchain_node *node)
|
||||
{
|
||||
struct callchain_node *child;
|
||||
struct rb_node *n;
|
||||
u64 child_hits = 0;
|
||||
|
||||
n = rb_first(&node->rb_root_in);
|
||||
while (n) {
|
||||
child = container_of(n, struct callchain_node, rb_node_in);
|
||||
|
||||
child_hits += decay_callchain_node(child);
|
||||
n = rb_next(n);
|
||||
}
|
||||
|
||||
node->hit = (node->hit * 7) / 8;
|
||||
node->children_hit = child_hits;
|
||||
|
||||
return node->hit;
|
||||
}
|
||||
|
||||
void decay_callchain(struct callchain_root *root)
|
||||
{
|
||||
if (!symbol_conf.use_callchain)
|
||||
return;
|
||||
|
||||
decay_callchain_node(&root->node);
|
||||
}
|
||||
|
||||
int callchain_node__make_parent_list(struct callchain_node *node)
|
||||
{
|
||||
struct callchain_node *parent = node->parent;
|
||||
|
|
|
|||
|
|
@ -253,6 +253,7 @@ int callchain_node__fprintf_value(struct callchain_node *node,
|
|||
FILE *fp, u64 total);
|
||||
|
||||
void free_callchain(struct callchain_root *root);
|
||||
void decay_callchain(struct callchain_root *root);
|
||||
int callchain_node__make_parent_list(struct callchain_node *node);
|
||||
|
||||
#endif /* __PERF_CALLCHAIN_H */
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ static bool hists__decay_entry(struct hists *hists, struct hist_entry *he)
|
|||
he_stat__decay(&he->stat);
|
||||
if (symbol_conf.cumulate_callchain)
|
||||
he_stat__decay(he->stat_acc);
|
||||
decay_callchain(he->callchain);
|
||||
|
||||
diff = prev_period - he->stat.period;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue