The tracepoints sched_entry, sched_exit and sched_set_need_resched
are not exported to tracefs as trace events, this allows only kernel
code to access them. Helper modules like [1] can be used to still have
the tracepoints available to ftrace for debugging purposes, but they do
rely on the tracepoints being exported.
Export the 3 not exported tracepoints.
Note that sched_set_state is already exported as the macro is called
from modules.
[1] - https://github.com/qais-yousef/sched_tp.git
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
---
kernel/sched/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 41ba0be16911..5516778c19eb 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -119,6 +119,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_cfs_tp);
EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_se_tp);
EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp);
EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_entry_tp);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_exit_tp);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_set_need_resched_tp);
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
DEFINE_PER_CPU(struct rnd_state, sched_rnd_state);
--
2.52.0
On Fri, Dec 05, 2025 at 02:16:16PM +0100 Gabriele Monaco wrote: > The tracepoints sched_entry, sched_exit and sched_set_need_resched > are not exported to tracefs as trace events, this allows only kernel > code to access them. Helper modules like [1] can be used to still have > the tracepoints available to ftrace for debugging purposes, but they do > rely on the tracepoints being exported. > > Export the 3 not exported tracepoints. > Note that sched_set_state is already exported as the macro is called > from modules. > > [1] - https://github.com/qais-yousef/sched_tp.git > > Signed-off-by: Gabriele Monaco <gmonaco@redhat.com> This makes sense. Reviewed-by: Phil Auld <pauld@redhat.com> Cheers, Phil > --- > kernel/sched/core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 41ba0be16911..5516778c19eb 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -119,6 +119,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_cfs_tp); > EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_se_tp); > EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp); > EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp); > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_entry_tp); > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_exit_tp); > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_set_need_resched_tp); > > DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); > DEFINE_PER_CPU(struct rnd_state, sched_rnd_state); > -- > 2.52.0 > > --
Hi Peter,
On Fri, Dec 05, 2025 at 08:35:52AM -0500 Phil Auld wrote:
> On Fri, Dec 05, 2025 at 02:16:16PM +0100 Gabriele Monaco wrote:
> > The tracepoints sched_entry, sched_exit and sched_set_need_resched
> > are not exported to tracefs as trace events, this allows only kernel
> > code to access them. Helper modules like [1] can be used to still have
> > the tracepoints available to ftrace for debugging purposes, but they do
> > rely on the tracepoints being exported.
> >
> > Export the 3 not exported tracepoints.
> > Note that sched_set_state is already exported as the macro is called
> > from modules.
> >
> > [1] - https://github.com/qais-yousef/sched_tp.git
> >
> > Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
>
> This makes sense.
>
> Reviewed-by: Phil Auld <pauld@redhat.com>
>
Any chance we can get this one in even if the rest of the series
needs more time?
Without this, out of tree modules fail to link.
I don't know if it's worth adding:
Fixes: adcc3bfa8806 ("sched: Adapt sched tracepoints for RV task model")
Cheers,
Phil
>
> Cheers,
> Phil
>
> > ---
> > kernel/sched/core.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index 41ba0be16911..5516778c19eb 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -119,6 +119,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_cfs_tp);
> > EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_se_tp);
> > EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp);
> > EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_entry_tp);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_exit_tp);
> > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_set_need_resched_tp);
> >
> > DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
> > DEFINE_PER_CPU(struct rnd_state, sched_rnd_state);
> > --
> > 2.52.0
> >
> >
>
> --
>
--
Ping...
On Fri, Dec 12, 2025 at 07:36:43AM +0900 Phil Auld wrote:
>
> Hi Peter,
>
> On Fri, Dec 05, 2025 at 08:35:52AM -0500 Phil Auld wrote:
> > On Fri, Dec 05, 2025 at 02:16:16PM +0100 Gabriele Monaco wrote:
> > > The tracepoints sched_entry, sched_exit and sched_set_need_resched
> > > are not exported to tracefs as trace events, this allows only kernel
> > > code to access them. Helper modules like [1] can be used to still have
> > > the tracepoints available to ftrace for debugging purposes, but they do
> > > rely on the tracepoints being exported.
> > >
> > > Export the 3 not exported tracepoints.
> > > Note that sched_set_state is already exported as the macro is called
> > > from modules.
> > >
> > > [1] - https://github.com/qais-yousef/sched_tp.git
> > >
> > > Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
> >
> > This makes sense.
> >
> > Reviewed-by: Phil Auld <pauld@redhat.com>
> >
>
> Any chance we can get this one in even if the rest of the series
> needs more time?
>
> Without this, out of tree modules fail to link.
Any thoughts on this? Please?
Anything including linux/sched.h fails to link due to
these:
__trace_set_need_resched
__tracepoint_sched_set_need_resched_tp
Thanks,
Phil
>
> I don't know if it's worth adding:
>
> Fixes: adcc3bfa8806 ("sched: Adapt sched tracepoints for RV task model")
>
>
> Cheers,
> Phil
>
> >
> > Cheers,
> > Phil
> >
> > > ---
> > > kernel/sched/core.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > > index 41ba0be16911..5516778c19eb 100644
> > > --- a/kernel/sched/core.c
> > > +++ b/kernel/sched/core.c
> > > @@ -119,6 +119,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_cfs_tp);
> > > EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_se_tp);
> > > EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp);
> > > EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp);
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_entry_tp);
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_exit_tp);
> > > +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_set_need_resched_tp);
> > >
> > > DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
> > > DEFINE_PER_CPU(struct rnd_state, sched_rnd_state);
> > > --
> > > 2.52.0
> > >
> > >
> >
> > --
> >
>
> --
>
>
--
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 6c125b85f3c87b4bf7dba91af6f27d9600b9dba0
Gitweb: https://git.kernel.org/tip/6c125b85f3c87b4bf7dba91af6f27d9600b9dba0
Author: Gabriele Monaco <gmonaco@redhat.com>
AuthorDate: Fri, 05 Dec 2025 14:16:16 +01:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 13 Jan 2026 11:37:53 +01:00
sched: Export hidden tracepoints to modules
The tracepoints sched_entry, sched_exit and sched_set_need_resched
are not exported to tracefs as trace events, this allows only kernel
code to access them. Helper modules like [1] can be used to still have
the tracepoints available to ftrace for debugging purposes, but they do
rely on the tracepoints being exported.
Export the 3 not exported tracepoints.
Note that sched_set_state is already exported as the macro is called
from modules.
[1] - https://github.com/qais-yousef/sched_tp.git
Fixes: adcc3bfa8806 ("sched: Adapt sched tracepoints for RV task model")
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Phil Auld <pauld@redhat.com>
Link: https://patch.msgid.link/20251205131621.135513-9-gmonaco@redhat.com
---
kernel/sched/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index fa72075..b033f97 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -119,6 +119,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_cfs_tp);
EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_se_tp);
EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp);
EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_entry_tp);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_exit_tp);
+EXPORT_TRACEPOINT_SYMBOL_GPL(sched_set_need_resched_tp);
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
DEFINE_PER_CPU(struct rnd_state, sched_rnd_state);
© 2016 - 2026 Red Hat, Inc.