Commit 72f669c0 authored by Shaohua Li's avatar Shaohua Li Committed by Ingo Molnar

perf: Update shadow timestamp before add event

Update the shadow timestamp before start event, because .add might
use the timestamp.
Signed-off-by: default avatarShaohua Li <shli@fb.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Mackerras <paulus@samba.org>
Link: http://lkml.kernel.org/r/9cd0276d6a047cb7c2885994f25e3a1f7c8c28af.1423180257.git.shli@fb.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 8e57c586
...@@ -1881,6 +1881,10 @@ event_sched_in(struct perf_event *event, ...@@ -1881,6 +1881,10 @@ event_sched_in(struct perf_event *event,
perf_pmu_disable(event->pmu); perf_pmu_disable(event->pmu);
event->tstamp_running += tstamp - event->tstamp_stopped;
perf_set_shadow_time(event, ctx, tstamp);
if (event->pmu->add(event, PERF_EF_START)) { if (event->pmu->add(event, PERF_EF_START)) {
event->state = PERF_EVENT_STATE_INACTIVE; event->state = PERF_EVENT_STATE_INACTIVE;
event->oncpu = -1; event->oncpu = -1;
...@@ -1888,10 +1892,6 @@ event_sched_in(struct perf_event *event, ...@@ -1888,10 +1892,6 @@ event_sched_in(struct perf_event *event,
goto out; goto out;
} }
event->tstamp_running += tstamp - event->tstamp_stopped;
perf_set_shadow_time(event, ctx, tstamp);
if (!is_software_event(event)) if (!is_software_event(event))
cpuctx->active_oncpu++; cpuctx->active_oncpu++;
if (!ctx->nr_active++) if (!ctx->nr_active++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment