Re: [PATCH 1/2] tracepoints: Add helper to test if tracepoint is enabled in a header

From: Mathieu Desnoyers
Date: Thu Sep 24 2020 - 16:25:43 EST


----- On Sep 24, 2020, at 3:40 PM, rostedt rostedt@xxxxxxxxxxx wrote:

> On Thu, 24 Sep 2020 15:35:17 -0400
> Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
>> > I'm ok with tracepoint_enabled(). However, I would have placed it in
>> > tracepoint.h rather than tracepoint-defs.h, and we should figure out
>> > why people complain that tracepoint.h is including headers too
>> > eagerly.
>>
>> I could see if it would work in tracepoints.h.
>>
>> It might. I was just being extra cautious.
>
> Well that blew up quick!
>
> Try using tracepoint.h in include/linux/page_ref.h and
> arch/x86/include/asm/msr.h and see what happens.

Indeed, msr.h is an issue. So having tracepoint_enabled() in
include/linux/tracepoints-defs.h and going through a function
would make sense for this kind of core use-case I guess.

I tried including tracepoint.h from include/linux/page_ref.h
and did not notice any compile issue. Am I missing something
to trigger an issue related to that scenario ?

Thanks,

Mathieu

--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com