[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140114215655.666d7480@gandalf.local.home>
Date: Tue, 14 Jan 2014 21:56:55 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Frederic Weisbecker <fweisbec@...il.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung.kim@....com>,
LKML <linux-kernel@...r.kernel.org>, Jiri Olsa <jolsa@...hat.com>
Subject: Re: [PATCH 01/17] tools lib traceevent: Add state member to struct
trace_seq
On Wed, 15 Jan 2014 11:49:28 +0900
Namhyung Kim <namhyung@...nel.org> wrote:
> Hi Steve,
>
> On Tue, 14 Jan 2014 21:00:58 -0500, Steven Rostedt wrote:
> > On Wed, 15 Jan 2014 10:45:24 +0900
> > Namhyung Kim <namhyung@...nel.org> wrote:
> >
> >>
> >> @@ -32,8 +33,9 @@
> >> #define TRACE_SEQ_POISON ((void *)0xdeadbeef)
> >> #define TRACE_SEQ_CHECK(s) \
> >> do { \
> >> - if ((s)->buffer == TRACE_SEQ_POISON) \
> >> - die("Usage of trace_seq after it was destroyed"); \
> >> + if (WARN_ONCE((s)->buffer == TRACE_SEQ_POISON, \
> >> + "Usage of trace_seq after it was destroyed")) \
> >> + (s)->state = TRACE_SEQ__BUFFER_POISONED; \
> >> } while (0)
> >>
> >> @@ -189,9 +205,15 @@ int trace_seq_putc(struct trace_seq *s, unsigned char c)
> >> {
> >> TRACE_SEQ_CHECK(s);
> >>
> >> + if (s->state != TRACE_SEQ__GOOD)
> >> + return 0;
> >> +
> >
> > Instead of adding all of these, we can extend the macro
> > TRACE_SEQ_CHECK() which does a
> > if (s->state != TRACE_SEQ__GOOD)
> > return;
> >
> > and a TRACE_SEQ_CHECK_RET() that does a return 0;
>
> Oh, it looks better. But I'd like to TRACE_SEQ_CHECK() as is for some
> cases. How about this?
>
>
Looks good to me.
Acked-by: Steven Rostedt <rostedt@...dmis.org>
I'll try to look at the rest of the patches tomorrow.
-- 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