Messages in this thread Patch in this message | | | Date | Thu, 22 Mar 2012 15:53:14 +0530 | From | Prashanth Nageshappa <> | Subject | [PATCH] perf - probe finder fails to resolve function name to address |
| |
probe finder fails to resolve valid function names into addresses for functions which have more than one die entries in DWARF info.
It is valid for DWARF info to contain more than 1 entries for a given function name, where one entry corresponds to definition which has code address/range attributes and remaining entries (which are only declarations) does not have code address/range attributes. (example: do_fork, sys_write, sys_wait4, sys_sync etc)
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. I have also removed the warning as this is a valid thing to happen.
Signed-off-by: Prashanth Nageshappa <prashanth@linux.vnet.ibm.com> ---
tools/perf/util/probe-finder.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 5d73262..5e1e6f7 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -984,10 +984,7 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data) param->retval = find_probe_point_lazy(sp_die, pf); else { if (dwarf_entrypc(sp_die, &pf->addr) != 0) { - pr_warning("Failed to get entry address of " - "%s.\n", dwarf_diename(sp_die)); - param->retval = -ENOENT; - return DWARF_CB_ABORT; + return DWARF_CB_OK; } pf->addr += pp->offset; /* TODO: Check the address in this function */
| |