aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2011-08-11 07:02:35 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-08-12 08:22:46 -0400
commita128405c6b40371c59c34b00cc66ed06285b9551 (patch)
tree4ce07ab8dd02161b5acd678498652916ef07b309 /tools
parent8afa2a707d3d1320df5d35966729ac5262da737d (diff)
perf probe: Fix line walker to check CU correctly
Fix line walker to check whether a given DIE is CU or not. Actually this function accepts CU, subprogram and inlined_subroutine DIEs. Without this fix, perf probe always fails to analyze lines on inlined functions; $ perf probe -L pre_schedule Debuginfo analysis failed. (-2) Error: Failed to show lines. (-2) This fixes that bug, as below. $ perf probe -L pre_schedule <pre_schedule@/home/mhiramat/ksrc/linux-2.6/kernel/sched.c:0> 0 static inline void pre_schedule(struct rq *rq, struct task_struct *prev { 2 if (prev->sched_class->pre_schedule) 3 prev->sched_class->pre_schedule(rq, prev); } /* rq->lock is NOT held, but preemption is disabled */ Changes from v1: - Update against current tip tree.(Fix dwarf-aux.c) Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Masami Hiramatsu <masami.hiramatsu@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: yrl.pp-manager.tt@hitachi.com Link: http://lkml.kernel.org/r/20110811110235.19900.20614.stgit@fedora15 Signed-off-by: Masami Hiramatsu <masami.hiramatsu@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/dwarf-aux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index fddf40f30d3e..d35b454f98b8 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -439,7 +439,7 @@ static int __die_walk_culines_cb(Dwarf_Die *sp_die, void *data)
439 439
440/** 440/**
441 * die_walk_lines - Walk on lines inside given DIE 441 * die_walk_lines - Walk on lines inside given DIE
442 * @rt_die: a root DIE (CU or subprogram) 442 * @rt_die: a root DIE (CU, subprogram or inlined_subroutine)
443 * @callback: callback routine 443 * @callback: callback routine
444 * @data: user data 444 * @data: user data
445 * 445 *
@@ -460,12 +460,12 @@ int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data)
460 size_t nlines, i; 460 size_t nlines, i;
461 461
462 /* Get the CU die */ 462 /* Get the CU die */
463 if (dwarf_tag(rt_die) == DW_TAG_subprogram) 463 if (dwarf_tag(rt_die) != DW_TAG_compile_unit)
464 cu_die = dwarf_diecu(rt_die, &die_mem, NULL, NULL); 464 cu_die = dwarf_diecu(rt_die, &die_mem, NULL, NULL);
465 else 465 else
466 cu_die = rt_die; 466 cu_die = rt_die;
467 if (!cu_die) { 467 if (!cu_die) {
468 pr_debug2("Failed to get CU from subprogram\n"); 468 pr_debug2("Failed to get CU from given DIE.\n");
469 return -EINVAL; 469 return -EINVAL;
470 } 470 }
471 471