diff mbox

Export sched tracepoints for use by kernel modules

Message ID 20140422142313.GB21121@dreric01-Precision-T1600
State New
Headers show

Commit Message

Drew Richardson April 22, 2014, 2:23 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/sched/core.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Ingo Molnar April 22, 2014, 2:45 p.m. UTC | #1
* Drew Richardson <drew.richardson@arm.com> 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.
> 
> Signed-off-by: Drew Richardson <drew.richardson@arm.com>
> Acked-by: Pawel Moll <pawel.moll@arm.com>
> ---
>  kernel/sched/core.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 268a45ea238c..cdb8e92ff24a 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -90,6 +90,31 @@
>  #define CREATE_TRACE_POINTS
>  #include <trace/events/sched.h>
>  
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_kthread_stop);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_kthread_stop_ret);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_wakeup);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_wakeup_new);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_switch);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_migrate_task);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_free);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_exit);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_wait_task);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_wait);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_fork);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_exec);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_wait);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_sleep);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_iowait);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_blocked);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_runtime);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_pi_setprio);
> +#ifdef CONFIG_DETECT_HUNG_TASK
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_hang);
> +#endif /* CONFIG_DETECT_HUNG_TASK */
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_move_numa);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stick_numa);
> +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_swap_numa);

Which in-tree kernel module is using these?

Thanks,

	Ingo
--
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, 2:53 p.m. UTC | #2
On Tue, Apr 22, 2014 at 03:45:04PM +0100, Ingo Molnar wrote:
> 
> * Drew Richardson <drew.richardson@arm.com> 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.
> > 
> > Signed-off-by: Drew Richardson <drew.richardson@arm.com>
> > Acked-by: Pawel Moll <pawel.moll@arm.com>
> > ---
> >  kernel/sched/core.c | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> > 
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index 268a45ea238c..cdb8e92ff24a 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -90,6 +90,31 @@
> >  #define CREATE_TRACE_POINTS
> >  #include <trace/events/sched.h>
> >  
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_kthread_stop);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_kthread_stop_ret);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_wakeup);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_wakeup_new);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_switch);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_migrate_task);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_free);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_exit);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_wait_task);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_wait);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_fork);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_exec);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_wait);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_sleep);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_iowait);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_blocked);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_runtime);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_pi_setprio);
> > +#ifdef CONFIG_DETECT_HUNG_TASK
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_hang);
> > +#endif /* CONFIG_DETECT_HUNG_TASK */
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_move_numa);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stick_numa);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_swap_numa);
> 
> Which in-tree kernel module is using these?
> 
> Thanks,
> 
> 	Ingo
> 

Gator (http://git.linaro.org/arm/ds5/gator.git), an out of tree kernel
module, uses sched_process_fork, sched_switch and
sched_process_free. Along with exporting those tracepoints I thought
it would be helpful to export all the tracepoints from
trace/events/sched.h.

Thanks,

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/
Ingo Molnar April 22, 2014, 6:26 p.m. UTC | #3
* Drew Richardson <drew.richardson@arm.com> wrote:

> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_sleep);
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_iowait);
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_blocked);
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_runtime);
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_pi_setprio);
> > > +#ifdef CONFIG_DETECT_HUNG_TASK
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_hang);
> > > +#endif /* CONFIG_DETECT_HUNG_TASK */
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_move_numa);
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stick_numa);
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_swap_numa);
> > 
> > Which in-tree kernel module is using these?
> > 
> > Thanks,
> > 
> > 	Ingo
> > 
> 
> Gator (http://git.linaro.org/arm/ds5/gator.git), an out of tree 
> kernel module, uses sched_process_fork, sched_switch and 
> sched_process_free. Along with exporting those tracepoints I thought 
> it would be helpful to export all the tracepoints from 
> trace/events/sched.h.

So, 'Gator' seems to be a rather ugly out of tree driver, ABI and 
daemon slapped on top of perf events, duplicating part of perf events 
functionality for no apparent good technical reason, just to enable a 
binary-only profiler called 'ARM Streamline Analyzer'.

What does the 'gator' driver offer that perf events does not offer in 
itself? If there's any sensible feature in there then it should be 
added to the mainline kernel not as an add on driver and filesystem, 
but as part of perf events subsystem itself.

Thanks,

	Ingo
--
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/sched/core.c b/kernel/sched/core.c
index 268a45ea238c..cdb8e92ff24a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -90,6 +90,31 @@ 
 #define CREATE_TRACE_POINTS
 #include <trace/events/sched.h>
 
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_kthread_stop);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_kthread_stop_ret);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_wakeup);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_wakeup_new);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_switch);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_migrate_task);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_free);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_exit);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_wait_task);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_wait);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_fork);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_exec);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_wait);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_sleep);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_iowait);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_blocked);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_runtime);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_pi_setprio);
+#ifdef CONFIG_DETECT_HUNG_TASK
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_process_hang);
+#endif /* CONFIG_DETECT_HUNG_TASK */
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_move_numa);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stick_numa);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_swap_numa);
+
 void start_bandwidth_timer(struct hrtimer *period_timer, ktime_t period)
 {
 	unsigned long delta;