[PATCH -tip perf/probes 07/10] perf/probes: Exit searching afterfinding target function

From: Masami Hiramatsu
Date: Tue Oct 27 2009 - 16:44:01 EST


Exit searching after finding real (not-inlined) function, because
there should be no same symbol in that CU.

Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Jim Keniston <jkenisto@xxxxxxxxxx>
Cc: Ananth N Mavinakayanahalli <ananth@xxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Cc: Frank Ch. Eigler <fche@xxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: H. Peter Anvin <hpa@xxxxxxxxx>
Cc: Jason Baron <jbaron@xxxxxxxxxx>
Cc: K.Prasad <prasad@xxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>
---

tools/perf/util/probe-finder.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 54e7071..b98d35e 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -585,14 +585,14 @@ static int probefunc_callback(struct die_link *dlink, void *data)
DIE_IF(ret != DW_DLV_OK);
pr_debug("inline definition offset %lld\n",
pf->inl_offs);
- return 0;
+ return 0; /* Continue to search */
}
/* Get probe address */
pf->addr = die_get_entrypc(dlink->die);
pf->addr += pp->offset;
/* TODO: Check the address in this function */
show_probepoint(dlink->die, pp->offset, pf);
- /* Continue to search */
+ return 1; /* Exit; no same symbol in this CU. */
}
} else if (tag == DW_TAG_inlined_subroutine && pf->inl_offs) {
if (die_get_abstract_origin(dlink->die) == pf->inl_offs) {


--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@xxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/