1PERF-DAEMON(1) perf Manual PERF-DAEMON(1)
2
3
4
6 perf-daemon - Run record sessions on background
7
9 perf daemon
10 perf daemon [<options>]
11 perf daemon start [<options>]
12 perf daemon stop [<options>]
13 perf daemon signal [<options>]
14 perf daemon ping [<options>]
15
17 This command allows to run simple daemon process that starts and
18 monitors configured record sessions.
19
20 You can imagine perf daemon of background process with several perf
21 record child tasks, like:
22
23 # ps axjf
24 ...
25 1 916507 ... perf daemon start
26 916507 916508 ... \_ perf record --control=fifo:control,ack -m 10M -e cycles --overwrite --switch-output -a
27 916507 916509 ... \_ perf record --control=fifo:control,ack -m 20M -e sched:* --overwrite --switch-output -a
28
29 Not every perf record session is suitable for running under daemon.
30 User need perf session that either produces data on query, like the
31 flight recorder sessions in above example or session that is configured
32 to produce data periodically, like with --switch-output configuration
33 for time and size.
34
35 Each session is started with control setup (with perf record --control
36 options).
37
38 Sessions are configured through config file, see CONFIG FILE section
39 with EXAMPLES.
40
42 -v, --verbose
43 Be more verbose.
44
45 --config=<PATH>
46 Config file path. If not provided, perf will check system and
47 default locations (/etc/perfconfig, $HOME/.perfconfig).
48
49 --base=<PATH>
50 Base directory path. Each daemon instance is running on top of base
51 directory. Only one instance of server can run on top of one
52 directory at the time.
53
54 All generic options are available also under commands.
55
57 The start command creates the daemon process.
58
59 -f, --foreground
60 Do not put the process in background.
61
63 The stop command stops all the session and the daemon process.
64
66 The signal command sends signal to configured sessions.
67
68 --session
69 Send signal to specific session.
70
72 The ping command sends control ping to configured sessions.
73
74 --session
75 Send ping to specific session.
76
78 The daemon is configured within standard perf config file by following
79 new variables:
80
81 daemon.base: Base path for daemon data. All sessions data are stored
82 under this path.
83
84 session-<NAME>.run: Defines new record session. The value is record’s
85 command line without the record keyword.
86
87 Each perf record session is run in daemon.base/<NAME> directory.
88
90 Example with 2 record sessions:
91
92 # cat ~/.perfconfig
93 [daemon]
94 base=/opt/perfdata
95
96 [session-cycles]
97 run = -m 10M -e cycles --overwrite --switch-output -a
98
99 [session-sched]
100 run = -m 20M -e sched:* --overwrite --switch-output -a
101
102 Starting the daemon:
103
104 # perf daemon start
105
106 Check sessions:
107
108 # perf daemon
109 [603349:daemon] base: /opt/perfdata
110 [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a
111 [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a
112
113 First line is daemon process info with configured daemon base.
114
115 Check sessions with more info:
116
117 # perf daemon -v
118 [603349:daemon] base: /opt/perfdata
119 output: /opt/perfdata/output
120 lock: /opt/perfdata/lock
121 up: 1 minutes
122 [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a
123 base: /opt/perfdata/session-cycles
124 output: /opt/perfdata/session-cycles/output
125 control: /opt/perfdata/session-cycles/control
126 ack: /opt/perfdata/session-cycles/ack
127 up: 1 minutes
128 [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a
129 base: /opt/perfdata/session-sched
130 output: /opt/perfdata/session-sched/output
131 control: /opt/perfdata/session-sched/control
132 ack: /opt/perfdata/session-sched/ack
133 up: 1 minutes
134
135 The base path is daemon/session base. The lock file is daemon’s lock
136 file guarding that no other daemon is running on top of the base. The
137 output file is perf record output for specific session. The control and
138 ack files are perf control files. The up number shows minutes
139 daemon/session is running.
140
141 Make sure control session is online:
142
143 # perf daemon ping
144 OK cycles
145 OK sched
146
147 Send USR2 signal to session cycles to generate perf.data file:
148
149 # perf daemon signal --session cycles
150 signal 12 sent to session 'cycles [603452]'
151
152 # tail -2 /opt/perfdata/session-cycles/output
153 [ perf record: dump data: Woken up 1 times ]
154 [ perf record: Dump perf.data.2020123017013149 ]
155
156 Send USR2 signal to all sessions:
157
158 # perf daemon signal
159 signal 12 sent to session 'cycles [603452]'
160 signal 12 sent to session 'sched [603453]'
161
162 # tail -2 /opt/perfdata/session-cycles/output
163 [ perf record: dump data: Woken up 1 times ]
164 [ perf record: Dump perf.data.2020123017024689 ]
165 # tail -2 /opt/perfdata/session-sched/output
166 [ perf record: dump data: Woken up 1 times ]
167 [ perf record: Dump perf.data.2020123017024713 ]
168
169 Stop daemon:
170
171 # perf daemon stop
172
174 perf-record(1), perf-config(1)
175
176
177
178perf 01/12/2023 PERF-DAEMON(1)