提交 768a06e2 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

perf: Simplify task_clock_event_read()

There is no point in us having different code paths for nmi and !nmi
here, so remove the !nmi one.
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 3f7cce3c
...@@ -5810,16 +5810,9 @@ static void task_clock_event_del(struct perf_event *event, int flags) ...@@ -5810,16 +5810,9 @@ static void task_clock_event_del(struct perf_event *event, int flags)
static void task_clock_event_read(struct perf_event *event) static void task_clock_event_read(struct perf_event *event)
{ {
u64 time; u64 now = perf_clock();
u64 delta = now - event->ctx->timestamp;
if (!in_nmi()) { u64 time = event->ctx->time + delta;
update_context_time(event->ctx);
time = event->ctx->time;
} else {
u64 now = perf_clock();
u64 delta = now - event->ctx->timestamp;
time = event->ctx->time + delta;
}
task_clock_event_update(event, time); task_clock_event_update(event, time);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册