From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752465AbbFHGzs (ORCPT ); Mon, 8 Jun 2015 02:55:48 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:40926 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751731AbbFHGzl convert rfc822-to-8bit (ORCPT ); Mon, 8 Jun 2015 02:55:41 -0400 Message-ID: <1433746530.1495.28.camel@twins> Subject: Re: [RFC PATCH] sched: Fix sched_wakeup tracepoint From: Peter Zijlstra To: Mathieu Desnoyers Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , rostedt , Francis Giraldeau Date: Mon, 08 Jun 2015 08:55:30 +0200 In-Reply-To: <600031664.4911.1433510581646.JavaMail.zimbra@efficios.com> References: <1433504509-17013-1-git-send-email-mathieu.desnoyers@efficios.com> <20150605120909.GG19282@twins.programming.kicks-ass.net> <479621151.4836.1433507522491.JavaMail.zimbra@efficios.com> <1433508695.1495.16.camel@twins> <600031664.4911.1433510581646.JavaMail.zimbra@efficios.com> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-06-05 at 13:23 +0000, Mathieu Desnoyers wrote: > sched_wakeup: when try_to_wake_up{,_local} is called in the waker. > sched_activate_task: when the wakee is marked runnable. > sched_switch: when scheduling actually happens. > > We can then calculate wakeup latency as > > time@sched_activate - time@sched_wakeup One more thing, I think I would disagree with this. I would suggest never to use the 'wakeup' (or 'waking' in my proposal) for timing. I would suggest to use your interrupt tracepoint (or whatever else causes wakeup to be called for this). The wakeup times should be measured in tasktime -- of course, if interrupts/preemption are disabled then tasktime == walltime. The scheduling bit OTOH always needs to be measured in walltime, and is most affected by the presence of other tasks on the system. This too is why I'm not sure it makes sense to combine the two into a single measurement. They should be measured in different time domains.