Bug 96051 - key trace event symbols not exported
Summary: key trace event symbols not exported
Status: RESOLVED WILL_NOT_FIX
Alias: None
Product: Tracing/Profiling
Classification: Unclassified
Component: Ftrace (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Steven Rostedt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-02 16:40 UTC by Ron Rechenmacher
Modified: 2020-01-10 15:47 UTC (History)
0 users

See Also:
Kernel Version: 3.16.1 and there after including 3.19.3
Tree: Mainline
Regression: No


Attachments
patch for 3.19.3 (1.06 KB, patch)
2015-04-06 17:10 UTC, Ron Rechenmacher
Details | Diff
patch for kernel 4.0 (1.06 KB, patch)
2015-04-13 20:22 UTC, Ron Rechenmacher
Details | Diff

Description Ron Rechenmacher 2015-04-02 16:40:19 UTC
In kernel version prior to 3.16.1, I was able build and insert a module that could call the following functions:
register_trace_sched_switch
register_trace_irq_handler_entry
register_trace_irq_handler_exit
register_trace_softirq_entry
register_trace_softirq_exit
register_trace_sys_enter
register_trace_sys_exit

Since 3.16.1, building the module get undefined warnings for:
__tracepoint_softirq_entry
__tracepoint_sys_exit
__tracepoint_sys_enter
__tracepoint_irq_handler_entry
__tracepoint_irq_handler_exit
__tracepoint_softirq_exit
__tracepoint_sched_switch

TO fix this, I had to add EXPORT_TRACEPOINT_SYMBOL_GPL lines to the appropriate files:
--- kernel/irq/handle.c.~1~     2014-08-13 21:36:35.000000000 -0500
+++ kernel/irq/handle.c 2015-04-02 11:16:05.170383927 -0500
@@ -195,3 +195,6 @@
        irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
        return ret;
 }
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_entry);
+EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_exit);
--- kernel/softirq.c.~1~        2014-08-13 21:36:35.000000000 -0500
+++ kernel/softirq.c    2015-04-02 11:16:40.272663583 -0500
@@ -782,3 +782,6 @@
 {
        return from;
 }
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(softirq_entry);
+EXPORT_TRACEPOINT_SYMBOL_GPL(softirq_exit);
--- kernel/trace/trace_syscalls.c.~1~   2014-08-13 21:36:35.000000000 -0500
+++ kernel/trace/trace_syscalls.c       2015-04-02 11:12:35.625739948 -0500
@@ -760,3 +760,6 @@
        }
        return 0;
 }
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(sys_exit);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sys_enter);
--- kernel/trace/trace_sched_switch.c.~1~       2014-08-13 21:36:35.000000000 -0500
+++ kernel/trace/trace_sched_switch.c   2015-04-01 20:35:39.441197241 -0500
@@ -245,3 +245,4 @@
        ctx_trace = tr;
 }
 
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_switch);
Comment 1 Ron Rechenmacher 2015-04-06 17:07:50 UTC
Here's the patch for 3.19.3:
--- kernel/irq/handle.c.~1~     2015-03-26 08:00:21.000000000 -0500
+++ kernel/irq/handle.c 2015-04-06 11:13:54.790996932 -0500
@@ -195,3 +195,6 @@
        irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
        return ret;
 }
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_entry);
+EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_exit);
--- kernel/softirq.c.~1~        2015-03-26 08:00:21.000000000 -0500
+++ kernel/softirq.c    2015-04-06 11:13:54.790996932 -0500
@@ -786,3 +786,6 @@
 {
        return from;
 }
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(softirq_entry);
+EXPORT_TRACEPOINT_SYMBOL_GPL(softirq_exit);
--- kernel/trace/trace_syscalls.c.~1~   2015-03-26 08:00:21.000000000 -0500
+++ kernel/trace/trace_syscalls.c       2015-04-06 11:13:54.791996980 -0500
@@ -748,3 +748,6 @@
        }
        return 0;
 }
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(sys_exit);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sys_enter);
--- kernel/trace/trace_sched_switch.c.~1~       2015-03-26 08:00:21.000000000 -0500
+++ kernel/trace/trace_sched_switch.c   2015-04-06 11:16:21.047312206 -0500
@@ -101,3 +101,5 @@
 {
        tracing_stop_sched_switch();
 }
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_switch);
Comment 2 Ron Rechenmacher 2015-04-06 17:10:18 UTC
Created attachment 173211 [details]
patch for 3.19.3
Comment 3 Ron Rechenmacher 2015-04-13 20:22:16 UTC
Created attachment 173961 [details]
patch for kernel 4.0
Comment 4 Steven Rostedt 2015-04-13 20:49:59 UTC
On Mon, 13 Apr 2015 20:22:16 +0000
bugzilla-daemon@bugzilla.kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=96051
> 
> --- Comment #3 from Ron Rechenmacher <ron@fnal.gov> ---
> Created attachment 173961 [details]
>   --> https://bugzilla.kernel.org/attachment.cgi?id=173961&action=edit
> patch for kernel 4.0
> 

