[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130902133345.1cddd3f1@gandalf.local.home>
Date: Mon, 2 Sep 2013 13:33:45 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Zoltan Kiss <zoltan.kiss@...rix.com>
Cc: Rob Landley <rob@...dley.net>, Jiri Kosina <jkosina@...e.cz>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Paul Bolle <pebolle@...cali.nl>, <linux-doc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Documentation/trace: Correcting and extending
tracepoint documentation
On Mon, 2 Sep 2013 18:02:47 +0100
Zoltan Kiss <zoltan.kiss@...rix.com> wrote:
> > Why? (Both why do you need to #include a header outside a multiple
> > inclusion guard, and why is the additional header needed at all in
> > _every_ subsystem trace header?)
> I see only one inclusion guard here, the one above. define_trace.h
> should take effect at only one place, where CREATE_TRACE_POINTS is
> defined, to create the tracepoints exactly once. However I don't see as
> well why it should be outside protection. Maybe because the intentional
> header reinclusion in it?
Because if it was inside the protection you can miss the
CREATE_TRACE_POINTS define. These headers can be included by other
headers (although they probably shouldn't be). But that's the point of
the protection isn't it? In case multiple headers include the file?
Anyway, lets say the header was include earlier, thus you can have this:
#include <trace/foo.h> // include by another header
#define CREATE_TRACE_POINTS
#include <trace/foo.h>
Now if the include of define_trace.h was inside the protection, it will
not get included again, and no trace points would be created.
-- 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