perf probe: Finder fails to resolve function name to address
Prashanth Nageshappa [Mon, 26 Mar 2012 10:06:49 +0000 (15:06 +0530)]
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 <>
Acked-by: Masami Hiramatsu <>
Cc: Ananth N Mavinakayanahalli <>
Cc: Ingo Molnar <>
Cc: Masami Hiramatsu <>
Cc: Srikar Dronamraju <>
Cc: Steven Rostedt <>
Signed-off-by: Arnaldo Carvalho de Melo <>


index 2cc162d..d448984 100644 (file)
@@ -972,10 +972,12 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data)
        struct dwarf_callback_param *param = data;
        struct probe_finder *pf = param->data;
        struct perf_probe_point *pp = &pf->pev->point;
+       Dwarf_Attribute attr;
        /* Check tag and diename */
        if (dwarf_tag(sp_die) != DW_TAG_subprogram ||
-           !die_compare_name(sp_die, pp->function))
+           !die_compare_name(sp_die, pp->function) ||
+           dwarf_attr(sp_die, DW_AT_declaration, &attr))
                return DWARF_CB_OK;
        /* Check declared file */