Re: how to handle tracing .h loops

From: Steven Rostedt
Date: Thu Aug 18 2011 - 09:25:09 EST


On Thu, 2011-08-18 at 12:57 +0100, Ian Campbell wrote:
> On Thu, 2011-08-18 at 12:51 +0100, Ian Campbell wrote:
> > Clearly other places are including interrupt.h and highmem.h without
> > issue so what am I doing wrong here?
>
> I guess I should have look at the .c file instead of concentrating on
> the .h's because this works:
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 7b996ed..3f5ee74 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -29,6 +29,7 @@
> #include <linux/rcupdate.h>
> #include <linux/dmaengine.h>
> #include <linux/hrtimer.h>
> +#include <linux/highmem.h>
>
> /* Don't change this without changing skb_csum_unnecessary! */
> #define CHECKSUM_NONE 0
> diff --git a/kernel/signal.c b/kernel/signal.c
> index 291c970..ff432ec 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -30,6 +30,7 @@
> #include <linux/nsproxy.h>
> #define CREATE_TRACE_POINTS
> #include <trace/events/signal.h>
> +#undef CREATE_TRACE_POINTS

I think the better solution is to move this down below the asms. But as
this does work, I'm don't have any big preference against it.

>
> #include <asm/param.h>
> #include <asm/uaccess.h>
>
>
> But that seems odd (noone else does it). Perhaps I should instead move
> that include to last in the file? i.e.:
>
> diff --git a/kernel/signal.c b/kernel/signal.c
> index 291c970..d3cd4e7 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -28,8 +28,6 @@
> #include <linux/freezer.h>
> #include <linux/pid_namespace.h>
> #include <linux/nsproxy.h>
> -#define CREATE_TRACE_POINTS
> -#include <trace/events/signal.h>
>
> #include <asm/param.h>
> #include <asm/uaccess.h>
> @@ -37,6 +35,9 @@
> #include <asm/siginfo.h>
> #include "audit.h" /* audit_signal_info() */
>
> +#define CREATE_TRACE_POINTS
> +#include <trace/events/signal.h>
> +

Yes, the trace events headers are suppose to be the last headers
included.

Either method works. Either undefine CREATE_TRACE_POINTS or move the
headers down. Only the C file should be depending on the header anyway.

Thanks!

-- Steve

> /*
> * SLAB caches for signal bits.
> */
>
> Ian.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/