Commit 29a9f66d authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Ingo Molnar

perf tools: Adjust some verbosity levels

Not to pollute too much 'perf annotate' debugging sessions.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1265223128-11786-7-git-send-email-acme@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 6122e4e4
...@@ -97,9 +97,7 @@ static void hist_hit(struct hist_entry *he, u64 ip) ...@@ -97,9 +97,7 @@ static void hist_hit(struct hist_entry *he, u64 ip)
sym_size = sym->end - sym->start; sym_size = sym->end - sym->start;
offset = ip - sym->start; offset = ip - sym->start;
if (verbose) pr_debug3("%s: ip=%#Lx\n", __func__, he->map->unmap_ip(he->map, ip));
fprintf(stderr, "%s: ip=%Lx\n", __func__,
he->map->unmap_ip(he->map, ip));
if (offset >= sym_size) if (offset >= sym_size)
return; return;
...@@ -108,12 +106,8 @@ static void hist_hit(struct hist_entry *he, u64 ip) ...@@ -108,12 +106,8 @@ static void hist_hit(struct hist_entry *he, u64 ip)
h->sum++; h->sum++;
h->ip[offset]++; h->ip[offset]++;
if (verbose >= 3) pr_debug3("%#Lx %s: count++ [ip: %#Lx, %#Lx] => %Ld\n", he->sym->start,
printf("%p %s: count++ [ip: %p, %08Lx] => %Ld\n", he->sym->name, ip, ip - he->sym->start, h->ip[offset]);
(void *)(unsigned long)he->sym->start,
he->sym->name,
(void *)(unsigned long)ip, ip - he->sym->start,
h->ip[offset]);
} }
static int perf_session__add_hist_entry(struct perf_session *self, static int perf_session__add_hist_entry(struct perf_session *self,
...@@ -136,13 +130,13 @@ static int process_sample_event(event_t *event, struct perf_session *session) ...@@ -136,13 +130,13 @@ static int process_sample_event(event_t *event, struct perf_session *session)
event->ip.pid, event->ip.ip); event->ip.pid, event->ip.ip);
if (event__preprocess_sample(event, session, &al, symbol_filter) < 0) { if (event__preprocess_sample(event, session, &al, symbol_filter) < 0) {
fprintf(stderr, "problem processing %d event, skipping it.\n", pr_warning("problem processing %d event, skipping it.\n",
event->header.type); event->header.type);
return -1; return -1;
} }
if (!al.filtered && perf_session__add_hist_entry(session, &al, 1)) { if (!al.filtered && perf_session__add_hist_entry(session, &al, 1)) {
fprintf(stderr, "problem incrementing symbol count, " pr_warning("problem incrementing symbol count, "
"skipping event\n"); "skipping event\n");
return -1; return -1;
} }
...@@ -378,10 +372,8 @@ static void annotate_sym(struct hist_entry *he) ...@@ -378,10 +372,8 @@ static void annotate_sym(struct hist_entry *he)
if (!filename) if (!filename)
return; return;
if (verbose) pr_debug("%s: filename=%s, sym=%s, start=%#Lx, end=%#Lx\n", __func__,
fprintf(stderr, "%s: filename=%s, sym=%s, start=%Lx, end=%Lx\n", filename, sym->name, map->unmap_ip(map, sym->start),
__func__, filename, sym->name,
map->unmap_ip(map, sym->start),
map->unmap_ip(map, sym->end)); map->unmap_ip(map, sym->end));
if (full_paths) if (full_paths)
...@@ -542,9 +534,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used) ...@@ -542,9 +534,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used)
setup_pager(); setup_pager();
if (field_sep && *field_sep == '.') { if (field_sep && *field_sep == '.') {
fputs("'.' is the only non valid --field-separator argument\n", pr_err("'.' is the only non valid --field-separator argument\n");
stderr); return -1;
exit(129);
} }
return __cmd_annotate(); return __cmd_annotate();
......
...@@ -101,5 +101,6 @@ simple_strtoul(const char *nptr, char **endptr, int base) ...@@ -101,5 +101,6 @@ simple_strtoul(const char *nptr, char **endptr, int base)
eprintf(n, pr_fmt(fmt), ##__VA_ARGS__) eprintf(n, pr_fmt(fmt), ##__VA_ARGS__)
#define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__) #define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)
#define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__) #define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)
#define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__)
#endif #endif
...@@ -137,7 +137,7 @@ static struct symbol *symbol__new(u64 start, u64 len, const char *name) ...@@ -137,7 +137,7 @@ static struct symbol *symbol__new(u64 start, u64 len, const char *name)
self->start = start; self->start = start;
self->end = len ? start + len - 1 : start; self->end = len ? start + len - 1 : start;
pr_debug3("%s: %s %#Lx-%#Lx\n", __func__, name, start, self->end); pr_debug4("%s: %s %#Lx-%#Lx\n", __func__, name, start, self->end);
memcpy(self->name, name, namelen); memcpy(self->name, name, namelen);
...@@ -1024,9 +1024,10 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name, ...@@ -1024,9 +1024,10 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
} }
if (curr_dso->adjust_symbols) { if (curr_dso->adjust_symbols) {
pr_debug2("adjusting symbol: st_value: %Lx sh_addr: " pr_debug4("%s: adjusting symbol: st_value: %#Lx "
"%Lx sh_offset: %Lx\n", (u64)sym.st_value, "sh_addr: %#Lx sh_offset: %#Lx\n", __func__,
(u64)shdr.sh_addr, (u64)shdr.sh_offset); (u64)sym.st_value, (u64)shdr.sh_addr,
(u64)shdr.sh_offset);
sym.st_value -= shdr.sh_addr - shdr.sh_offset; sym.st_value -= shdr.sh_addr - shdr.sh_offset;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment