perf/core: Split perf_event_read() and perf_event_count()
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Fri, 4 Sep 2015 03:07:46 +0000 (20:07 -0700)
committerIngo Molnar <mingo@kernel.org>
Sun, 13 Sep 2015 09:27:25 +0000 (11:27 +0200)
commit01add3eaf1b25e497b14ca210f3bfe5f5dd2b112
tree50f2e21629f3168525f82402e5477fea4ece6d8b
parentfbbe07011581990ef74dfac06dc8511b1a14badb
perf/core: Split perf_event_read() and perf_event_count()

perf_event_read() does two things:

- call the PMU to read/update the counter value, and
- compute the total count of the event and its children

Not all callers need both. perf_event_reset() for instance needs the
first piece but doesn't need the second.  Similarly, when we implement
the ability to read a group of events using the transaction interface,
we would need the two pieces done independently.

Break up perf_event_read() and have it just read/update the counter
and have the callers compute the total count if necessary.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1441336073-22750-4-git-send-email-sukadev@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c