diff mbox

Export irq tracepoints for use by kernel modules

Message ID 20140422142419.GD21121@dreric01-Precision-T1600
State New
Headers show

Commit Message

Drew Richardson April 22, 2014, 2:24 p.m. UTC
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 <drew.richardson@arm.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
---
 kernel/softirq.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

'Christoph Hellwig' April 22, 2014, 2:26 p.m. UTC | #1
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?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Drew Richardson April 22, 2014, 3 p.m. UTC | #2
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Josh Boyer April 22, 2014, 3:01 p.m. UTC | #3
On Tue, Apr 22, 2014 at 10:26 AM, Christoph Hellwig <hch@infradead.org> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
'Christoph Hellwig' April 22, 2014, 3:03 p.m. UTC | #4
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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Drew Richardson April 22, 2014, 5:38 p.m. UTC | #5
On Tue, Apr 22, 2014 at 04:01:03PM +0100, Josh Boyer wrote:
> On Tue, Apr 22, 2014 at 10:26 AM, Christoph Hellwig <hch@infradead.org> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

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