]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
powerpc/perf/hv-24x7: Define update_event_count()
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Tue, 31 Mar 2015 01:53:46 +0000 (18:53 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 11 Apr 2015 10:49:26 +0000 (20:49 +1000)
Move the code to update an event count into a new function,
update_event_count().

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/perf/hv-24x7.c

index 676fb2f93825be808fde6da72901c2f0de3d2615..cf820269bfb615832e70e59b36ad54e53e46d62f 100644 (file)
@@ -1172,16 +1172,22 @@ static u64 h_24x7_get_value(struct perf_event *event)
        return ct;
 }
 
-static void h_24x7_event_read(struct perf_event *event)
+static void update_event_count(struct perf_event *event, u64 now)
 {
        s64 prev;
-       u64 now;
 
-       now = h_24x7_get_value(event);
        prev = local64_xchg(&event->hw.prev_count, now);
        local64_add(now - prev, &event->count);
 }
 
+static void h_24x7_event_read(struct perf_event *event)
+{
+       u64 now;
+
+       now = h_24x7_get_value(event);
+       update_event_count(event, now);
+}
+
 static void h_24x7_event_start(struct perf_event *event, int flags)
 {
        if (flags & PERF_EF_RELOAD)