All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 --resend] perf: update shadow timestamp before add event
@ 2015-02-05 23:55 Shaohua Li
  2015-02-05 23:55 ` [PATCH 2/2 --resend] perf: update userspace page info for software event Shaohua Li
  2015-02-18 17:13 ` [tip:perf/core] perf: Update shadow timestamp before add event tip-bot for Shaohua Li
  0 siblings, 2 replies; 5+ messages in thread
From: Shaohua Li @ 2015-02-05 23:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Arnaldo Carvalho de Melo, Frederic Weisbecker, Paul Mackerras,
	Peter Zijlstra, Andy Lutomirski, Ingo Molnar

Last post appears lost, so I repost to check if there are any comments.

Update the shadow timestamp before start event. .add might use the
timestamp.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Shaohua Li <shli@fb.com>
---
 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 19efcf1..04d8b48 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1769,6 +1769,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;
@@ -1776,10 +1780,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++;
 	ctx->nr_active++;
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-02-18 17:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 23:55 [PATCH 1/2 --resend] perf: update shadow timestamp before add event Shaohua Li
2015-02-05 23:55 ` [PATCH 2/2 --resend] perf: update userspace page info for software event Shaohua Li
2015-02-11 11:15   ` Peter Zijlstra
2015-02-18 17:13   ` [tip:perf/core] perf: Update " tip-bot for Shaohua Li
2015-02-18 17:13 ` [tip:perf/core] perf: Update shadow timestamp before add event tip-bot for Shaohua Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.