Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753927AbbBRROK (ORCPT ); Wed, 18 Feb 2015 12:14:10 -0500 Received: from terminus.zytor.com ([198.137.202.10]:39344 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134AbbBRROH (ORCPT ); Wed, 18 Feb 2015 12:14:07 -0500 Date: Wed, 18 Feb 2015 09:13:06 -0800 From: tip-bot for Shaohua Li Message-ID: Cc: mingo@kernel.org, luto@amacapital.net, acme@kernel.org, acme@redhat.com, torvalds@linux-foundation.org, fweisbec@gmail.com, peterz@infradead.org, shli@fb.com, linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com, tglx@linutronix.de Reply-To: torvalds@linux-foundation.org, acme@redhat.com, acme@kernel.org, luto@amacapital.net, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org, shli@fb.com, peterz@infradead.org, fweisbec@gmail.com In-Reply-To: <9cd0276d6a047cb7c2885994f25e3a1f7c8c28af.1423180257.git.shli@fb.com> References: <9cd0276d6a047cb7c2885994f25e3a1f7c8c28af.1423180257.git.shli@fb.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf: Update shadow timestamp before add event Git-Commit-ID: 72f669c0086fbbbbebc92ce7390125722c4c0ec5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2022 Lines: 57 Commit-ID: 72f669c0086fbbbbebc92ce7390125722c4c0ec5 Gitweb: http://git.kernel.org/tip/72f669c0086fbbbbebc92ce7390125722c4c0ec5 Author: Shaohua Li AuthorDate: Thu, 5 Feb 2015 15:55:31 -0800 Committer: Ingo Molnar CommitDate: Wed, 18 Feb 2015 17:01:44 +0100 perf: Update shadow timestamp before add event Update the shadow timestamp before start event, because .add might use the timestamp. Signed-off-by: Shaohua Li Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker Cc: Linus Torvalds Cc: Paul Mackerras Link: http://lkml.kernel.org/r/9cd0276d6a047cb7c2885994f25e3a1f7c8c28af.1423180257.git.shli@fb.com Signed-off-by: Ingo Molnar --- kernel/events/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 13209a9..e580e0f 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -1881,6 +1881,10 @@ event_sched_in(struct perf_event *event, 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)) { event->state = PERF_EVENT_STATE_INACTIVE; event->oncpu = -1; @@ -1888,10 +1892,6 @@ event_sched_in(struct perf_event *event, goto out; } - event->tstamp_running += tstamp - event->tstamp_stopped; - - perf_set_shadow_time(event, ctx, tstamp); - if (!is_software_event(event)) cpuctx->active_oncpu++; if (!ctx->nr_active++) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/