Would you be able to send a formal patch to
linux-kernel@vger.kernel.org, that I can pull in.

Thanks,

-- Steve
Comment 5 Ron Rechenmacher 2015-04-20 17:14:29 UTC
(In reply to Steven Rostedt from comment #4)
> On Mon, 13 Apr 2015 20:22:16 +0000
> bugzilla-daemon@bugzilla.kernel.org wrote:
> 
> > https://bugzilla.kernel.org/show_bug.cgi?id=96051
> > 
> > --- Comment #3 from Ron Rechenmacher <ron@fnal.gov> ---
> > Created attachment 173961 [details]
> >   --> https://bugzilla.kernel.org/attachment.cgi?id=173961&action=edit
> > patch for kernel 4.0
> > 
> 
> Would you be able to send a formal patch to
> linux-kernel@vger.kernel.org, that I can pull in.
> 
> Thanks,
> 
> -- Steve

I tried, but it's looking like I failed; sorry about that.
What I did was: googled for: how to make a patch for linux.
I end up cloning some git repo from gregkh, but I think I should have done
https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
Is that correct?
Also, I'm wondering what the subject line should have been? (I'm guessing
something like "[PATCH] Tracing/Profiling: Ftrace:...", but I'm also wondering if the subject should have this bug number (96051) in it?)

Please advise.
--Ron
Comment 6 Steven Rostedt 2015-04-20 17:19:40 UTC
On Mon, 20 Apr 2015 17:14:29 +0000
bugzilla-daemon@bugzilla.kernel.org wrote:
 
> I tried, but it's looking like I failed; sorry about that.
> What I did was: googled for: how to make a patch for linux.
> I end up cloning some git repo from gregkh, but I think I should have done
> https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
> Is that correct?
> Also, I'm wondering what the subject line should have been? (I'm guessing
> something like "[PATCH] Tracing/Profiling: Ftrace:...", but I'm also
> wondering
> if the subject should have this bug number (96051) in it?)
> 

You can base off of linux-trace.git, or even Linus's main branch, as
I'm pretty up to date with it. Also read SubmittingPatches.txt in the
kernel tree:

 https://www.kernel.org/doc/Documentation/SubmittingPatches

The subject should be:

 [PATCH] tracing: Export key trace event symbols

Explain why they should be exported (what breaks because they are not),
etc.

Then at the bottom add:

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96051

in with the tag section (where your Signed-off-by is).

Email linux-kernel@vger.kernel.org and Cc myself. I'll fix up the
change log if need be.

Thanks!

-- Steve
Comment 7 Ron Rechenmacher 2015-04-20 21:41:48 UTC
Hi Steve,
Please let me know if the patch I just sent (to linux-kernel@vger.kernel.org and cc you) works.
Thanks,
Ron

Note You need to log in before you can comment on or make changes to this bug.