提交 529ce8c9 编写于 作者: S Sukadev Bhattiprolu 提交者: Michael Ellerman

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: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 3ca4ea71
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册