aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 73c202ee0882..4fc3899bf83a 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -97,9 +97,7 @@ static void hist_hit(struct hist_entry *he, u64 ip)
97 sym_size = sym->end - sym->start; 97 sym_size = sym->end - sym->start;
98 offset = ip - sym->start; 98 offset = ip - sym->start;
99 99
100 if (verbose) 100 pr_debug3("%s: ip=%#Lx\n", __func__, he->map->unmap_ip(he->map, ip));
101 fprintf(stderr, "%s: ip=%Lx\n", __func__,
102 he->map->unmap_ip(he->map, ip));
103 101
104 if (offset >= sym_size) 102 if (offset >= sym_size)
105 return; 103 return;
@@ -108,12 +106,8 @@ static void hist_hit(struct hist_entry *he, u64 ip)
108 h->sum++; 106 h->sum++;
109 h->ip[offset]++; 107 h->ip[offset]++;
110 108
111 if (verbose >= 3) 109 pr_debug3("%#Lx %s: count++ [ip: %#Lx, %#Lx] => %Ld\n", he->sym->start,
112 printf("%p %s: count++ [ip: %p, %08Lx] => %Ld\n", 110 he->sym->name, ip, ip - he->sym->start, h->ip[offset]);
113 (void *)(unsigned long)he->sym->start,
114 he->sym->name,
115 (void *)(unsigned long)ip, ip - he->sym->start,
116 h->ip[offset]);
117} 111}
118 112
119static int perf_session__add_hist_entry(struct perf_session *self, 113static int perf_session__add_hist_entry(struct perf_session *self,
@@ -136,14 +130,14 @@ static int process_sample_event(event_t *event, struct perf_session *session)
136 event->ip.pid, event->ip.ip); 130 event->ip.pid, event->ip.ip);
137 131
138 if (event__preprocess_sample(event, session, &al, symbol_filter) < 0) { 132 if (event__preprocess_sample(event, session, &al, symbol_filter) < 0) {
139 fprintf(stderr, "problem processing %d event, skipping it.\n", 133 pr_warning("problem processing %d event, skipping it.\n",
140 event->header.type); 134 event->header.type);
141 return -1; 135 return -1;
142 } 136 }
143 137
144 if (!al.filtered && perf_session__add_hist_entry(session, &al, 1)) { 138 if (!al.filtered && perf_session__add_hist_entry(session, &al, 1)) {
145 fprintf(stderr, "problem incrementing symbol count, " 139 pr_warning("problem incrementing symbol count, "
146 "skipping event\n"); 140 "skipping event\n");
147 return -1; 141 return -1;
148 } 142 }
149 143
@@ -378,11 +372,9 @@ static void annotate_sym(struct hist_entry *he)
378 if (!filename) 372 if (!filename)
379 return; 373 return;
380 374
381 if (verbose) 375 pr_debug("%s: filename=%s, sym=%s, start=%#Lx, end=%#Lx\n", __func__,
382 fprintf(stderr, "%s: filename=%s, sym=%s, start=%Lx, end=%Lx\n", 376 filename, sym->name, map->unmap_ip(map, sym->start),
383 __func__, filename, sym->name, 377 map->unmap_ip(map, sym->end));
384 map->unmap_ip(map, sym->start),
385 map->unmap_ip(map, sym->end));
386 378
387 if (full_paths) 379 if (full_paths)
388 d_filename = filename; 380 d_filename = filename;
@@ -542,9 +534,8 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used)
542 setup_pager(); 534 setup_pager();
543 535
544 if (field_sep && *field_sep == '.') { 536 if (field_sep && *field_sep == '.') {
545 fputs("'.' is the only non valid --field-separator argument\n", 537 pr_err("'.' is the only non valid --field-separator argument\n");
546 stderr); 538 return -1;
547 exit(129);
548 } 539 }
549 540
550 return __cmd_annotate(); 541 return __cmd_annotate();