lkml.org 
[lkml]   [2017]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 2/5] sched/events: Introduce cfs_rq load tracking trace event
On Tue, 28 Mar 2017 18:44:59 +0200
Peter Zijlstra <peterz@infradead.org> 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 <dietmar.eggemann@arm.com> 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

\
 
 \ /
  Last update: 2017-03-28 19:39    [W:0.116 / U:3.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site