[lttng-dev] TRACEPOINT_PROVIDER mismatch check in ust-tracepoint-event.h needs -Wsystem-headers
David OShea
David.OShea at quantum.com
Mon Nov 26 03:57:09 EST 2012
Hi Mathieu,
Thanks for the response and apologies for the delay in mine, please see below:
> -----Original Message-----
> From: Mathieu Desnoyers [mailto:mathieu.desnoyers at efficios.com]
> Sent: Tuesday, 20 November 2012 2:56 AM
> To: David OShea
> Cc: lttng-dev at lists.lttng.org
> Subject: Re: [lttng-dev] TRACEPOINT_PROVIDER mismatch check in ust-
> tracepoint-event.h needs -Wsystem-headers
[...]
> > I'm not sure if there is any way you could "fix" this so that
> > -Wsystem-headers isn't required, but perhaps it would at least be
> > worth documenting that this flag could be used - but perhaps not
> > recommend it - to enable those checks to occur.
>
> I have not found any way to show those warnings from UST system headers
> without -Wsystem-headers. We have the following scenario:
>
> probe C file
> -> includes ust probe description file
> -> includes tracepoint-event.h (system header)
> -> includes ust probe description file
> -> includes ust-tracepoint-event.h (system header) [1]
> For each stage:
> -> undef/define macros
> -> includes ust probe description file
>
> Since the actual functions are created by the compiler in the scope of
> ust-tracepoint-event.h [1] (a system header), the warnings are
> inhibited
> unless we specify -Wsystem-headers.
[...]
> So I guess documenting this would be the right way to do it, unless
> anyone has a better idea ?
I don't know much about the macros in ust-tracepoint-event.h, so this might not make any sense, but could you have the __tracepoint_provider_check_##TRACEPOINT_PROVIDER() function actually get called from the __lttng_events_init__##TRACEPOINT_PROVIDER() (constructor) function? I assume this would mean you'd get link-time errors if you have a provider name mismatch. It would also mean a lot of useless calls to empty functions at startup, but I assume that really shouldn't take too long. Perhaps this checking could be a compile-time option, so that if you're concerned about the startup time impact you can disable it, or perhaps the functions could be marked as inline?
Thanks,
David
----------------------------------------------------------------------
The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt.
More information about the lttng-dev
mailing list