[PATCH 3/3] sched/preempt: Check preempt counts in notrace helpers
Steven Rostedt
rostedt at goodmis.org
Tue Nov 24 08:08:37 PST 2026
On Mon, 16 Nov 2026 08:54:24 +0100
Karl Mehltretter <kmehltretter at gmail.com> wrote:
> --- a/kernel/sched/Makefile
> +++ b/kernel/sched/Makefile
> @@ -27,6 +27,9 @@ endif
>
> # Branch profiling isn't noinstr-safe
> ifdef CONFIG_TRACE_BRANCH_PROFILING
> +ifdef CONFIG_DEBUG_PREEMPT
> +CFLAGS_core.o += -DDISABLE_BRANCH_PROFILING
> +endif
> CFLAGS_build_policy.o += -DDISABLE_BRANCH_PROFILING
> CFLAGS_build_utility.o += -DDISABLE_BRANCH_PROFILING
Branch profiling is really for checking production code and not debug code.
I don't see a use case to see what branches are taken when the kernel is in
debug mode.
I think it would be better to just have BRANCH_PROFILING depend on
!DEBUG_PREEMPT. Then the above wouldn't even be possible.
Thanks,
-- Steve
> endif
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 1a088d4576f59..98ca93bc60887 100644
More information about the linux-arm-kernel
mailing list