Why /proc/timer_stats Is Missing on Modern Linux
You will be able to test for /proc/timer_stats, identify whether a guide targets an old kernel, and avoid wasting time trying to enable a file that your kernel no longer provides. On the machine used for this guide, the installed proc_timer_stats(5) page is from Linux man-pages 6.7, and the running kernel is Linux 6.8. The checks take about two minutes and do not change system state.
The route
Jump straight to the step you need, or tick off Done means at the end.
What this file was for
/proc/timer_stats was a kernel debugging interface for counting timer activity. It was intended for kernel and user-space developers investigating unnecessary wakeups and their effect on power use. It was not a general-purpose system health report, a service configuration file, or a persistent setting.
The interface was available from Linux 2.6.21 through Linux 4.10. Its state was inactive after boot. On a kernel that still implemented it, a root user could start a sampling period, read the changing counters, and stop collection:
# echo 1 > /proc/timer_stats
$ cat /proc/timer_stats
# echo 0 > /proc/timer_stats
The two writes require elevated privileges. Reading the file normally did not. The counters remained available for further reads after collection stopped, until another sampling period began.
Checkpoint: test the path first
Run this as your ordinary user. It is a read-only check and reports the result without attempting to load a module or write to /proc:
if test -e /proc/timer_stats; then
echo '/proc/timer_stats is present'
else
echo '/proc/timer_stats is absent'
fi
On a current kernel, the expected result is:
/proc/timer_stats is absent
If it is present, check the kernel release before following an old procedure:
uname -sr
A present file on a release newer than Linux 4.10 would be unusual and deserves investigation against that kernel's documentation. Do not assume that a successful test means collection is active. The historical interface started inactive and needed an explicit write of 1.
Checkpoint: understand the failed cat
This command is safe but will fail when the path is absent:
cat /proc/timer_stats
The useful diagnosis on this machine is:
cat: /proc/timer_stats: No such file or directory
That message means the kernel has not exposed the path. It does not mean that the statistics are empty, that sampling is paused, or that your shell lacks permission. A permissions error would be a different failure. Running the command with sudo will not restore an interface removed from the kernel.
Why modern kernels do not expose it
The Linux man-page records that the file was removed during the Linux 4.11 development cycle. The reason was a security concern: the output exposed information across namespaces. That makes the absence an expected compatibility boundary, not a broken procfs mount.
The removal also explains a common distraction. Searching for CONFIG_TIMER_STATS, writing 1 with sudo, or looking for a package that supplies the file cannot bring back an interface that is no longer implemented by the running kernel. A package may still install the manual page because the man-pages project documents historical interfaces and their removal.
Choose the next step
- If you are checking an old script: treat a missing path as an unsupported kernel interface. Do not convert the error into a claim that there were zero timer events. Update the script to detect the path explicitly and report that this diagnostic is unavailable.
- If you are following a historical investigation: use a kernel and environment where the interface is actually supported, with the security and isolation implications understood. This is a specialist test setup, not a production repair.
- If you need equivalent current tracing: investigate in-kernel tracing facilities such as ftrace. The
proc_timer_stats(5)page identifies ftrace as a way to obtain the same information, but the correct events and collection method depend on the kernel and the question you are investigating.
Do not replace the missing file with a hand-made file under /proc. The proc filesystem is kernel-backed, so an ordinary file in another directory would not provide the same data or semantics. There is no undo step for the checks above because they make no changes.
Common traps
- Confusing the man page with the feature:
man proc_timer_statscan succeed while/proc/timer_statsis absent. Documentation packages can describe removed interfaces. - Using the sample output as a promise: names such as
swapper, process IDs, event counts, and callback names are historical examples, not output you should expect on a current system. - Reading the version without reading the date range: the page's examples describe Linux 2.6.21 to 4.10. Your installed man-pages version is not the kernel version that provides the file.
- Turning a diagnostic into a configuration change: the historical
echo 1andecho 0commands controlled a sampling period. They were not permanent tuning settings, and they are pointless when the path is absent.
Done means
- You checked
/proc/timer_statswithout changing the system. - You recorded the running kernel with
uname -sr. - You distinguished a missing interface from an empty result or a permission error.
- You know that Linux 4.11 and later kernels removed this interface, according to
proc_timer_stats(5). - You have chosen between updating an old script, using a historical test environment, and investigating current tracing.