summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 11:30:20 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 13:39:28 +0100
commit45694aa7702bc44d538a3bcb51bb2bb96cf190c0 (patch)
tree81bc1f449f55984556d89b63c461dcf181dc97e5 /tools/perf/builtin-annotate.c
parentperf tools: Resolve machine earlier and pass it to perf_event_ops (diff)
downloadlinux-45694aa7702bc44d538a3bcb51bb2bb96cf190c0.tar.xz
linux-45694aa7702bc44d538a3bcb51bb2bb96cf190c0.zip
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-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index dff081a388bb..c01139fa4a10 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -27,11 +27,12 @@
#include "util/sort.h"
#include "util/hist.h"
#include "util/session.h"
+#include "util/tool.h"
#include <linux/bitmap.h>
struct perf_annotate {
- struct perf_event_ops ops;
+ struct perf_tool tool;
char const *input_name;
bool force, use_tui, use_stdio;
bool full_paths;
@@ -79,13 +80,13 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel,
return ret;
}
-static int process_sample_event(struct perf_event_ops *ops,
+static int process_sample_event(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
struct perf_evsel *evsel,
struct machine *machine)
{
- struct perf_annotate *ann = container_of(ops, struct perf_annotate, ops);
+ struct perf_annotate *ann = container_of(tool, struct perf_annotate, tool);
struct addr_location al;
if (perf_event__preprocess_sample(event, machine, &al, sample,
@@ -174,7 +175,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
u64 total_nr_samples;
session = perf_session__new(ann->input_name, O_RDONLY,
- ann->force, false, &ann->ops);
+ ann->force, false, &ann->tool);
if (session == NULL)
return -ENOMEM;
@@ -185,7 +186,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
goto out_delete;
}
- ret = perf_session__process_events(session, &ann->ops);
+ ret = perf_session__process_events(session, &ann->tool);
if (ret)
goto out_delete;
@@ -241,7 +242,7 @@ static const char * const annotate_usage[] = {
int cmd_annotate(int argc, const char **argv, const char *prefix __used)
{
struct perf_annotate annotate = {
- .ops = {
+ .tool = {
.sample = process_sample_event,
.mmap = perf_event__process_mmap,
.comm = perf_event__process_comm,