perf probe: Support DW_OP_call_frame_cfa in debuginfo
authorMasami Hiramatsu <mhiramat@redhat.com>
Mon, 12 Apr 2010 17:17:29 +0000 (13:17 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 14 Apr 2010 20:28:20 +0000 (17:28 -0300)
commita34a985499895a46a4dacff727d0fbc63cdc75e8
tree84905a8248ab1b35403e676609dd120c85c1dd97
parent11a1ca3554b377d2a8a318a3cbf8ce10a7a2a8e4
perf probe: Support DW_OP_call_frame_cfa in debuginfo

When building kernel without CONFIG_FRAME_POINTER, gcc uses
CFA (canonical frame address) for frame base. With this patch,
perf probe just gets CFI (call frame information) from debuginfo
and search corresponding CFA from the CFI. IOW, this allows
perf probe works correctly on the kernel without CONFIG_FRAME_POINTER.

<Before>
 ./perf probe -fn sched_slice:12 lw.weight
  Fatal: DW_OP 156 is not supported.
              (^^^ DW_OP_call_frame_cfa)

<After>
./perf probe -fn sched_slice:12 lw.weight
Add new event:
  probe:sched_slice    (on sched_slice:12 with weight=lw.weight)

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20100412171728.3790.98217.stgit@localhost6.localdomain6>
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-finder.c
tools/perf/util/probe-finder.h