Skip to contentSkip to conversation

Export irq tracepoints for use by kernel modules

PATCH In review Drew Richardson 3 participants 6 messages Apr 22, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 kernel/softirq.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/softirq.c +6 -0
index b50990a5bea0..3a21a6c29406 100644
@@ -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
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 3 lines · Drew Richardson

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?

#2 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Drew Richardson

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

#3 lore raw
Quoted 4 lines · Drew Richardson

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.

#4 lore raw
In reply to Christoph Hellwig
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Drew Richardson

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

#5 lore raw
Quoted 12 lines · Josh Boyer
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Drew Richardson

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.

Quoted 7 lines

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