]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man/man5/proc_timer_stats.5
man/, share/mk/: Move man*/ to man/
[thirdparty/man-pages.git] / man / man5 / proc_timer_stats.5
CommitLineData
4ddf958b
AC
1.\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
2.\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3.\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
4.\"
5.\" SPDX-License-Identifier: GPL-3.0-or-later
6.\"
7.TH proc_timer_stats 5 (date) "Linux man-pages (unreleased)"
8.SH NAME
9/proc/timer_stats \- timer statistics
10.SH DESCRIPTION
11.TP
12.IR /proc/timer_stats " (from Linux 2.6.21 until Linux 4.10)"
13.\" commit 82f67cd9fca8c8762c15ba7ed0d5747588c1e221
14.\" Date: Fri Feb 16 01:28:13 2007 -0800
15.\" Text largely derived from Documentation/timers/timer_stats.txt
16.\" removed in commit dfb4357da6ddbdf57d583ba64361c9d792b0e0b1
17.\" Date: Wed Feb 8 11:26:59 2017 -0800
18This is a debugging facility to make timer (ab)use in a Linux
19system visible to kernel and user-space developers.
20It can be used by kernel and user-space developers to verify that
21their code does not make undue use of timers.
22The goal is to avoid unnecessary wakeups,
23thereby optimizing power consumption.
24.IP
25If enabled in the kernel
26.RB ( CONFIG_TIMER_STATS ),
27but not used,
28it has almost zero run-time overhead and a relatively small
29data-structure overhead.
30Even if collection is enabled at run time, overhead is low:
31all the locking is per-CPU and lookup is hashed.
32.IP
33The
34.I /proc/timer_stats
35file is used both to control sampling facility and to read out the
36sampled information.
37.IP
38The
39.I timer_stats
40functionality is inactive on bootup.
41A sampling period can be started using the following command:
42.IP
43.in +4n
44.EX
45# echo 1 > /proc/timer_stats
46.EE
47.in
48.IP
49The following command stops a sampling period:
50.IP
51.in +4n
52.EX
53# echo 0 > /proc/timer_stats
54.EE
55.in
56.IP
57The statistics can be retrieved by:
58.IP
59.in +4n
60.EX
61$ cat /proc/timer_stats
62.EE
63.in
64.IP
65While sampling is enabled, each readout from
66.I /proc/timer_stats
67will see
68newly updated statistics.
69Once sampling is disabled, the sampled information
70is kept until a new sample period is started.
71This allows multiple readouts.
72.IP
73Sample output from
74.IR /proc/timer_stats :
75.IP
76.in +4n
77.EX
78.RB $ " cat /proc/timer_stats"
79Timer Stats Version: v0.3
80Sample period: 1.764 s
81Collection: active
82 255, 0 swapper/3 hrtimer_start_range_ns (tick_sched_timer)
83 71, 0 swapper/1 hrtimer_start_range_ns (tick_sched_timer)
84 58, 0 swapper/0 hrtimer_start_range_ns (tick_sched_timer)
85 4, 1694 gnome\-shell mod_delayed_work_on (delayed_work_timer_fn)
86 17, 7 rcu_sched rcu_gp_kthread (process_timeout)
87\&...
88 1, 4911 kworker/u16:0 mod_delayed_work_on (delayed_work_timer_fn)
89 1D, 2522 kworker/0:0 queue_delayed_work_on (delayed_work_timer_fn)
901029 total events, 583.333 events/sec
91.EE
92.in
93.IP
94The output columns are:
95.RS
96.IP [1] 5
97a count of the number of events,
98optionally (since Linux 2.6.23) followed by the letter \[aq]D\[aq]
99.\" commit c5c061b8f9726bc2c25e19dec227933a13d1e6b7 deferrable timers
100if this is a deferrable timer;
101.IP [2]
102the PID of the process that initialized the timer;
103.IP [3]
104the name of the process that initialized the timer;
105.IP [4]
106the function where the timer was initialized; and
107(in parentheses)
108the callback function that is associated with the timer.
109.RE
110.IP
111During the Linux 4.11 development cycle,
112this file was removed because of security concerns,
113as it exposes information across namespaces.
114Furthermore, it is possible to obtain
115the same information via in-kernel tracing facilities such as ftrace.
116.SH SEE ALSO
117.BR proc (5)