aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2011-03-30 05:25:59 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-04-05 14:36:47 -0400
commit1d878083c253fb2e2471b39e825447aca66fc05c (patch)
tree55aa2651f09d1a2b85aef38a53cfed16770f9bd0 /tools
parentcc446446ff48e82c157dc8c937a3490f2a2ce535 (diff)
perf probe: Fix to find recursively inlined function
Fix die_find_inlinefunc() to return correct innermost inlined function at given address. Without this fix, it returns the outermost inlined function. Cc: 2nddept-manager@sdl.hitachi.co.jp Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Lin Ming <ming.m.lin@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <20110330092559.2132.78634.stgit@ltc236.sdl.hitachi.co.jp> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/probe-finder.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 5473f11a9bc..689ab462a18 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -497,7 +497,20 @@ static int __die_find_inline_cb(Dwarf_Die *die_mem, void *data)
497static Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, 497static Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
498 Dwarf_Die *die_mem) 498 Dwarf_Die *die_mem)
499{ 499{
500 return die_find_child(sp_die, __die_find_inline_cb, &addr, die_mem); 500 Dwarf_Die tmp_die;
501
502 sp_die = die_find_child(sp_die, __die_find_inline_cb, &addr, &tmp_die);
503 if (!sp_die)
504 return NULL;
505
506 /* Inlined function could be recursive. Trace it until fail */
507 while (sp_die) {
508 memcpy(die_mem, sp_die, sizeof(Dwarf_Die));
509 sp_die = die_find_child(sp_die, __die_find_inline_cb, &addr,
510 &tmp_die);
511 }
512
513 return die_mem;
501} 514}
502 515
503/* Walker on lines (Note: line number will not be sorted) */ 516/* Walker on lines (Note: line number will not be sorted) */