diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-03-24 15:40:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-26 03:52:57 -0400 |
commit | b3c9ac0846c654dea4df095999ee202e8b4cb253 (patch) | |
tree | 4845ae36123beba5bc9959be7c67cc0ce4bc5a11 /tools/perf/util/callchain.c | |
parent | 59fd53062f71011a68d03f4cd0ba93d822ac3249 (diff) |
perf callchains: Store the map together with the symbol
We need this to know where a symbol in a callchain came from,
for various reasons, among them precise annotation from a
TUI/GUI tool.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1269459619-982-5-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/callchain.c')
-rw-r--r-- | tools/perf/util/callchain.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 883844eb4b0a..db628af6d20d 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c | |||
@@ -185,8 +185,8 @@ create_child(struct callchain_node *parent, bool inherit_children) | |||
185 | 185 | ||
186 | 186 | ||
187 | struct resolved_ip { | 187 | struct resolved_ip { |
188 | u64 ip; | 188 | u64 ip; |
189 | struct symbol *sym; | 189 | struct map_symbol ms; |
190 | }; | 190 | }; |
191 | 191 | ||
192 | struct resolved_chain { | 192 | struct resolved_chain { |
@@ -212,7 +212,7 @@ fill_node(struct callchain_node *node, struct resolved_chain *chain, int start) | |||
212 | return; | 212 | return; |
213 | } | 213 | } |
214 | call->ip = chain->ips[i].ip; | 214 | call->ip = chain->ips[i].ip; |
215 | call->sym = chain->ips[i].sym; | 215 | call->ms = chain->ips[i].ms; |
216 | list_add_tail(&call->list, &node->val); | 216 | list_add_tail(&call->list, &node->val); |
217 | } | 217 | } |
218 | node->val_nr = chain->nr - start; | 218 | node->val_nr = chain->nr - start; |
@@ -318,10 +318,10 @@ __append_chain(struct callchain_node *root, struct resolved_chain *chain, | |||
318 | if (i == chain->nr) | 318 | if (i == chain->nr) |
319 | break; | 319 | break; |
320 | 320 | ||
321 | sym = chain->ips[i].sym; | 321 | sym = chain->ips[i].ms.sym; |
322 | 322 | ||
323 | if (cnode->sym && sym) { | 323 | if (cnode->ms.sym && sym) { |
324 | if (cnode->sym->start != sym->start) | 324 | if (cnode->ms.sym->start != sym->start) |
325 | break; | 325 | break; |
326 | } else if (cnode->ip != chain->ips[i].ip) | 326 | } else if (cnode->ip != chain->ips[i].ip) |
327 | break; | 327 | break; |
@@ -353,9 +353,8 @@ __append_chain(struct callchain_node *root, struct resolved_chain *chain, | |||
353 | return 0; | 353 | return 0; |
354 | } | 354 | } |
355 | 355 | ||
356 | static void | 356 | static void filter_context(struct ip_callchain *old, struct resolved_chain *new, |
357 | filter_context(struct ip_callchain *old, struct resolved_chain *new, | 357 | struct map_symbol *syms) |
358 | struct symbol **syms) | ||
359 | { | 358 | { |
360 | int i, j = 0; | 359 | int i, j = 0; |
361 | 360 | ||
@@ -364,7 +363,7 @@ filter_context(struct ip_callchain *old, struct resolved_chain *new, | |||
364 | continue; | 363 | continue; |
365 | 364 | ||
366 | new->ips[j].ip = old->ips[i]; | 365 | new->ips[j].ip = old->ips[i]; |
367 | new->ips[j].sym = syms[i]; | 366 | new->ips[j].ms = syms[i]; |
368 | j++; | 367 | j++; |
369 | } | 368 | } |
370 | 369 | ||
@@ -373,7 +372,7 @@ filter_context(struct ip_callchain *old, struct resolved_chain *new, | |||
373 | 372 | ||
374 | 373 | ||
375 | int append_chain(struct callchain_node *root, struct ip_callchain *chain, | 374 | int append_chain(struct callchain_node *root, struct ip_callchain *chain, |
376 | struct symbol **syms) | 375 | struct map_symbol *syms) |
377 | { | 376 | { |
378 | struct resolved_chain *filtered; | 377 | struct resolved_chain *filtered; |
379 | 378 | ||