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.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 855094234f2d..35ed97bd0c63 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -29,7 +29,6 @@ static char const *input_name = "perf.data";
29 29
30static int force; 30static int force;
31static int input; 31static int input;
32static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
33 32
34static int full_paths; 33static int full_paths;
35 34
@@ -97,7 +96,6 @@ static int
97process_sample_event(event_t *event, unsigned long offset, unsigned long head) 96process_sample_event(event_t *event, unsigned long offset, unsigned long head)
98{ 97{
99 char level; 98 char level;
100 int show = 0;
101 struct thread *thread; 99 struct thread *thread;
102 u64 ip = event->ip.ip; 100 u64 ip = event->ip.ip;
103 struct map *map = NULL; 101 struct map *map = NULL;
@@ -121,13 +119,11 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
121 } 119 }
122 120
123 if (event->header.misc & PERF_RECORD_MISC_KERNEL) { 121 if (event->header.misc & PERF_RECORD_MISC_KERNEL) {
124 show = SHOW_KERNEL;
125 level = 'k'; 122 level = 'k';
126 sym = kernel_maps__find_symbol(ip, &map); 123 sym = kernel_maps__find_symbol(ip, &map);
127 dump_printf(" ...... dso: %s\n", 124 dump_printf(" ...... dso: %s\n",
128 map ? map->dso->long_name : "<not found>"); 125 map ? map->dso->long_name : "<not found>");
129 } else if (event->header.misc & PERF_RECORD_MISC_USER) { 126 } else if (event->header.misc & PERF_RECORD_MISC_USER) {
130 show = SHOW_USER;
131 level = '.'; 127 level = '.';
132 map = thread__find_map(thread, ip); 128 map = thread__find_map(thread, ip);
133 if (map != NULL) { 129 if (map != NULL) {
@@ -153,17 +149,14 @@ got_map:
153 dump_printf(" ...... dso: %s\n", 149 dump_printf(" ...... dso: %s\n",
154 map ? map->dso->long_name : "<not found>"); 150 map ? map->dso->long_name : "<not found>");
155 } else { 151 } else {
156 show = SHOW_HV;
157 level = 'H'; 152 level = 'H';
158 dump_printf(" ...... dso: [hypervisor]\n"); 153 dump_printf(" ...... dso: [hypervisor]\n");
159 } 154 }
160 155
161 if (show & show_mask) { 156 if (hist_entry__add(thread, map, sym, ip, 1, level)) {
162 if (hist_entry__add(thread, map, sym, ip, 1, level)) { 157 fprintf(stderr, "problem incrementing symbol count, "
163 fprintf(stderr, 158 "skipping event\n");
164 "problem incrementing symbol count, skipping event\n"); 159 return -1;
165 return -1;
166 }
167 } 160 }
168 total++; 161 total++;
169 162