Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155224
b: refs/heads/master
c: e05b876
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Jul 5, 2009
1 parent e2921d5 commit acf42ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 94a8eb028a57854157a936c7e66b09e2559f115a
refs/heads/master: e05b876c222178bc6abcfa9f23d8311731691046
12 changes: 8 additions & 4 deletions trunk/tools/perf/util/callchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@ static void __sort_chain_graph(struct callchain_node *node, u64 min_hit)
struct callchain_node *child;

node->rb_root = RB_ROOT;
node->cumul_hit = node->hit;

chain_for_each_child(child, node) {
__sort_chain_graph(child, min_hit);
if (child->cumul_hit >= min_hit)
rb_insert_callchain(&node->rb_root, child, GRAPH);
node->cumul_hit += child->cumul_hit;
}
}

Expand Down Expand Up @@ -159,7 +157,7 @@ add_child(struct callchain_node *parent, struct ip_callchain *chain,
new = create_child(parent, false);
fill_node(new, chain, start, syms);

new->hit = 1;
new->cumul_hit = new->hit = 1;
}

/*
Expand Down Expand Up @@ -189,6 +187,7 @@ split_add_child(struct callchain_node *parent, struct ip_callchain *chain,

/* split the hits */
new->hit = parent->hit;
new->cumul_hit = parent->cumul_hit;
new->val_nr = parent->val_nr - idx_local;
parent->val_nr = idx_local;

Expand Down Expand Up @@ -216,10 +215,13 @@ __append_chain_children(struct callchain_node *root, struct ip_callchain *chain,
unsigned int ret = __append_chain(rnode, chain, start, syms);

if (!ret)
return;
goto cumul;
}
/* nothing in children, add to the current node */
add_child(root, chain, start, syms);

cumul:
root->cumul_hit++;
}

static int
Expand Down Expand Up @@ -261,6 +263,8 @@ __append_chain(struct callchain_node *root, struct ip_callchain *chain,
/* we match 100% of the path, increment the hit */
if (i - start == root->val_nr && i == chain->nr) {
root->hit++;
root->cumul_hit++;

return 0;
}

Expand Down

0 comments on commit acf42ef

Please sign in to comment.