diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-10-21 15:34:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-23 02:24:21 -0400 |
commit | b7cb10e790fbd145296e771f789273a875c15719 (patch) | |
tree | 53b0e9df9aebf91d35ed232505655bdb1cc0b1d1 /tools | |
parent | 43315956509ca6913764861ac7dec128b91eb1ec (diff) |
perf probe: Print debug messages using pr_*()
Use the new pr_{err,warning,debug,etc} printout methods, just
like in the kernel.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1256153646-10097-1-git-send-email-acme@redhat.com>
[ Split this patch out, to keep perf/probes separate. ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-probe.c | 20 | ||||
-rw-r--r-- | tools/perf/util/probe-finder.c | 12 |
2 files changed, 16 insertions, 16 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index b5ad86a265ff..dcb406c7f82d 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c | |||
@@ -78,7 +78,7 @@ static int parse_probepoint(const struct option *opt __used, | |||
78 | if (!str) /* The end of probe points */ | 78 | if (!str) /* The end of probe points */ |
79 | return 0; | 79 | return 0; |
80 | 80 | ||
81 | eprintf("probe-definition(%d): %s\n", session.nr_probe, str); | 81 | pr_debug("probe-definition(%d): %s\n", session.nr_probe, str); |
82 | if (++session.nr_probe == MAX_PROBES) | 82 | if (++session.nr_probe == MAX_PROBES) |
83 | semantic_error("Too many probes"); | 83 | semantic_error("Too many probes"); |
84 | 84 | ||
@@ -103,7 +103,7 @@ static int parse_probepoint(const struct option *opt __used, | |||
103 | die("strndup"); | 103 | die("strndup"); |
104 | if (++argc == MAX_PROBE_ARGS) | 104 | if (++argc == MAX_PROBE_ARGS) |
105 | semantic_error("Too many arguments"); | 105 | semantic_error("Too many arguments"); |
106 | eprintf("argv[%d]=%s\n", argc, argv[argc - 1]); | 106 | pr_debug("argv[%d]=%s\n", argc, argv[argc - 1]); |
107 | } | 107 | } |
108 | } while (*str != '\0'); | 108 | } while (*str != '\0'); |
109 | if (argc < 2) | 109 | if (argc < 2) |
@@ -133,7 +133,7 @@ static int parse_probepoint(const struct option *opt __used, | |||
133 | pp->line = atoi(ptr); | 133 | pp->line = atoi(ptr); |
134 | if (!pp->file || !pp->line) | 134 | if (!pp->file || !pp->line) |
135 | semantic_error("Failed to parse line."); | 135 | semantic_error("Failed to parse line."); |
136 | eprintf("file:%s line:%d\n", pp->file, pp->line); | 136 | pr_debug("file:%s line:%d\n", pp->file, pp->line); |
137 | } else { | 137 | } else { |
138 | /* Function name */ | 138 | /* Function name */ |
139 | ptr = strchr(arg, '+'); | 139 | ptr = strchr(arg, '+'); |
@@ -150,8 +150,8 @@ static int parse_probepoint(const struct option *opt __used, | |||
150 | pp->file = strdup(ptr); | 150 | pp->file = strdup(ptr); |
151 | } | 151 | } |
152 | pp->function = strdup(arg); | 152 | pp->function = strdup(arg); |
153 | eprintf("symbol:%s file:%s offset:%d\n", | 153 | pr_debug("symbol:%s file:%s offset:%d\n", |
154 | pp->function, pp->file, pp->offset); | 154 | pp->function, pp->file, pp->offset); |
155 | } | 155 | } |
156 | free(argv[1]); | 156 | free(argv[1]); |
157 | if (pp->file) | 157 | if (pp->file) |
@@ -175,7 +175,7 @@ static int parse_probepoint(const struct option *opt __used, | |||
175 | session.need_dwarf = 1; | 175 | session.need_dwarf = 1; |
176 | } | 176 | } |
177 | 177 | ||
178 | eprintf("%d arguments\n", pp->nr_args); | 178 | pr_debug("%d arguments\n", pp->nr_args); |
179 | return 0; | 179 | return 0; |
180 | } | 180 | } |
181 | 181 | ||
@@ -188,7 +188,7 @@ static int open_default_vmlinux(void) | |||
188 | 188 | ||
189 | ret = uname(&uts); | 189 | ret = uname(&uts); |
190 | if (ret) { | 190 | if (ret) { |
191 | eprintf("uname() failed.\n"); | 191 | pr_debug("uname() failed.\n"); |
192 | return -errno; | 192 | return -errno; |
193 | } | 193 | } |
194 | session.release = uts.release; | 194 | session.release = uts.release; |
@@ -196,12 +196,12 @@ static int open_default_vmlinux(void) | |||
196 | ret = snprintf(fname, MAX_PATH_LEN, | 196 | ret = snprintf(fname, MAX_PATH_LEN, |
197 | default_search_path[i], session.release); | 197 | default_search_path[i], session.release); |
198 | if (ret >= MAX_PATH_LEN || ret < 0) { | 198 | if (ret >= MAX_PATH_LEN || ret < 0) { |
199 | eprintf("Filename(%d,%s) is too long.\n", i, | 199 | pr_debug("Filename(%d,%s) is too long.\n", i, |
200 | uts.release); | 200 | uts.release); |
201 | errno = E2BIG; | 201 | errno = E2BIG; |
202 | return -E2BIG; | 202 | return -E2BIG; |
203 | } | 203 | } |
204 | eprintf("try to open %s\n", fname); | 204 | pr_debug("try to open %s\n", fname); |
205 | fd = open(fname, O_RDONLY); | 205 | fd = open(fname, O_RDONLY); |
206 | if (fd >= 0) | 206 | if (fd >= 0) |
207 | break; | 207 | break; |
@@ -341,7 +341,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
341 | ret = find_probepoint(fd, pp); | 341 | ret = find_probepoint(fd, pp); |
342 | if (ret <= 0) | 342 | if (ret <= 0) |
343 | die("No probe point found.\n"); | 343 | die("No probe point found.\n"); |
344 | eprintf("probe event %s found\n", session.events[j]); | 344 | pr_debug("probe event %s found\n", session.events[j]); |
345 | } | 345 | } |
346 | close(fd); | 346 | close(fd); |
347 | 347 | ||
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index be997abdf5b1..54e707185308 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
@@ -136,7 +136,7 @@ static Dwarf_Unsigned die_get_fileno(Dwarf_Die cu_die, const char *fname) | |||
136 | dwarf_dealloc(__dw_debug, srcs, DW_DLA_LIST); | 136 | dwarf_dealloc(__dw_debug, srcs, DW_DLA_LIST); |
137 | } | 137 | } |
138 | if (found) | 138 | if (found) |
139 | eprintf("found fno: %d\n", (int)found); | 139 | pr_debug("found fno: %d\n", (int)found); |
140 | return found; | 140 | return found; |
141 | } | 141 | } |
142 | 142 | ||
@@ -442,7 +442,7 @@ static void find_variable(Dwarf_Die sp_die, struct probe_finder *pf) | |||
442 | return ; | 442 | return ; |
443 | } | 443 | } |
444 | 444 | ||
445 | eprintf("Searching '%s' variable in context.\n", pf->var); | 445 | pr_debug("Searching '%s' variable in context.\n", pf->var); |
446 | /* Search child die for local variables and parameters. */ | 446 | /* Search child die for local variables and parameters. */ |
447 | ret = search_die_from_children(sp_die, variable_callback, pf); | 447 | ret = search_die_from_children(sp_die, variable_callback, pf); |
448 | if (!ret) | 448 | if (!ret) |
@@ -552,7 +552,7 @@ static void find_by_line(Dwarf_Die cu_die, struct probe_finder *pf) | |||
552 | 552 | ||
553 | ret = dwarf_lineaddr(lines[i], &addr, &__dw_error); | 553 | ret = dwarf_lineaddr(lines[i], &addr, &__dw_error); |
554 | DIE_IF(ret != DW_DLV_OK); | 554 | DIE_IF(ret != DW_DLV_OK); |
555 | eprintf("Probe point found: 0x%llx\n", addr); | 555 | pr_debug("Probe point found: 0x%llx\n", addr); |
556 | pf->addr = addr; | 556 | pf->addr = addr; |
557 | /* Search a real subprogram including this line, */ | 557 | /* Search a real subprogram including this line, */ |
558 | ret = search_die_from_children(cu_die, probeaddr_callback, pf); | 558 | ret = search_die_from_children(cu_die, probeaddr_callback, pf); |
@@ -583,8 +583,8 @@ static int probefunc_callback(struct die_link *dlink, void *data) | |||
583 | &pf->inl_offs, | 583 | &pf->inl_offs, |
584 | &__dw_error); | 584 | &__dw_error); |
585 | DIE_IF(ret != DW_DLV_OK); | 585 | DIE_IF(ret != DW_DLV_OK); |
586 | eprintf("inline definition offset %lld\n", | 586 | pr_debug("inline definition offset %lld\n", |
587 | pf->inl_offs); | 587 | pf->inl_offs); |
588 | return 0; | 588 | return 0; |
589 | } | 589 | } |
590 | /* Get probe address */ | 590 | /* Get probe address */ |
@@ -599,7 +599,7 @@ static int probefunc_callback(struct die_link *dlink, void *data) | |||
599 | /* Get probe address */ | 599 | /* Get probe address */ |
600 | pf->addr = die_get_entrypc(dlink->die); | 600 | pf->addr = die_get_entrypc(dlink->die); |
601 | pf->addr += pp->offset; | 601 | pf->addr += pp->offset; |
602 | eprintf("found inline addr: 0x%llx\n", pf->addr); | 602 | pr_debug("found inline addr: 0x%llx\n", pf->addr); |
603 | /* Inlined function. Get a real subprogram */ | 603 | /* Inlined function. Get a real subprogram */ |
604 | for (lk = dlink->parent; lk != NULL; lk = lk->parent) { | 604 | for (lk = dlink->parent; lk != NULL; lk = lk->parent) { |
605 | tag = 0; | 605 | tag = 0; |