Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754561AbdC1Rge (ORCPT ); Tue, 28 Mar 2017 13:36:34 -0400 Received: from mail.kernel.org ([198.145.29.136]:58346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752258AbdC1Rgc (ORCPT ); Tue, 28 Mar 2017 13:36:32 -0400 Date: Tue, 28 Mar 2017 13:36:26 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Dietmar Eggemann , Ingo Molnar , LKML , Matt Fleming , Vincent Guittot , Morten Rasmussen , Juri Lelli , Patrick Bellasi Subject: Re: [RFC PATCH 2/5] sched/events: Introduce cfs_rq load tracking trace event Message-ID: <20170328133626.5632da53@gandalf.local.home> In-Reply-To: <20170328164459.tkiqbtb7yaplygng@hirez.programming.kicks-ass.net> References: <20170328063541.12912-1-dietmar.eggemann@arm.com> <20170328063541.12912-3-dietmar.eggemann@arm.com> <20170328104600.18d36cb0@gandalf.local.home> <20170328164459.tkiqbtb7yaplygng@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1249 Lines: 35 On Tue, 28 Mar 2017 18:44:59 +0200 Peter Zijlstra wrote: > On Tue, Mar 28, 2017 at 10:46:00AM -0400, Steven Rostedt wrote: > > On Tue, 28 Mar 2017 07:35:38 +0100 > > Dietmar Eggemann wrote: > > > > > /* This part must be outside protection */ > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > > index 03adf9fb48b1..ac19ab6ced8f 100644 > > > --- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -2950,6 +2950,9 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa, > > > sa->util_avg = sa->util_sum / LOAD_AVG_MAX; > > > } > > > > > > + if (cfs_rq) > > > + trace_sched_load_cfs_rq(cfs_rq); > > > + > > > > Please use TRACE_EVENT_CONDITION(), and test for cfs_rq not NULL. > > I too suggested that; but then I looked again at that code and we can > actually do this. cfs_rq can be constant propagated and the if > determined at build time. > > Its not immediately obvious from the current code; but if we do > something like the below, it should be clearer. > But why play games, and rely on the design of the code? A TRACE_EVENT_CONDTION() is more robust and documents that this tracepoint should not be called when cfs_rq is NULL. -- Steve