summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-16 20:06:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-16 20:06:21 -0400
commit772c1d06bd402f7ee72c61a18c2db74cd74b6758 (patch)
treee362fc7e158b3580d810a26189ecf91ec8a4f141 /tools/perf/builtin-annotate.c
parentc7eba51cfdf9cd1ca7ed4201b30be8b2bef15ff5 (diff)
parente336b4027775cb458dc713745e526fa1a1996b2a (diff)
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar: "Kernel side changes: - Improved kbprobes robustness - Intel PEBS support for PT hardware tracing - Other Intel PT improvements: high order pages memory footprint reduction and various related cleanups - Misc cleanups The perf tooling side has been very busy in this cycle, with over 300 commits. This is an incomplete high-level summary of the many improvements done by over 30 developers: - Lots of updates to the following tools: 'perf c2c' 'perf config' 'perf record' 'perf report' 'perf script' 'perf test' 'perf top' 'perf trace' - Updates to libperf and libtraceevent, and a consolidation of the proliferation of x86 instruction decoder libraries. - Vendor event updates for Intel and PowerPC CPUs, - Updates to hardware tracing tooling for ARM and Intel CPUs, - ... and lots of other changes and cleanups - see the shortlog and Git log for details" * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (322 commits) kprobes: Prohibit probing on BUG() and WARN() address perf/x86: Make more stuff static x86, perf: Fix the dependency of the x86 insn decoder selftest objtool: Ignore intentional differences for the x86 insn decoder objtool: Update sync-check.sh from perf's check-headers.sh perf build: Ignore intentional differences for the x86 insn decoder perf intel-pt: Use shared x86 insn decoder perf intel-pt: Remove inat.c from build dependency list perf: Update .gitignore file objtool: Move x86 insn decoder to a common location perf metricgroup: Support multiple events for metricgroup perf metricgroup: Scale the metric result perf pmu: Change convert_scale from static to global perf symbols: Move mem_info and branch_info out of symbol.h perf auxtrace: Uninline functions that touch perf_session perf tools: Remove needless evlist.h include directives perf tools: Remove needless evlist.h include directives perf tools: Remove needless thread_map.h include directives perf tools: Remove needless thread.h include directives perf tools: Remove needless map.h include directives ...
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index e0aa14faf2b5..4e4d2e76232e 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -24,15 +24,17 @@
24#include "util/event.h" 24#include "util/event.h"
25#include <subcmd/parse-options.h> 25#include <subcmd/parse-options.h>
26#include "util/parse-events.h" 26#include "util/parse-events.h"
27#include "util/thread.h"
28#include "util/sort.h" 27#include "util/sort.h"
29#include "util/hist.h" 28#include "util/hist.h"
29#include "util/dso.h"
30#include "util/map.h" 30#include "util/map.h"
31#include "util/session.h" 31#include "util/session.h"
32#include "util/tool.h" 32#include "util/tool.h"
33#include "util/data.h" 33#include "util/data.h"
34#include "arch/common.h" 34#include "arch/common.h"
35#include "util/block-range.h" 35#include "util/block-range.h"
36#include "util/map_symbol.h"
37#include "util/branch.h"
36 38
37#include <dlfcn.h> 39#include <dlfcn.h>
38#include <errno.h> 40#include <errno.h>
@@ -156,7 +158,7 @@ static int hist_iter__branch_callback(struct hist_entry_iter *iter,
156 struct hist_entry *he = iter->he; 158 struct hist_entry *he = iter->he;
157 struct branch_info *bi; 159 struct branch_info *bi;
158 struct perf_sample *sample = iter->sample; 160 struct perf_sample *sample = iter->sample;
159 struct perf_evsel *evsel = iter->evsel; 161 struct evsel *evsel = iter->evsel;
160 int err; 162 int err;
161 163
162 bi = he->branch_info; 164 bi = he->branch_info;
@@ -171,7 +173,7 @@ out:
171 return err; 173 return err;
172} 174}
173 175
174static int process_branch_callback(struct perf_evsel *evsel, 176static int process_branch_callback(struct evsel *evsel,
175 struct perf_sample *sample, 177 struct perf_sample *sample,
176 struct addr_location *al __maybe_unused, 178 struct addr_location *al __maybe_unused,
177 struct perf_annotate *ann, 179 struct perf_annotate *ann,
@@ -208,7 +210,7 @@ static bool has_annotation(struct perf_annotate *ann)
208 return ui__has_annotation() || ann->use_stdio2; 210 return ui__has_annotation() || ann->use_stdio2;
209} 211}
210 212
211static int perf_evsel__add_sample(struct perf_evsel *evsel, 213static int perf_evsel__add_sample(struct evsel *evsel,
212 struct perf_sample *sample, 214 struct perf_sample *sample,
213 struct addr_location *al, 215 struct addr_location *al,
214 struct perf_annotate *ann, 216 struct perf_annotate *ann,
@@ -257,7 +259,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel,
257static int process_sample_event(struct perf_tool *tool, 259static int process_sample_event(struct perf_tool *tool,
258 union perf_event *event, 260 union perf_event *event,
259 struct perf_sample *sample, 261 struct perf_sample *sample,
260 struct perf_evsel *evsel, 262 struct evsel *evsel,
261 struct machine *machine) 263 struct machine *machine)
262{ 264{
263 struct perf_annotate *ann = container_of(tool, struct perf_annotate, tool); 265 struct perf_annotate *ann = container_of(tool, struct perf_annotate, tool);
@@ -293,7 +295,7 @@ static int process_feature_event(struct perf_session *session,
293} 295}
294 296
295static int hist_entry__tty_annotate(struct hist_entry *he, 297static int hist_entry__tty_annotate(struct hist_entry *he,
296 struct perf_evsel *evsel, 298 struct evsel *evsel,
297 struct perf_annotate *ann) 299 struct perf_annotate *ann)
298{ 300{
299 if (!ann->use_stdio2) 301 if (!ann->use_stdio2)
@@ -303,7 +305,7 @@ static int hist_entry__tty_annotate(struct hist_entry *he,
303} 305}
304 306
305static void hists__find_annotations(struct hists *hists, 307static void hists__find_annotations(struct hists *hists,
306 struct perf_evsel *evsel, 308 struct evsel *evsel,
307 struct perf_annotate *ann) 309 struct perf_annotate *ann)
308{ 310{
309 struct rb_node *nd = rb_first_cached(&hists->entries), *next; 311 struct rb_node *nd = rb_first_cached(&hists->entries), *next;
@@ -333,7 +335,7 @@ find_next:
333 if (use_browser == 2) { 335 if (use_browser == 2) {
334 int ret; 336 int ret;
335 int (*annotate)(struct hist_entry *he, 337 int (*annotate)(struct hist_entry *he,
336 struct perf_evsel *evsel, 338 struct evsel *evsel,
337 struct hist_browser_timer *hbt); 339 struct hist_browser_timer *hbt);
338 340
339 annotate = dlsym(perf_gtk_handle, 341 annotate = dlsym(perf_gtk_handle,
@@ -387,7 +389,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
387{ 389{
388 int ret; 390 int ret;
389 struct perf_session *session = ann->session; 391 struct perf_session *session = ann->session;
390 struct perf_evsel *pos; 392 struct evsel *pos;
391 u64 total_nr_samples; 393 u64 total_nr_samples;
392 394
393 if (ann->cpu_list) { 395 if (ann->cpu_list) {