From 89c69c0eee7515cdc217f4278de43547284b3458 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Fri, 16 Oct 2009 20:08:10 -0400 Subject: perf: Use eprintf() for debug messages in perf-probe Replace debug() macro with eprintf() and add -v option for showing those messages in perf-probe. Signed-off-by: Masami Hiramatsu Cc: Frederic Weisbecker Cc: Arnaldo Carvalho de Melo Cc: Steven Rostedt Cc: Paul Mackerras Cc: Peter Zijlstra LKML-Reference: <20091017000810.16556.38013.stgit@dhcp-100-2-132.bos.redhat.com> Signed-off-by: Ingo Molnar --- tools/perf/util/probe-finder.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tools/perf/util/probe-finder.c') diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 338fdb9..db24c91 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -32,6 +32,8 @@ #include #include +#include "event.h" +#include "debug.h" #include "util.h" #include "probe-finder.h" @@ -134,7 +136,7 @@ static Dwarf_Unsigned die_get_fileno(Dwarf_Die cu_die, const char *fname) dwarf_dealloc(__dw_debug, srcs, DW_DLA_LIST); } if (found) - debug("found fno: %d\n", (int)found); + eprintf("found fno: %d\n", (int)found); return found; } @@ -440,7 +442,7 @@ static void find_variable(Dwarf_Die sp_die, struct probe_finder *pf) return ; } - debug("Searching '%s' variable in context.\n", pf->var); + eprintf("Searching '%s' variable in context.\n", pf->var); /* Search child die for local variables and parameters. */ ret = search_die_from_children(sp_die, variable_callback, pf); if (!ret) @@ -550,7 +552,7 @@ static void find_by_line(Dwarf_Die cu_die, struct probe_finder *pf) ret = dwarf_lineaddr(lines[i], &addr, &__dw_error); ERR_IF(ret != DW_DLV_OK); - debug("Probe point found: 0x%llx\n", addr); + eprintf("Probe point found: 0x%llx\n", addr); pf->addr = addr; /* Search a real subprogram including this line, */ ret = search_die_from_children(cu_die, probeaddr_callback, pf); @@ -581,7 +583,7 @@ static int probefunc_callback(struct die_link *dlink, void *data) &pf->inl_offs, &__dw_error); ERR_IF(ret != DW_DLV_OK); - debug("inline definition offset %lld\n", + eprintf("inline definition offset %lld\n", pf->inl_offs); return 0; } @@ -597,7 +599,7 @@ static int probefunc_callback(struct die_link *dlink, void *data) /* Get probe address */ pf->addr = die_get_entrypc(dlink->die); pf->addr += pp->offset; - debug("found inline addr: 0x%llx\n", pf->addr); + eprintf("found inline addr: 0x%llx\n", pf->addr); /* Inlined function. Get a real subprogram */ for (lk = dlink->parent; lk != NULL; lk = lk->parent) { tag = 0; -- cgit v1.1