aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorPrashanth Nageshappa <prashanth@linux.vnet.ibm.com>2012-03-26 06:06:49 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-03-28 10:56:49 -0400
commitba28c59bc9ed8fb7b9a753cd88ee54a2c4f6265b (patch)
tree30f2e5d133173779284dfe4e11ecdfd22f6f20fb /tools/perf
parent1e2dd2f73afdc810cc7400b7036232fbdc416eeb (diff)
perf probe: Finder fails to resolve function name to address
If DIE entries corresponding to declarations appear before definition entry, probe finder returns error instead of continuing to look further for a definition entry. This patch ensures we reach to the DIE entry corresponding to the definition and get the function address. V2: A simpler solution based on Masami's suggestion. Signed-off-by: Prashanth Nageshappa <prashanth@linux.vnet.ibm.com> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/4F703FB9.9020407@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/probe-finder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 2cc162d3b78c..d448984ed789 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -972,10 +972,12 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data)
972 struct dwarf_callback_param *param = data; 972 struct dwarf_callback_param *param = data;
973 struct probe_finder *pf = param->data; 973 struct probe_finder *pf = param->data;
974 struct perf_probe_point *pp = &pf->pev->point; 974 struct perf_probe_point *pp = &pf->pev->point;
975 Dwarf_Attribute attr;
975 976
976 /* Check tag and diename */ 977 /* Check tag and diename */
977 if (dwarf_tag(sp_die) != DW_TAG_subprogram || 978 if (dwarf_tag(sp_die) != DW_TAG_subprogram ||
978 !die_compare_name(sp_die, pp->function)) 979 !die_compare_name(sp_die, pp->function) ||
980 dwarf_attr(sp_die, DW_AT_declaration, &attr))
979 return DWARF_CB_OK; 981 return DWARF_CB_OK;
980 982
981 /* Check declared file */ 983 /* Check declared file */