Re: [PATCH 2/2] trace_events: fix the include file dependencies

From: Frederic Weisbecker
Date: Tue Aug 25 2009 - 17:35:48 EST


On Tue, Aug 25, 2009 at 02:06:22PM +0800, Xiao Guangrong wrote:
> The TRACE_EVENT depend on the include/linux/tracepoint.h first
> and include/trace/ftrace.h later, if we include the ftrace.h early,
> It'll occur building error, like blow:
>
> Both define TRACE_EVENT in trace_a.h and trace_b.h, if we include
> those in .c file, like this:
>
> #define CREATE_TRACE_POINTS
> include <trace/events/trace_a.h>
> include <trace/events/trace_b.h>
>
> There are can't work, because the TRACE_EVENT has re-defined by
> the previous .h file
>
> Reported-by: Wei Yongjun <yjwei@xxxxxxxxxxxxxx>
> Signed-off-by: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxx>



I'll queue it for .32 and handle the missing comment, thanks!


> ---
> include/linux/tracepoint.h | 3 +--
> include/trace/define_trace.h | 1 +
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
> index 5984ed0..8170985 100644
> --- a/include/linux/tracepoint.h
> +++ b/include/linux/tracepoint.h
> @@ -180,6 +180,7 @@ static inline void tracepoint_synchronize_unregister(void)
> }
>
> #define PARAMS(args...) args
> +#endif
>
> #ifndef TRACE_EVENT
> /*
> @@ -287,5 +288,3 @@ static inline void tracepoint_synchronize_unregister(void)
> #define TRACE_EVENT(name, proto, args, struct, assign, print) \
> DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
> #endif
> -
> -#endif
> diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
> index 76e93bf..202cecd 100644
> --- a/include/trace/define_trace.h
> +++ b/include/trace/define_trace.h
> @@ -52,6 +52,7 @@
> #include <trace/ftrace.h>
> #endif
>
> +#undef TRACE_EVENT
> #undef TRACE_HEADER_MULTI_READ
>
> /* Only undef what we defined in this file */
> --
> 1.6.1.2
>
>

--
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/