ftrace: Updates for 7.3
Linus,
ftrace updates for 7.3:
- Deprecate ftrace_enabled in disabling ftrace
The file /proc/sys/kernel/ftrace_enabled was created when ftrace was first introduced back in 2008. It was to be a "kill switch" if something was to go wrong. It was also used as a way to turn off function tracing for the latency tracers that would have it on by default. But in 2013 (Linux 3.10) the option "function-trace" was introduced to disable function tracing for the latency tracers as the "ftrace_enabled" file was considered too big of a hammer and caused too many side effects.
When live kernel patching came along, disabling ftrace via the ftrace_enabled file would put the system into an unstable state if a live kernel patch was installed. This created the need to mark some function hooks as "PERMANENT".
Now there's a need for BPF usage marked as PERMANENT for the same reasons.
The file "ftrace_enabled" usage is no longer viable. It doesn't do what it says it does and there is no reason to use it.
Make writing '0' to it a nop and print a message saying its usage is deprecated. The return value of writing '0' is -EOPNOTSUPP so that user space will error on that write (hopefully to inform any developer that it no longer works).
Eventually the file should be removed completely, but for now just making it not do anything is the path forward to that.
- Update the livepatch tests to handle ftrace_enabled being disabled
Because in the past, livepatch was broken by ftrace_enabled being turned off, there's a test case that checks to make sure it still doesn't break. But having the write of '0' return an error caused that test to break. Updated the test to handle the new change.
Please pull the latest ftrace-v7.3 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
ftrace-v7.3
Tag SHA1: bbc5fbe8256ea1deaa8708d0887a97e594155ce6 Head SHA1: 88b3e7fedc07d940c32eb5c0733a780e944b6b47
Andrey Grodzovsky (2):
ftrace: deprecate disabling via ftrace_enabled sysctl selftests/livepatch: update test-ftrace.sh for deprecated ftrace_enabled
----
Documentation/trace/ftrace.rst | 5 +++ kernel/trace/ftrace.c | 43 ++++------------------ tools/testing/selftests/livepatch/functions.sh | 14 ++++++++ tools/testing/selftests/livepatch/test-ftrace.sh | 45 +++++++++++++++--------- 4 files changed, 53 insertions(+), 54 deletions(-)
---------------------------
The pull request you sent on Sat, 15 Aug 2026 15:22:32 -0400:
The pull request you sent on Sat, 15 Aug 2026 15:22:32 -0400:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.gitftrace-v7.3
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/00d66b29a66ce18e417a8436076c629d03186a27
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html