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 <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20091017000810.16556.38013.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 <stdarg.h>
 #include <ctype.h>
 
+#include "event.h"
+#include "debug.h"
 #include "util.h"
 #include "probe-finder.h"
 
@@ -134,7 +136,7 @@
 		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 @@
 		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 @@
 
 		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 @@
 							  &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 @@
 			/* 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;