]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
perf session: Remove redundant prefix & suffix from perf_event_ops
authorArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 27 Dec 2009 23:37:05 +0000 (21:37 -0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 28 Dec 2009 08:03:35 +0000 (09:03 +0100)
Since now all that we have are perf event handlers, leave just
the name of the event.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1261957026-15580-9-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/builtin-annotate.c
tools/perf/builtin-diff.c
tools/perf/builtin-kmem.c
tools/perf/builtin-report.c
tools/perf/builtin-sched.c
tools/perf/builtin-timechart.c
tools/perf/builtin-trace.c
tools/perf/util/session.c
tools/perf/util/session.h

index 593ff25006defbd405713e1c1c24653911760a4f..117bbae844bff11ed5188deca61427f5eed897a9 100644 (file)
@@ -451,10 +451,10 @@ static void perf_session__find_annotations(struct perf_session *self)
 }
 
 static struct perf_event_ops event_ops = {
-       .process_sample_event   = process_sample_event,
-       .process_mmap_event     = event__process_mmap,
-       .process_comm_event     = event__process_comm,
-       .process_fork_event     = event__process_task,
+       .sample = process_sample_event,
+       .mmap   = event__process_mmap,
+       .comm   = event__process_comm,
+       .fork   = event__process_task,
 };
 
 static int __cmd_annotate(void)
index e164b3d45cd4f6d42ab15fd28740eb96af0bc6d1..1cbecaf029fa09c35dde438e269eb8fcdebc3057 100644 (file)
@@ -66,12 +66,12 @@ static int diff__process_sample_event(event_t *event, struct perf_session *sessi
 }
 
 static struct perf_event_ops event_ops = {
-       .process_sample_event = diff__process_sample_event,
-       .process_mmap_event   = event__process_mmap,
-       .process_comm_event   = event__process_comm,
-       .process_exit_event   = event__process_task,
-       .process_fork_event   = event__process_task,
-       .process_lost_event   = event__process_lost,
+       .sample = diff__process_sample_event,
+       .mmap   = event__process_mmap,
+       .comm   = event__process_comm,
+       .exit   = event__process_task,
+       .fork   = event__process_task,
+       .lost   = event__process_lost,
 };
 
 static void perf_session__insert_hist_entry_by_name(struct rb_root *root,
index 73b065022e274d75eb7b1b7e5b52d7d3939ed2ae..4c06828fe39de27d9617c1512122896331b71c0c 100644 (file)
@@ -343,8 +343,8 @@ static int process_sample_event(event_t *event, struct perf_session *session)
 }
 
 static struct perf_event_ops event_ops = {
-       .process_sample_event   = process_sample_event,
-       .process_comm_event     = event__process_comm,
+       .sample = process_sample_event,
+       .comm   = event__process_comm,
 };
 
 static double fragmentation(unsigned long n_req, unsigned long n_alloc)
index f695084910c03535bf6a203bd239ecc43789c03a..508934b0140a5f4155410e0ea5d558cdff0f1bd6 100644 (file)
@@ -184,13 +184,13 @@ static int perf_session__setup_sample_type(struct perf_session *self)
 }
 
 static struct perf_event_ops event_ops = {
-       .process_sample_event   = process_sample_event,
-       .process_mmap_event     = event__process_mmap,
-       .process_comm_event     = event__process_comm,
-       .process_exit_event     = event__process_task,
-       .process_fork_event     = event__process_task,
-       .process_lost_event     = event__process_lost,
-       .process_read_event     = process_read_event,
+       .sample = process_sample_event,
+       .mmap   = event__process_mmap,
+       .comm   = event__process_comm,
+       .exit   = event__process_task,
+       .fork   = event__process_task,
+       .lost   = event__process_lost,
+       .read   = process_read_event,
 };
 
 static int __cmd_report(void)
index e862e71f4e68d39dcb565128fa9046124d164750..702322f8fec16a0927d6d6f311151e73b32a4d43 100644 (file)
@@ -1654,9 +1654,9 @@ static int process_lost_event(event_t *event __used,
 }
 
 static struct perf_event_ops event_ops = {
-       .process_sample_event   = process_sample_event,
-       .process_comm_event     = event__process_comm,
-       .process_lost_event     = process_lost_event,
+       .sample = process_sample_event,
+       .comm   = event__process_comm,
+       .lost   = process_lost_event,
 };
 
 static int read_events(void)
index 825283794985fc37c92b8def17e5d4e58f6bee0e..5b68d81d93a11f591bd0e0e947b6d79b2372e4e0 100644 (file)
@@ -1030,10 +1030,10 @@ static void process_samples(struct perf_session *session)
 }
 
 static struct perf_event_ops event_ops = {
-       .process_comm_event     = process_comm_event,
-       .process_fork_event     = process_fork_event,
-       .process_exit_event     = process_exit_event,
-       .process_sample_event   = queue_sample_event,
+       .comm   = process_comm_event,
+       .fork   = process_fork_event,
+       .exit   = process_exit_event,
+       .sample = queue_sample_event,
 };
 
 static int __cmd_timechart(void)
