* [PATCH] tracing: always define trace_{irq,preempt}_{enable_disable}
@ 2017-10-19 8:32 Arnd Bergmann
2017-10-19 15:42 ` Joel Fernandes
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Arnd Bergmann @ 2017-10-19 8:32 UTC (permalink / raw)
To: Steven Rostedt, Ingo Molnar; +Cc: Arnd Bergmann, Joel Fernandes, linux-kernel
We get a build error in the irqsoff tracer in some configurations:
kernel/trace/trace_irqsoff.c: In function 'trace_preempt_on':
kernel/trace/trace_irqsoff.c:855:2: error: implicit declaration of function 'trace_preempt_enable_rcuidle'; did you mean 'trace_irq_enable_rcuidle'? [-Werror=implicit-function-declaration]
trace_preempt_enable_rcuidle(a0, a1);
The problem is that trace_preempt_enable_rcuidle() has different
definition based on multiple Kconfig symbols, but not all combinations
have a valid definition.
This changes the conditions so that we always get exactly one
definition of each of the four tracing macros. I have not tried
to verify that these definitions are sensible, but now we
can build all randconfig combinations again.
Fixes: d59158162e03 ("tracing: Add support for preempt and irq enable/disable events")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/trace/events/preemptirq.h | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/include/trace/events/preemptirq.h b/include/trace/events/preemptirq.h
index f5024c560d8f..9c4eb33c5a1d 100644
--- a/include/trace/events/preemptirq.h
+++ b/include/trace/events/preemptirq.h
@@ -56,15 +56,18 @@ DEFINE_EVENT(preemptirq_template, preempt_enable,
#include <trace/define_trace.h>
-#else /* !CONFIG_PREEMPTIRQ_EVENTS */
+#endif /* !CONFIG_PREEMPTIRQ_EVENTS */
+#if !defined(CONFIG_PREEMPTIRQ_EVENTS) || defined(CONFIG_PROVE_LOCKING)
#define trace_irq_enable(...)
#define trace_irq_disable(...)
-#define trace_preempt_enable(...)
-#define trace_preempt_disable(...)
#define trace_irq_enable_rcuidle(...)
#define trace_irq_disable_rcuidle(...)
+#endif
+
+#if !defined(CONFIG_PREEMPTIRQ_EVENTS) || !defined(CONFIG_DEBUG_PREEMPT)
+#define trace_preempt_enable(...)
+#define trace_preempt_disable(...)
#define trace_preempt_enable_rcuidle(...)
#define trace_preempt_disable_rcuidle(...)
-
#endif
--
2.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing: always define trace_{irq,preempt}_{enable_disable}
2017-10-19 8:32 [PATCH] tracing: always define trace_{irq,preempt}_{enable_disable} Arnd Bergmann
@ 2017-10-19 15:42 ` Joel Fernandes
2017-10-19 16:04 ` Arnd Bergmann
2017-10-19 18:42 ` Joel Fernandes
2017-10-31 14:13 ` Steven Rostedt
2 siblings, 1 reply; 5+ messages in thread
From: Joel Fernandes @ 2017-10-19 15:42 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Steven Rostedt, Ingo Molnar, LKML
Hi Arnd,
On Thu, Oct 19, 2017 at 1:32 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> We get a build error in the irqsoff tracer in some configurations:
>
> kernel/trace/trace_irqsoff.c: In function 'trace_preempt_on':
> kernel/trace/trace_irqsoff.c:855:2: error: implicit declaration of function 'trace_preempt_enable_rcuidle'; did you mean 'trace_irq_enable_rcuidle'? [-Werror=implicit-function-declaration]
> trace_preempt_enable_rcuidle(a0, a1);
>
> The problem is that trace_preempt_enable_rcuidle() has different
> definition based on multiple Kconfig symbols, but not all combinations
> have a valid definition.
>
> This changes the conditions so that we always get exactly one
> definition of each of the four tracing macros. I have not tried
> to verify that these definitions are sensible, but now we
> can build all randconfig combinations again.
>
Thanks for catching this. I didn't follow why it breaks for you,
especially I'm troubled by your proposal of defining the empty macro
for !defined(CONFIG_DEBUG_PREEMPT) in your patch. Could you provide
your config sample and architecture you're building for? I'm guessing
its ARM but let me know. I will try to build it and reproduce it.
thanks,
Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing: always define trace_{irq,preempt}_{enable_disable}
2017-10-19 15:42 ` Joel Fernandes
@ 2017-10-19 16:04 ` Arnd Bergmann
0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2017-10-19 16:04 UTC (permalink / raw)
To: Joel Fernandes; +Cc: Steven Rostedt, Ingo Molnar, LKML
On Thu, Oct 19, 2017 at 5:42 PM, Joel Fernandes <joelaf@google.com> wrote:
> Hi Arnd,
>
> On Thu, Oct 19, 2017 at 1:32 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> We get a build error in the irqsoff tracer in some configurations:
>>
>> kernel/trace/trace_irqsoff.c: In function 'trace_preempt_on':
>> kernel/trace/trace_irqsoff.c:855:2: error: implicit declaration of function 'trace_preempt_enable_rcuidle'; did you mean 'trace_irq_enable_rcuidle'? [-Werror=implicit-function-declaration]
>> trace_preempt_enable_rcuidle(a0, a1);
>>
>> The problem is that trace_preempt_enable_rcuidle() has different
>> definition based on multiple Kconfig symbols, but not all combinations
>> have a valid definition.
>>
>> This changes the conditions so that we always get exactly one
>> definition of each of the four tracing macros. I have not tried
>> to verify that these definitions are sensible, but now we
>> can build all randconfig combinations again.
>>
>
> Thanks for catching this. I didn't follow why it breaks for you,
> especially I'm troubled by your proposal of defining the empty macro
> for !defined(CONFIG_DEBUG_PREEMPT) in your patch. Could you provide
> your config sample and architecture you're building for? I'm guessing
> its ARM but let me know. I will try to build it and reproduce it.
I ran into it during an arm64 randconfig build, uploaded the config file to
https://pastebin.com/s5AiqXTM
Arnd
> thanks,
> Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing: always define trace_{irq,preempt}_{enable_disable}
2017-10-19 8:32 [PATCH] tracing: always define trace_{irq,preempt}_{enable_disable} Arnd Bergmann
2017-10-19 15:42 ` Joel Fernandes
@ 2017-10-19 18:42 ` Joel Fernandes
2017-10-31 14:13 ` Steven Rostedt
2 siblings, 0 replies; 5+ messages in thread
From: Joel Fernandes @ 2017-10-19 18:42 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Steven Rostedt, Ingo Molnar, LKML
Hi,
On Thu, Oct 19, 2017 at 1:32 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> We get a build error in the irqsoff tracer in some configurations:
>
> kernel/trace/trace_irqsoff.c: In function 'trace_preempt_on':
> kernel/trace/trace_irqsoff.c:855:2: error: implicit declaration of function 'trace_preempt_enable_rcuidle'; did you mean 'trace_irq_enable_rcuidle'? [-Werror=implicit-function-declaration]
> trace_preempt_enable_rcuidle(a0, a1);
>
> The problem is that trace_preempt_enable_rcuidle() has different
> definition based on multiple Kconfig symbols, but not all combinations
> have a valid definition.
>
> This changes the conditions so that we always get exactly one
> definition of each of the four tracing macros. I have not tried
> to verify that these definitions are sensible, but now we
> can build all randconfig combinations again.
>
> Fixes: d59158162e03 ("tracing: Add support for preempt and irq enable/disable events")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Yes this build condition is possible. Thanks for finding it. I agree
with this patch, I will be simplifying this much more once I integrate
PROVE_LOCKING to use tracepoint probes but this is Ok with me for now.
Acked-by: Joel Fernandes <joelaf@google.com>
thanks!
- Joel
<snip>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tracing: always define trace_{irq,preempt}_{enable_disable}
2017-10-19 8:32 [PATCH] tracing: always define trace_{irq,preempt}_{enable_disable} Arnd Bergmann
2017-10-19 15:42 ` Joel Fernandes
2017-10-19 18:42 ` Joel Fernandes
@ 2017-10-31 14:13 ` Steven Rostedt
2 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2017-10-31 14:13 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Ingo Molnar, Joel Fernandes, linux-kernel
On Thu, 19 Oct 2017 10:32:13 +0200
Arnd Bergmann <arnd@arndb.de> wrote:
> We get a build error in the irqsoff tracer in some configurations:
>
> kernel/trace/trace_irqsoff.c: In function 'trace_preempt_on':
> kernel/trace/trace_irqsoff.c:855:2: error: implicit declaration of function 'trace_preempt_enable_rcuidle'; did you mean 'trace_irq_enable_rcuidle'? [-Werror=implicit-function-declaration]
> trace_preempt_enable_rcuidle(a0, a1);
>
> The problem is that trace_preempt_enable_rcuidle() has different
> definition based on multiple Kconfig symbols, but not all combinations
> have a valid definition.
>
> This changes the conditions so that we always get exactly one
> definition of each of the four tracing macros. I have not tried
> to verify that these definitions are sensible, but now we
> can build all randconfig combinations again.
>
> Fixes: d59158162e03 ("tracing: Add support for preempt and irq enable/disable events")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied. Thanks Arnd.
-- Steve
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-10-31 14:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 8:32 [PATCH] tracing: always define trace_{irq,preempt}_{enable_disable} Arnd Bergmann
2017-10-19 15:42 ` Joel Fernandes
2017-10-19 16:04 ` Arnd Bergmann
2017-10-19 18:42 ` Joel Fernandes
2017-10-31 14:13 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).