2014-04-22 14:24:24

by Drew Richardson

[permalink] [raw]
Subject: [PATCH] Export irq tracepoints for use by kernel modules

After commit de7b2973903c6cc50b31ee5682a69b2219b9919d ("tracepoint:
Use struct pointer instead of name hash for reg/unreg tracepoints"),
any tracepoints used in a kernel module must be exported.

Signed-off-by: Drew Richardson <[email protected]>
Acked-by: Pawel Moll <[email protected]>
---
kernel/softirq.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index b50990a5bea0..3a21a6c29406 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -30,6 +30,12 @@
#define CREATE_TRACE_POINTS
#include <trace/events/irq.h>

+EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_entry);
+EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_exit);
+EXPORT_TRACEPOINT_SYMBOL_GPL(softirq_entry);
+EXPORT_TRACEPOINT_SYMBOL_GPL(softirq_exit);
+EXPORT_TRACEPOINT_SYMBOL_GPL(softirq_raise);
+
/*
- No shared variables, all the data are CPU local.
- If a softirq needs serialization, let it serialize itself
--
1.8.3.2


2014-04-22 14:26:40

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] Export irq tracepoints for use by kernel modules

On Tue, Apr 22, 2014 at 07:24:20AM -0700, Drew Richardson wrote:
> After commit de7b2973903c6cc50b31ee5682a69b2219b9919d ("tracepoint:
> Use struct pointer instead of name hash for reg/unreg tracepoints"),
> any tracepoints used in a kernel module must be exported.

How does this matter given that there aren't any modular users?

2014-04-22 15:00:40

by Drew Richardson

[permalink] [raw]
Subject: Re: [PATCH] Export irq tracepoints for use by kernel modules

On Tue, Apr 22, 2014 at 03:26:13PM +0100, Christoph Hellwig wrote:
> On Tue, Apr 22, 2014 at 07:24:20AM -0700, Drew Richardson wrote:
> > After commit de7b2973903c6cc50b31ee5682a69b2219b9919d ("tracepoint:
> > Use struct pointer instead of name hash for reg/unreg tracepoints"),
> > any tracepoints used in a kernel module must be exported.
>
> How does this matter given that there aren't any modular users?

Gator (http://git.linaro.org/arm/ds5/gator.git), an out of tree kernel
module, uses irq_handler_exit and softirq_exit. I thought it would be
helpful to export the other tracepoints from trace/events/irq.h in
case other users encountered a similar issue.

Drew

2014-04-22 15:01:09

by Josh Boyer

[permalink] [raw]
Subject: Re: [PATCH] Export irq tracepoints for use by kernel modules

On Tue, Apr 22, 2014 at 10:26 AM, Christoph Hellwig <[email protected]> wrote:
> On Tue, Apr 22, 2014 at 07:24:20AM -0700, Drew Richardson wrote:
>> After commit de7b2973903c6cc50b31ee5682a69b2219b9919d ("tracepoint:
>> Use struct pointer instead of name hash for reg/unreg tracepoints"),
>> any tracepoints used in a kernel module must be exported.
>
> How does this matter given that there aren't any modular users?

We had a bug report about this breaking systemtap type usage[1]. In
there, Matthieu suggested that the new for_each_kernel_tracepoint
interface be used.

Drew, it would have been proper to CC the author of the change you're
referencing on all of your patches to export these symbols.

josh

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1087623

2014-04-22 15:04:15

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] Export irq tracepoints for use by kernel modules

On Tue, Apr 22, 2014 at 08:00:31AM -0700, Drew Richardson wrote:
> Gator (http://git.linaro.org/arm/ds5/gator.git), an out of tree kernel
> module, uses irq_handler_exit and softirq_exit. I thought it would be
> helpful to export the other tracepoints from trace/events/irq.h in
> case other users encountered a similar issue.

None of them should be exported unless we have in-tree modular users.
And I don't think adding modular users for either of them is a good idea
to start with.

2014-04-22 17:39:08

by Drew Richardson

[permalink] [raw]
Subject: Re: [PATCH] Export irq tracepoints for use by kernel modules

On Tue, Apr 22, 2014 at 04:01:03PM +0100, Josh Boyer wrote:
> On Tue, Apr 22, 2014 at 10:26 AM, Christoph Hellwig <[email protected]> wrote:
> > On Tue, Apr 22, 2014 at 07:24:20AM -0700, Drew Richardson wrote:
> >> After commit de7b2973903c6cc50b31ee5682a69b2219b9919d ("tracepoint:
> >> Use struct pointer instead of name hash for reg/unreg tracepoints"),
> >> any tracepoints used in a kernel module must be exported.
> >
> > How does this matter given that there aren't any modular users?
>
> We had a bug report about this breaking systemtap type usage[1]. In
> there, Matthieu suggested that the new for_each_kernel_tracepoint
> interface be used.
>
> Drew, it would have been proper to CC the author of the change you're
> referencing on all of your patches to export these symbols.
>
> josh
>
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1087623
>

Thanks Josh for pointing out that I should CC Mathieu and
register_tracepoint_module_notifier, which will work for me.

Drew