index e94f34631585cd6a27aebd7436d02444080c52b8..1831434aa9387b9feaac7209a378737602706d32 100644 (file)
@@ -104,8 +104,8 @@ static int process_sample_event(event_t *event, struct perf_session *session)
 }
 
 static struct perf_event_ops event_ops = {
-       .process_sample_event   = process_sample_event,
-       .process_comm_event     = event__process_comm,
+       .sample = process_sample_event,
+       .comm   = event__process_comm,
 };
 
 static int __cmd_trace(struct perf_session *session)
index 4f2eeb584da87ea6dd95bb3a3b2c686d110778a4..7f0537d1add8de0039f193798826f8fe1c6f6d31 100644 (file)
@@ -161,24 +161,24 @@ static int process_event_stub(event_t *event __used,
 
 static void perf_event_ops__fill_defaults(struct perf_event_ops *handler)
 {
-       if (handler->process_sample_event == NULL)
-               handler->process_sample_event = process_event_stub;
-       if (handler->process_mmap_event == NULL)
-               handler->process_mmap_event = process_event_stub;
-       if (handler->process_comm_event == NULL)
-               handler->process_comm_event = process_event_stub;
-       if (handler->process_fork_event == NULL)
-               handler->process_fork_event = process_event_stub;
-       if (handler->process_exit_event == NULL)
-               handler->process_exit_event = process_event_stub;
-       if (handler->process_lost_event == NULL)
-               handler->process_lost_event = process_event_stub;
-       if (handler->process_read_event == NULL)
-               handler->process_read_event = process_event_stub;
-       if (handler->process_throttle_event == NULL)
-               handler->process_throttle_event = process_event_stub;
-       if (handler->process_unthrottle_event == NULL)
-               handler->process_unthrottle_event = process_event_stub;
+       if (handler->sample == NULL)
+               handler->sample = process_event_stub;
+       if (handler->mmap == NULL)
+               handler->mmap = process_event_stub;
+       if (handler->comm == NULL)
+               handler->comm = process_event_stub;
+       if (handler->fork == NULL)
+               handler->fork = process_event_stub;
+       if (handler->exit == NULL)
+               handler->exit = process_event_stub;
+       if (handler->lost == NULL)
+               handler->lost = process_event_stub;
+       if (handler->read == NULL)
+               handler->read = process_event_stub;
+       if (handler->throttle == NULL)
+               handler->throttle = process_event_stub;
+       if (handler->unthrottle == NULL)
+               handler->unthrottle = process_event_stub;
 }
 
 static const char *event__name[] = {
@@ -222,23 +222,23 @@ static int perf_session__process_event(struct perf_session *self,
 
        switch (event->header.type) {
        case PERF_RECORD_SAMPLE:
-               return ops->process_sample_event(event, self);
+               return ops->sample(event, self);
        case PERF_RECORD_MMAP:
-               return ops->process_mmap_event(event, self);
+               return ops->mmap(event, self);
        case PERF_RECORD_COMM:
-               return ops->process_comm_event(event, self);
+               return ops->comm(event, self);
        case PERF_RECORD_FORK:
-               return ops->process_fork_event(event, self);
+               return ops->fork(event, self);
        case PERF_RECORD_EXIT:
-               return ops->process_exit_event(event, self);
+               return ops->exit(event, self);
        case PERF_RECORD_LOST:
-               return ops->process_lost_event(event, self);
+               return ops->lost(event, self);
        case PERF_RECORD_READ:
-               return ops->process_read_event(event, self);
+               return ops->read(event, self);
        case PERF_RECORD_THROTTLE:
-               return ops->process_throttle_event(event, self);
+               return ops->throttle(event, self);
        case PERF_RECORD_UNTHROTTLE:
-               return ops->process_unthrottle_event(event, self);
+               return ops->unthrottle(event, self);
        default:
                self->unknown_events++;
                return -1;
index 2ff77fea06efeb8babf1011988744b67be1ca3fa..77c5ee2993c28e18bc5c7276cd8cfe1f3da56f69 100644 (file)
@@ -32,15 +32,15 @@ struct perf_session {
 typedef int (*event_op)(event_t *self, struct perf_session *session);
 
 struct perf_event_ops {
-       event_op        process_sample_event;
-       event_op        process_mmap_event;
-       event_op        process_comm_event;
-       event_op        process_fork_event;
-       event_op        process_exit_event;
-       event_op        process_lost_event;
-       event_op        process_read_event;
-       event_op        process_throttle_event;
-       event_op        process_unthrottle_event;
+       event_op sample,
+                mmap,
+                comm,
+                fork,
+                exit,
+                lost,
+                read,
+                throttle,
+                unthrottle;
 };
 
 struct perf_session *perf_session__new(const char *filename, int mode, bool force);