lkml.org 
[lkml]   [2013]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@infradead.org> wrote:
>
> > Subject: ftrace, sched: Add TRACE_FLAG_PREEMPT_RESCHED
> > From: Peter Zijlstra <peterz@infradead.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.


\
 
 \ /
  Last update: 2013-11-06 19:41    [W:0.400 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site