aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r--tools/perf/builtin-sched.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 6a771f822e5d..0ee868e6f63b 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -8,6 +8,7 @@
8#include "util/thread.h" 8#include "util/thread.h"
9#include "util/header.h" 9#include "util/header.h"
10#include "util/session.h" 10#include "util/session.h"
11#include "util/tool.h"
11 12
12#include "util/parse-options.h" 13#include "util/parse-options.h"
13#include "util/trace-event.h" 14#include "util/trace-event.h"
@@ -1602,7 +1603,7 @@ static void process_raw_event(union perf_event *raw_event __used,
1602 process_sched_migrate_task_event(data, machine, event, cpu, timestamp, thread); 1603 process_sched_migrate_task_event(data, machine, event, cpu, timestamp, thread);
1603} 1604}
1604 1605
1605static int process_sample_event(struct perf_event_ops *ops __used, 1606static int process_sample_event(struct perf_tool *tool __used,
1606 union perf_event *event, 1607 union perf_event *event,
1607 struct perf_sample *sample, 1608 struct perf_sample *sample,
1608 struct perf_evsel *evsel, 1609 struct perf_evsel *evsel,
@@ -1631,7 +1632,7 @@ static int process_sample_event(struct perf_event_ops *ops __used,
1631 return 0; 1632 return 0;
1632} 1633}
1633 1634
1634static struct perf_event_ops event_ops = { 1635static struct perf_tool perf_sched = {
1635 .sample = process_sample_event, 1636 .sample = process_sample_event,
1636 .comm = perf_event__process_comm, 1637 .comm = perf_event__process_comm,
1637 .lost = perf_event__process_lost, 1638 .lost = perf_event__process_lost,
@@ -1643,12 +1644,12 @@ static void read_events(bool destroy, struct perf_session **psession)
1643{ 1644{
1644 int err = -EINVAL; 1645 int err = -EINVAL;
1645 struct perf_session *session = perf_session__new(input_name, O_RDONLY, 1646 struct perf_session *session = perf_session__new(input_name, O_RDONLY,
1646 0, false, &event_ops); 1647 0, false, &perf_sched);
1647 if (session == NULL) 1648 if (session == NULL)
1648 die("No Memory"); 1649 die("No Memory");
1649 1650
1650 if (perf_session__has_traces(session, "record -R")) { 1651 if (perf_session__has_traces(session, "record -R")) {
1651 err = perf_session__process_events(session, &event_ops); 1652 err = perf_session__process_events(session, &perf_sched);
1652 if (err) 1653 if (err)
1653 die("Failed to process events, error %d", err); 1654 die("Failed to process events, error %d", err);
1654 1655