[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1322161216.5366.52.camel@jlt3.sipsolutions.net>
Date: Thu, 24 Nov 2011 20:00:16 +0100
From: Johannes Berg <johannes@...solutions.net>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Christoph Hellwig <hch@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v2] printk: add console output tracing
On Thu, 2011-11-24 at 16:45 +0100, Frederic Weisbecker wrote:
> > I don't really feel comfortable modifying the _call_console_drivers()
> > function to not handle start > end (modulo log buf size of course), but
> > at the same time I don't feel comfortable putting code into it that
> > doesn't handle it.
>
> So, the:
>
> BUG_ON(((int)(start - end)) > 0);
>
> check is there to ensure we haven't wrapped INT_MAX. If we have reached
> that point it definetly means we have a bug because log_buf_len is itself
> an int and we shouldn't overlap INT_MAX.
Ok that makes sense.
> The care on the wrapping that is done in _call_console_drivers() is
> different and concerns log_buf_len itself. If log_buf_len = 8, start = 7
> and end = 9, then you will enter the "((start & LOG_BUF_MASK) > (end & LOG_BUF_MASK))"
> condition that handle the wrap on LOG_BUF_MASK to print the two chars.
> But this is totally different from "start > end" which would mean we have
> a bug.
Oh. So we get end = 9 in that case? That seems confusing ... I would
have expected end = 1 then! Which is the whole reason I got confused I
guess.
> So, in your tracepoint you can safely use "end - start" as a length for your
> dynamic array. But the rest of your tracepoint (all the fast assign part)
> still needs the masks as you did.
Oh, that's all you were trying to say? I can see that, ok. I just didn't
see that end would be 9 instead of 1 and tried to handle that. The
_call_console_drivers() code is a bit different I guess.
I'll send a new version.
johannes
--
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