aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-kmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-kmem.c')
-rw-r--r--tools/perf/builtin-kmem.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 27b2a15dc7b2..886174e9525b 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -7,6 +7,7 @@
7#include "util/thread.h" 7#include "util/thread.h"
8#include "util/header.h" 8#include "util/header.h"
9#include "util/session.h" 9#include "util/session.h"
10#include "util/tool.h"
10 11
11#include "util/parse-options.h" 12#include "util/parse-options.h"
12#include "util/trace-event.h" 13#include "util/trace-event.h"
@@ -303,7 +304,7 @@ static void process_raw_event(union perf_event *raw_event __used, void *data,
303 } 304 }
304} 305}
305 306
306static int process_sample_event(struct perf_event_ops *ops __used, 307static int process_sample_event(struct perf_tool *tool __used,
307 union perf_event *event, 308 union perf_event *event,
308 struct perf_sample *sample, 309 struct perf_sample *sample,
309 struct perf_evsel *evsel __used, 310 struct perf_evsel *evsel __used,
@@ -325,7 +326,7 @@ static int process_sample_event(struct perf_event_ops *ops __used,
325 return 0; 326 return 0;
326} 327}
327 328
328static struct perf_event_ops event_ops = { 329static struct perf_tool perf_kmem = {
329 .sample = process_sample_event, 330 .sample = process_sample_event,
330 .comm = perf_event__process_comm, 331 .comm = perf_event__process_comm,
331 .ordered_samples = true, 332 .ordered_samples = true,
@@ -484,7 +485,7 @@ static int __cmd_kmem(void)
484{ 485{
485 int err = -EINVAL; 486 int err = -EINVAL;
486 struct perf_session *session = perf_session__new(input_name, O_RDONLY, 487 struct perf_session *session = perf_session__new(input_name, O_RDONLY,
487 0, false, &event_ops); 488 0, false, &perf_kmem);
488 if (session == NULL) 489 if (session == NULL)
489 return -ENOMEM; 490 return -ENOMEM;
490 491
@@ -495,7 +496,7 @@ static int __cmd_kmem(void)
495 goto out_delete; 496 goto out_delete;
496 497
497 setup_pager(); 498 setup_pager();
498 err = perf_session__process_events(session, &event_ops); 499 err = perf_session__process_events(session, &perf_kmem);
499 if (err != 0) 500 if (err != 0)
500 goto out_delete; 501 goto out_delete;
501 sort_result(); 502 sort_result();