7 perf-daemon - Run record sessions on background
14 'perf daemon' [<options>]
15 'perf daemon start' [<options>]
16 'perf daemon stop' [<options>]
17 'perf daemon signal' [<options>]
18 'perf daemon ping' [<options>]
23 This command allows to run simple daemon process that starts and
24 monitors configured record sessions.
26 You can imagine 'perf daemon' of background process with several
27 'perf record' child tasks, like:
31 1 916507 ... perf daemon start
32 916507 916508 ... \_ perf record --control=fifo:control,ack -m 10M -e cycles --overwrite --switch-output -a
33 916507 916509 ... \_ perf record --control=fifo:control,ack -m 20M -e sched:* --overwrite --switch-output -a
35 Not every 'perf record' session is suitable for running under daemon.
36 User need perf session that either produces data on query, like the
37 flight recorder sessions in above example or session that is configured
38 to produce data periodically, like with --switch-output configuration
41 Each session is started with control setup (with perf record --control
44 Sessions are configured through config file, see CONFIG FILE section
55 Config file path. If not provided, perf will check system and default
56 locations (/etc/perfconfig, $HOME/.perfconfig).
59 Base directory path. Each daemon instance is running on top
60 of base directory. Only one instance of server can run on
61 top of one directory at the time.
63 All generic options are available also under commands.
68 The start command creates the daemon process.
72 Do not put the process in background.
77 The stop command stops all the session and the daemon process.
82 The signal command sends signal to configured sessions.
85 Send signal to specific session.
90 The ping command sends control ping to configured sessions.
93 Send ping to specific session.
98 The daemon is configured within standard perf config file by
99 following new variables:
102 Base path for daemon data. All sessions data are
103 stored under this path.
106 Defines new record session. The value is record's command
107 line without the 'record' keyword.
109 Each perf record session is run in daemon.base/<NAME> directory.
114 Example with 2 record sessions:
121 run = -m 10M -e cycles --overwrite --switch-output -a
124 run = -m 20M -e sched:* --overwrite --switch-output -a
135 [603349:daemon] base: /opt/perfdata
136 [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a
137 [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a
139 First line is daemon process info with configured daemon base.
142 Check sessions with more info:
145 [603349:daemon] base: /opt/perfdata
146 output: /opt/perfdata/output
147 lock: /opt/perfdata/lock
149 [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a
150 base: /opt/perfdata/session-cycles
151 output: /opt/perfdata/session-cycles/output
152 control: /opt/perfdata/session-cycles/control
153 ack: /opt/perfdata/session-cycles/ack
155 [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a
156 base: /opt/perfdata/session-sched
157 output: /opt/perfdata/session-sched/output
158 control: /opt/perfdata/session-sched/control
159 ack: /opt/perfdata/session-sched/ack
162 The 'base' path is daemon/session base.
163 The 'lock' file is daemon's lock file guarding that no other
164 daemon is running on top of the base.
165 The 'output' file is perf record output for specific session.
166 The 'control' and 'ack' files are perf control files.
167 The 'up' number shows minutes daemon/session is running.
170 Make sure control session is online:
177 Send USR2 signal to session 'cycles' to generate perf.data file:
179 # perf daemon signal --session cycles
180 signal 12 sent to session 'cycles [603452]'
182 # tail -2 /opt/perfdata/session-cycles/output
183 [ perf record: dump data: Woken up 1 times ]
184 [ perf record: Dump perf.data.2020123017013149 ]
187 Send USR2 signal to all sessions:
190 signal 12 sent to session 'cycles [603452]'
191 signal 12 sent to session 'sched [603453]'
193 # tail -2 /opt/perfdata/session-cycles/output
194 [ perf record: dump data: Woken up 1 times ]
195 [ perf record: Dump perf.data.2020123017024689 ]
196 # tail -2 /opt/perfdata/session-sched/output
197 [ perf record: dump data: Woken up 1 times ]
198 [ perf record: Dump perf.data.2020123017024713 ]
208 linkperf:perf-record[1], linkperf:perf-config[1]