aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-script.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 05:30:20 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 07:39:28 -0500
commit45694aa7702bc44d538a3bcb51bb2bb96cf190c0 (patch)
tree81bc1f449f55984556d89b63c461dcf181dc97e5 /tools/perf/builtin-script.c
parent743eb868657bdb1b26c7b24077ca21c67c82c777 (diff)
perf tools: Rename perf_event_ops to perf_tool
To better reflect that it became the base class for all tools, that must be in each tool struct and where common stuff will be put. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-qgpc4msetqlwr8y2k7537cxe@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r--tools/perf/builtin-script.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 31a8d14e5fb7..5f8afc65d5f3 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -7,6 +7,7 @@
7#include "util/header.h" 7#include "util/header.h"
8#include "util/parse-options.h" 8#include "util/parse-options.h"
9#include "util/session.h" 9#include "util/session.h"
10#include "util/tool.h"
10#include "util/symbol.h" 11#include "util/symbol.h"
11#include "util/thread.h" 12#include "util/thread.h"
12#include "util/trace-event.h" 13#include "util/trace-event.h"
@@ -434,7 +435,7 @@ static int cleanup_scripting(void)
434 435
435static char const *input_name = "perf.data"; 436static char const *input_name = "perf.data";
436 437
437static int process_sample_event(struct perf_event_ops *ops __used, 438static int process_sample_event(struct perf_tool *tool __used,
438 union perf_event *event, 439 union perf_event *event,
439 struct perf_sample *sample, 440 struct perf_sample *sample,
440 struct perf_evsel *evsel, 441 struct perf_evsel *evsel,
@@ -468,7 +469,7 @@ static int process_sample_event(struct perf_event_ops *ops __used,
468 return 0; 469 return 0;
469} 470}
470 471
471static struct perf_event_ops event_ops = { 472static struct perf_tool perf_script = {
472 .sample = process_sample_event, 473 .sample = process_sample_event,
473 .mmap = perf_event__process_mmap, 474 .mmap = perf_event__process_mmap,
474 .comm = perf_event__process_comm, 475 .comm = perf_event__process_comm,
@@ -495,7 +496,7 @@ static int __cmd_script(struct perf_session *session)
495 496
496 signal(SIGINT, sig_handler); 497 signal(SIGINT, sig_handler);
497 498
498 ret = perf_session__process_events(session, &event_ops); 499 ret = perf_session__process_events(session, &perf_script);
499 500
500 if (debug_mode) 501 if (debug_mode)
501 pr_err("Misordered timestamps: %" PRIu64 "\n", nr_unordered); 502 pr_err("Misordered timestamps: %" PRIu64 "\n", nr_unordered);
@@ -1262,7 +1263,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __used)
1262 if (!script_name) 1263 if (!script_name)
1263 setup_pager(); 1264 setup_pager();
1264 1265
1265 session = perf_session__new(input_name, O_RDONLY, 0, false, &event_ops); 1266 session = perf_session__new(input_name, O_RDONLY, 0, false, &perf_script);
1266 if (session == NULL) 1267 if (session == NULL)
1267 return -ENOMEM; 1268 return -ENOMEM;
1268 1269