linux/tools
Masami Hiramatsu 082f96a93e perf probe: Fix perf probe to find correct variable DIE
Fix perf probe to find correct variable DIE which has location or
external instance by tracking down the lexical blocks.

Current die_find_variable() expects that the all variable DIEs
which has DW_TAG_variable have a location. However, since recent
dwarf information may have declaration variable DIEs at the
entry of function (subprogram), die_find_variable() returns it.

To solve this problem, it must track down the DIE tree to find
a DIE which has an actual location or a reference for external
instance.

e.g. finding a DIE which origin is <0xdc73>;

 <1><11496>: Abbrev Number: 95 (DW_TAG_subprogram)
    <11497>   DW_AT_abstract_origin: <0xdc42>
    <1149b>   DW_AT_low_pc      : 0x1850
[...]
 <2><114cc>: Abbrev Number: 119 (DW_TAG_variable) <- this is a declaration
    <114cd>   DW_AT_abstract_origin: <0xdc73>
 <2><114d1>: Abbrev Number: 119 (DW_TAG_variable)
[...]
 <3><115a7>: Abbrev Number: 105 (DW_TAG_lexical_block)
    <115a8>   DW_AT_ranges      : 0xaa0
 <4><115ac>: Abbrev Number: 96 (DW_TAG_variable) <- this has a location
    <115ad>   DW_AT_abstract_origin: <0xdc73>
    <115b1>   DW_AT_location    : 0x486c        (location list)

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Tested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Acked-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20140529121930.30879.87092.stgit@ltc230.yrl.intra.hitachi.co.jp
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
2014-06-04 14:49:20 +02:00
..
cgroup cgroups: fix cgroup_event_listener error handling 2013-01-08 10:00:44 -08:00
firewire tools/firewire: nosy-dump: check for allocation failure 2012-12-02 20:10:18 +01:00
hv Tools: hv: Handle the case when the target file exists correctly 2014-04-16 14:10:36 -07:00
include perf tools: Move hash.h header 2014-02-18 09:34:49 -03:00
lguest tools/lguest: offer VIRTIO_F_ANY_LAYOUT for net device. 2013-07-15 11:18:32 +09:30
lib Merge branch 'liblockdep-fixes-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux into perf/urgent 2014-05-11 07:23:23 +02:00
net bpf_dbg: fix wrong register usage 2014-04-30 16:12:22 -04:00
nfsd NFSD: Added fault injection script 2011-11-07 21:10:47 -05:00
perf perf probe: Fix perf probe to find correct variable DIE 2014-06-04 14:49:20 +02:00
power tools/power/acpi: Minor bugfixes 2014-04-21 22:51:58 +02:00
scripts tools lib traceevent: Add global QUIET_CC_FPIC build output 2013-12-19 16:18:10 -03:00
testing This just contains a single update by Satoru Takeuchi, which adds 2014-04-04 21:27:43 -07:00
thermal/tmon tools/thermal: Introduce tmon, a tool for thermal subsystem 2013-11-07 08:45:34 +08:00
usb usb: tools: fix a regression issue that gcc can't link to pthread 2013-12-04 15:10:54 -08:00
virtio tools/virtio: add a missing ) 2014-03-13 11:23:25 +10:30
vm tools/vm/page-types.c: page-cache sniffing feature 2014-04-07 16:35:52 -07:00
Makefile tools/liblockdep: Build liblockdep from tools/Makefile 2014-05-08 13:34:45 -04:00