[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0902191308000.30122@gandalf.stny.rr.com>
Date: Thu, 19 Feb 2009 13:08:37 -0500 (EST)
From: Steven Rostedt <rostedt@...dmis.org>
To: Ingo Molnar <mingo@...e.hu>
cc: LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Frédéric Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH][git pull] tracing: limit the number of loops the ring
buffer self test can make
On Thu, 19 Feb 2009, Ingo Molnar wrote:
>
> * Steven Rostedt <rostedt@...dmis.org> wrote:
>
> > Ingo,
> >
> > I added one more fix. Thinking about the solution, although
> > the disabling of the ring buffer is good enough to prevent the
> > bug you hit. I became worried about a corrupted ring buffer
> > that can cause an inifinite loop. This patch adds a fix for
> > that too.
>
> yes, that's a good idea too:
>
> > @@ -23,10 +23,20 @@ static int trace_test_buffer_cpu(struct trace_array *tr, int cpu)
> > {
> > struct ring_buffer_event *event;
> > struct trace_entry *entry;
> > + unsigned int loops = 0;
> >
> > while ((event = ring_buffer_consume(tr->buffer, cpu, NULL))) {
> > entry = ring_buffer_event_data(event);
> >
> > + /*
> > + * The ring buffer is a size of trace_buf_size, if
> > + * we loop more than the size, there's something wrong
> > + * with the ring buffer.
> > + */
> > + if (loops++ > trace_buf_size) {
> > + printk(KERN_CONT ".. bad ring buffer ");
> > + goto failed;
> > + }
>
> Would be nice to also emit a WARN_ONCE() message about the test
> failure, to make sure automated tests like mine pick even
> soft-failures up.
I could put a warn on in the register_tracer code. It checks all self
tests there, and if one fails, it disables that tracer.
-- Steve
--
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