[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131106164525.GF16117@laptop.programming.kicks-ass.net>
Date: Wed, 6 Nov 2013 17:45:25 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Yuanhan Liu <yuanhan.liu@...ux.intel.com>, mingo@...nel.org,
hpa@...or.com, linux-kernel@...r.kernel.org, tglx@...utronix.de,
linux-tip-commits@...r.kernel.org,
Fengguang Wu <fengguang.wu@...el.com>,
Huang Ying <ying.huang@...el.com>, lkp@...ux.intel.com
Subject: Re: [PATCH] ftrace, sched: Add TRACE_FLAG_PREEMPT_RESCHED
On Wed, Nov 06, 2013 at 11:37:04AM -0500, Steven Rostedt wrote:
> On Fri, 27 Sep 2013 17:29:08 +0200
> Peter Zijlstra <peterz@...radead.org> wrote:
>
> > Subject: ftrace, sched: Add TRACE_FLAG_PREEMPT_RESCHED
> > From: Peter Zijlstra <peterz@...radead.org>
> > Date: Fri Sep 27 17:11:00 CEST 2013
> >
> > Since we now have two need_resched states; trace the two so we can
> > observe discrepancies.
>
> I see this is dependent on the addition of tif_need_resched() and
> friends.
This also wasn't the last version of the patch, I distinctly remember
you making me update some documentation crap.
> > +
> > + if ((entry->flags & TRACE_FLAG_NEED_RESCHED) &&
> > + (entry->flags & TRACE_FLAG_PREEMPT_RESCHED))
> > + need_resched = 'N';
> > + else if (entry->flags & TRACE_FLAG_NEED_RESCHED)
> > + need_resched = 'n';
> > + else if (entry->flags & TRACE_FLAG_PREEMPT_RESCHED)
> > + need_resched = 'p';
> > + else
> > + need_resched = '.';
>
> Perhaps we should make this a switch statement?
>
> switch (entry->flags & (TRACE_FLAG_NEED_RESCHED |
> TRACE_FLAG_PREEMPT_RESCHED)) {
> case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_PREEMPT_RESCHED:
> need_resched = 'N';
> break;
> case TRACE_FLAG_NEED_RESCHED:
> need_resched = 'n';
> break;
> case TRACE_FLAG_PREEMPT_RESCHED:
> need_resched = 'p';
> break;
> default:
> need_resched = '.';
> break;
> }
>
> Simply because I find switch statements easier to read than else if
> statements.
Sure whatever your code ;-), but says he who wrote:
hardsoft_irq =
(hardirq && softirq) ? 'H' :
hardirq ? 'h' :
softirq ? 's' :
'.';
Just apply the later patch and change it however you like.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists