aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index ea64fbbdff43..eef8e423deb0 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -25,6 +25,7 @@
25#include "util/evsel.h" 25#include "util/evsel.h"
26#include "util/header.h" 26#include "util/header.h"
27#include "util/session.h" 27#include "util/session.h"
28#include "util/tool.h"
28 29
29#include "util/parse-options.h" 30#include "util/parse-options.h"
30#include "util/parse-events.h" 31#include "util/parse-events.h"
@@ -36,7 +37,7 @@
36#include <linux/bitmap.h> 37#include <linux/bitmap.h>
37 38
38struct perf_report { 39struct perf_report {
39 struct perf_event_ops ops; 40 struct perf_tool tool;
40 struct perf_session *session; 41 struct perf_session *session;
41 char const *input_name; 42 char const *input_name;
42 bool force, use_tui, use_stdio; 43 bool force, use_tui, use_stdio;
@@ -103,13 +104,13 @@ out:
103} 104}
104 105
105 106
106static int process_sample_event(struct perf_event_ops *ops, 107static int process_sample_event(struct perf_tool *tool,
107 union perf_event *event, 108 union perf_event *event,
108 struct perf_sample *sample, 109 struct perf_sample *sample,
109 struct perf_evsel *evsel, 110 struct perf_evsel *evsel,
110 struct machine *machine) 111 struct machine *machine)
111{ 112{
112 struct perf_report *rep = container_of(ops, struct perf_report, ops); 113 struct perf_report *rep = container_of(tool, struct perf_report, tool);
113 struct addr_location al; 114 struct addr_location al;
114 115
115 if (perf_event__preprocess_sample(event, machine, &al, sample, 116 if (perf_event__preprocess_sample(event, machine, &al, sample,
@@ -136,13 +137,13 @@ static int process_sample_event(struct perf_event_ops *ops,
136 return 0; 137 return 0;
137} 138}
138 139
139static int process_read_event(struct perf_event_ops *ops, 140static int process_read_event(struct perf_tool *tool,
140 union perf_event *event, 141 union perf_event *event,
141 struct perf_sample *sample __used, 142 struct perf_sample *sample __used,
142 struct perf_evsel *evsel, 143 struct perf_evsel *evsel,
143 struct machine *machine __used) 144 struct machine *machine __used)
144{ 145{
145 struct perf_report *rep = container_of(ops, struct perf_report, ops); 146 struct perf_report *rep = container_of(tool, struct perf_report, tool);
146 147
147 if (rep->show_threads) { 148 if (rep->show_threads) {
148 const char *name = evsel ? event_name(evsel) : "unknown"; 149 const char *name = evsel ? event_name(evsel) : "unknown";
@@ -254,7 +255,7 @@ static int __cmd_report(struct perf_report *rep)
254 signal(SIGINT, sig_handler); 255 signal(SIGINT, sig_handler);
255 256
256 session = perf_session__new(rep->input_name, O_RDONLY, 257 session = perf_session__new(rep->input_name, O_RDONLY,
257 rep->force, false, &rep->ops); 258 rep->force, false, &rep->tool);
258 if (session == NULL) 259 if (session == NULL)
259 return -ENOMEM; 260 return -ENOMEM;
260 261
@@ -277,7 +278,7 @@ static int __cmd_report(struct perf_report *rep)
277 if (ret) 278 if (ret)
278 goto out_delete; 279 goto out_delete;
279 280
280 ret = perf_session__process_events(session, &rep->ops); 281 ret = perf_session__process_events(session, &rep->tool);
281 if (ret) 282 if (ret)
282 goto out_delete; 283 goto out_delete;
283 284
@@ -435,7 +436,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
435 NULL 436 NULL
436 }; 437 };
437 struct perf_report report = { 438 struct perf_report report = {
438 .ops = { 439 .tool = {
439 .sample = process_sample_event, 440 .sample = process_sample_event,
440 .mmap = perf_event__process_mmap, 441 .mmap = perf_event__process_mmap,
441 .comm = perf_event__process_comm, 442 .comm = perf_event__process_comm,