summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/perf
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>2015-03-31 03:53:46 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-11 12:49:26 +0200
commit529ce8c9ddd00bd1ee77727f7a83c02dff0684f8 (patch)
tree88e3d4f42c22997810d4c19c2f7a2a4d608d3afc /arch/powerpc/perf
parentpowerpc/perf/hv-24x7: Whitespace cleanup (diff)
downloadlinux-529ce8c9ddd00bd1ee77727f7a83c02dff0684f8.tar.xz
linux-529ce8c9ddd00bd1ee77727f7a83c02dff0684f8.zip
powerpc/perf/hv-24x7: Define update_event_count()
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>
Diffstat (limited to 'arch/powerpc/perf')
-rw-r--r--arch/powerpc/perf/hv-24x7.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index 676fb2f93825..cf820269bfb6 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -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)