builtin-top.c (56b2147f34d057b0898c53a3eb2e9e70756ab89f) builtin-top.c (2975489458c59ce2e348b1b3aef5d8d2acb5cc8d)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * builtin-top.c
4 *
5 * Builtin top command: Display a continuously updated profile of
6 * any workload, CPU or specific PID.
7 *
8 * Copyright (C) 2008, Red Hat Inc, Ingo Molnar <mingo@redhat.com>

--- 129 unchanged lines hidden (view full) ---

138 if (!symbol__hists(sym, top->evlist->core.nr_entries)) {
139 pthread_mutex_unlock(&notes->lock);
140 pr_err("Not enough memory for annotating '%s' symbol!\n",
141 sym->name);
142 sleep(1);
143 return err;
144 }
145
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * builtin-top.c
4 *
5 * Builtin top command: Display a continuously updated profile of
6 * any workload, CPU or specific PID.
7 *
8 * Copyright (C) 2008, Red Hat Inc, Ingo Molnar <mingo@redhat.com>

--- 129 unchanged lines hidden (view full) ---

138 if (!symbol__hists(sym, top->evlist->core.nr_entries)) {
139 pthread_mutex_unlock(&notes->lock);
140 pr_err("Not enough memory for annotating '%s' symbol!\n",
141 sym->name);
142 sleep(1);
143 return err;
144 }
145
146 err = symbol__annotate(sym, map, evsel, 0, &top->annotation_opts, NULL);
146 err = symbol__annotate(&he->ms, evsel, 0, &top->annotation_opts, NULL);
147 if (err == 0) {
148 top->sym_filter_entry = he;
149 } else {
150 char msg[BUFSIZ];
147 if (err == 0) {
148 top->sym_filter_entry = he;
149 } else {
150 char msg[BUFSIZ];
151 symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg));
151 symbol__strerror_disassemble(&he->ms, err, msg, sizeof(msg));
152 pr_err("Couldn't annotate %s: %s\n", sym->name, msg);
153 }
154
155 pthread_mutex_unlock(&notes->lock);
156 return err;
157}
158
159static void __zero_source_counters(struct hist_entry *he)

--- 92 unchanged lines hidden (view full) ---

252 symbol__calc_percent(symbol, evsel);
253
254 if (notes->src == NULL)
255 goto out_unlock;
256
257 printf("Showing %s for %s\n", perf_evsel__name(top->sym_evsel), symbol->name);
258 printf(" Events Pcnt (>=%d%%)\n", top->annotation_opts.min_pcnt);
259
152 pr_err("Couldn't annotate %s: %s\n", sym->name, msg);
153 }
154
155 pthread_mutex_unlock(&notes->lock);
156 return err;
157}
158
159static void __zero_source_counters(struct hist_entry *he)

--- 92 unchanged lines hidden (view full) ---

252 symbol__calc_percent(symbol, evsel);
253
254 if (notes->src == NULL)
255 goto out_unlock;
256
257 printf("Showing %s for %s\n", perf_evsel__name(top->sym_evsel), symbol->name);
258 printf(" Events Pcnt (>=%d%%)\n", top->annotation_opts.min_pcnt);
259
260 more = symbol__annotate_printf(symbol, he->ms.map, top->sym_evsel, &top->annotation_opts);
260 more = symbol__annotate_printf(&he->ms, top->sym_evsel, &top->annotation_opts);
261
262 if (top->evlist->enabled) {
263 if (top->zero)
264 symbol__annotate_zero_histogram(symbol, top->sym_evsel->idx);
265 else
266 symbol__annotate_decay_histogram(symbol, top->sym_evsel->idx);
267 }
268 if (more != 0)

--- 1446 unchanged lines hidden ---
261
262 if (top->evlist->enabled) {
263 if (top->zero)
264 symbol__annotate_zero_histogram(symbol, top->sym_evsel->idx);
265 else
266 symbol__annotate_decay_histogram(symbol, top->sym_evsel->idx);
267 }
268 if (more != 0)

--- 1446 unchanged lines hidden ---