aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2009-10-16 20:08:10 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-17 03:54:00 -0400
commit89c69c0eee7515cdc217f4278de43547284b3458 (patch)
tree914114cca2d004e7e22093a32b91540cd9beb1cc /tools/perf/util/probe-finder.c
parent074fc0e4b3f5d24306c2995f2f3b0bd4759e8aeb (diff)
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>
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r--tools/perf/util/probe-finder.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 338fdb9e093..db24c913225 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -32,6 +32,8 @@
32#include <stdarg.h> 32#include <stdarg.h>
33#include <ctype.h> 33#include <ctype.h>
34 34
35#include "event.h"
36#include "debug.h"
35#include "util.h" 37#include "util.h"
36#include "probe-finder.h" 38#include "probe-finder.h"
37 39
@@ -134,7 +136,7 @@ static Dwarf_Unsigned die_get_fileno(Dwarf_Die cu_die, const char *fname)
134 dwarf_dealloc(__dw_debug, srcs, DW_DLA_LIST); 136 dwarf_dealloc(__dw_debug, srcs, DW_DLA_LIST);
135 } 137 }
136 if (found) 138 if (found)
137 debug("found fno: %d\n", (int)found); 139 eprintf("found fno: %d\n", (int)found);
138 return found; 140 return found;
139} 141}
140 142
@@ -440,7 +442,7 @@ static void find_variable(Dwarf_Die sp_die, struct probe_finder *pf)
440 return ; 442 return ;
441 } 443 }
442 444
443 debug("Searching '%s' variable in context.\n", pf->var); 445 eprintf("Searching '%s' variable in context.\n", pf->var);
444 /* Search child die for local variables and parameters. */ 446 /* Search child die for local variables and parameters. */
445 ret = search_die_from_children(sp_die, variable_callback, pf); 447 ret = search_die_from_children(sp_die, variable_callback, pf);
446 if (!ret) 448 if (!ret)
@@ -550,7 +552,7 @@ static void find_by_line(Dwarf_Die cu_die, struct probe_finder *pf)
550 552
551 ret = dwarf_lineaddr(lines[i], &addr, &__dw_error); 553 ret = dwarf_lineaddr(lines[i], &addr, &__dw_error);
552 ERR_IF(ret != DW_DLV_OK); 554 ERR_IF(ret != DW_DLV_OK);
553 debug("Probe point found: 0x%llx\n", addr); 555 eprintf("Probe point found: 0x%llx\n", addr);
554 pf->addr = addr; 556 pf->addr = addr;
555 /* Search a real subprogram including this line, */ 557 /* Search a real subprogram including this line, */
556 ret = search_die_from_children(cu_die, probeaddr_callback, pf); 558 ret = search_die_from_children(cu_die, probeaddr_callback, pf);
@@ -581,7 +583,7 @@ static int probefunc_callback(struct die_link *dlink, void *data)
581 &pf->inl_offs, 583 &pf->inl_offs,
582 &__dw_error); 584 &__dw_error);
583 ERR_IF(ret != DW_DLV_OK); 585 ERR_IF(ret != DW_DLV_OK);
584 debug("inline definition offset %lld\n", 586 eprintf("inline definition offset %lld\n",
585 pf->inl_offs); 587 pf->inl_offs);
586 return 0; 588 return 0;
587 } 589 }
@@ -597,7 +599,7 @@ static int probefunc_callback(struct die_link *dlink, void *data)
597 /* Get probe address */ 599 /* Get probe address */
598 pf->addr = die_get_entrypc(dlink->die); 600 pf->addr = die_get_entrypc(dlink->die);
599 pf->addr += pp->offset; 601 pf->addr += pp->offset;
600 debug("found inline addr: 0x%llx\n", pf->addr); 602 eprintf("found inline addr: 0x%llx\n", pf->addr);
601 /* Inlined function. Get a real subprogram */ 603 /* Inlined function. Get a real subprogram */
602 for (lk = dlink->parent; lk != NULL; lk = lk->parent) { 604 for (lk = dlink->parent; lk != NULL; lk = lk->parent) {
603 tag = 0; 605 tag = 0;