1 perf-daemon(1) 1 perf-daemon(1) 2 ============== 2 ============== 3 3 4 4 5 NAME 5 NAME 6 ---- 6 ---- 7 perf-daemon - Run record sessions on backgroun 7 perf-daemon - Run record sessions on background 8 8 9 9 10 SYNOPSIS 10 SYNOPSIS 11 -------- 11 -------- 12 [verse] 12 [verse] 13 'perf daemon' 13 'perf daemon' 14 'perf daemon' [<options>] 14 'perf daemon' [<options>] 15 'perf daemon start' [<options>] 15 'perf daemon start' [<options>] 16 'perf daemon stop' [<options>] 16 'perf daemon stop' [<options>] 17 'perf daemon signal' [<options>] 17 'perf daemon signal' [<options>] 18 'perf daemon ping' [<options>] 18 'perf daemon ping' [<options>] 19 19 20 20 21 DESCRIPTION 21 DESCRIPTION 22 ----------- 22 ----------- 23 This command allows to run simple daemon proce 23 This command allows to run simple daemon process that starts and 24 monitors configured record sessions. 24 monitors configured record sessions. 25 25 26 You can imagine 'perf daemon' of background pr 26 You can imagine 'perf daemon' of background process with several 27 'perf record' child tasks, like: 27 'perf record' child tasks, like: 28 28 29 # ps axjf 29 # ps axjf 30 ... 30 ... 31 1 916507 ... perf daemon start 31 1 916507 ... perf daemon start 32 916507 916508 ... \_ perf record --control 32 916507 916508 ... \_ perf record --control=fifo:control,ack -m 10M -e cycles --overwrite --switch-output -a 33 916507 916509 ... \_ perf record --control 33 916507 916509 ... \_ perf record --control=fifo:control,ack -m 20M -e sched:* --overwrite --switch-output -a 34 34 35 Not every 'perf record' session is suitable fo 35 Not every 'perf record' session is suitable for running under daemon. 36 User need perf session that either produces da 36 User need perf session that either produces data on query, like the 37 flight recorder sessions in above example or s 37 flight recorder sessions in above example or session that is configured 38 to produce data periodically, like with --swit 38 to produce data periodically, like with --switch-output configuration 39 for time and size. 39 for time and size. 40 40 41 Each session is started with control setup (wi 41 Each session is started with control setup (with perf record --control 42 options). 42 options). 43 43 44 Sessions are configured through config file, s 44 Sessions are configured through config file, see CONFIG FILE section 45 with EXAMPLES. 45 with EXAMPLES. 46 46 47 47 48 OPTIONS 48 OPTIONS 49 ------- 49 ------- 50 -v:: 50 -v:: 51 --verbose:: 51 --verbose:: 52 Be more verbose. 52 Be more verbose. 53 53 54 --config=<PATH>:: 54 --config=<PATH>:: 55 Config file path. If not provided, per 55 Config file path. If not provided, perf will check system and default 56 locations (/etc/perfconfig, $HOME/.per 56 locations (/etc/perfconfig, $HOME/.perfconfig). 57 57 58 --base=<PATH>:: 58 --base=<PATH>:: 59 Base directory path. Each daemon insta 59 Base directory path. Each daemon instance is running on top 60 of base directory. Only one instance o 60 of base directory. Only one instance of server can run on 61 top of one directory at the time. 61 top of one directory at the time. 62 62 63 All generic options are available also under c 63 All generic options are available also under commands. 64 64 65 65 66 START COMMAND 66 START COMMAND 67 ------------- 67 ------------- 68 The start command creates the daemon process. 68 The start command creates the daemon process. 69 69 70 -f:: 70 -f:: 71 --foreground:: 71 --foreground:: 72 Do not put the process in background. 72 Do not put the process in background. 73 73 74 74 75 STOP COMMAND 75 STOP COMMAND 76 ------------ 76 ------------ 77 The stop command stops all the session and the 77 The stop command stops all the session and the daemon process. 78 78 79 79 80 SIGNAL COMMAND 80 SIGNAL COMMAND 81 -------------- 81 -------------- 82 The signal command sends signal to configured 82 The signal command sends signal to configured sessions. 83 83 84 --session:: 84 --session:: 85 Send signal to specific session. 85 Send signal to specific session. 86 86 87 87 88 PING COMMAND 88 PING COMMAND 89 ------------ 89 ------------ 90 The ping command sends control ping to configu 90 The ping command sends control ping to configured sessions. 91 91 92 --session:: 92 --session:: 93 Send ping to specific session. 93 Send ping to specific session. 94 94 95 95 96 CONFIG FILE 96 CONFIG FILE 97 ----------- 97 ----------- 98 The daemon is configured within standard perf 98 The daemon is configured within standard perf config file by 99 following new variables: 99 following new variables: 100 100 101 daemon.base: 101 daemon.base: 102 Base path for daemon data. All session 102 Base path for daemon data. All sessions data are 103 stored under this path. 103 stored under this path. 104 104 105 session-<NAME>.run: 105 session-<NAME>.run: 106 Defines new record session. The value 106 Defines new record session. The value is record's command 107 line without the 'record' keyword. 107 line without the 'record' keyword. 108 108 109 Each perf record session is run in daemon.base 109 Each perf record session is run in daemon.base/<NAME> directory. 110 110 111 111 112 EXAMPLES 112 EXAMPLES 113 -------- 113 -------- 114 Example with 2 record sessions: 114 Example with 2 record sessions: 115 115 116 # cat ~/.perfconfig 116 # cat ~/.perfconfig 117 [daemon] 117 [daemon] 118 base=/opt/perfdata 118 base=/opt/perfdata 119 119 120 [session-cycles] 120 [session-cycles] 121 run = -m 10M -e cycles --overwrite --switch- 121 run = -m 10M -e cycles --overwrite --switch-output -a 122 122 123 [session-sched] 123 [session-sched] 124 run = -m 20M -e sched:* --overwrite --switch 124 run = -m 20M -e sched:* --overwrite --switch-output -a 125 125 126 126 127 Starting the daemon: 127 Starting the daemon: 128 128 129 # perf daemon start 129 # perf daemon start 130 130 131 131 132 Check sessions: 132 Check sessions: 133 133 134 # perf daemon 134 # perf daemon 135 [603349:daemon] base: /opt/perfdata 135 [603349:daemon] base: /opt/perfdata 136 [603350:cycles] perf record -m 10M -e cycles 136 [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a 137 [603351:sched] perf record -m 20M -e sched:* 137 [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a 138 138 139 First line is daemon process info with configu 139 First line is daemon process info with configured daemon base. 140 140 141 141 142 Check sessions with more info: 142 Check sessions with more info: 143 143 144 # perf daemon -v 144 # perf daemon -v 145 [603349:daemon] base: /opt/perfdata 145 [603349:daemon] base: /opt/perfdata 146 output: /opt/perfdata/output 146 output: /opt/perfdata/output 147 lock: /opt/perfdata/lock 147 lock: /opt/perfdata/lock 148 up: 1 minutes 148 up: 1 minutes 149 [603350:cycles] perf record -m 10M -e cycles 149 [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a 150 base: /opt/perfdata/session-cycles 150 base: /opt/perfdata/session-cycles 151 output: /opt/perfdata/session-cycles/outp 151 output: /opt/perfdata/session-cycles/output 152 control: /opt/perfdata/session-cycles/cont 152 control: /opt/perfdata/session-cycles/control 153 ack: /opt/perfdata/session-cycles/ack 153 ack: /opt/perfdata/session-cycles/ack 154 up: 1 minutes 154 up: 1 minutes 155 [603351:sched] perf record -m 20M -e sched:* 155 [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a 156 base: /opt/perfdata/session-sched 156 base: /opt/perfdata/session-sched 157 output: /opt/perfdata/session-sched/outpu 157 output: /opt/perfdata/session-sched/output 158 control: /opt/perfdata/session-sched/contr 158 control: /opt/perfdata/session-sched/control 159 ack: /opt/perfdata/session-sched/ack 159 ack: /opt/perfdata/session-sched/ack 160 up: 1 minutes 160 up: 1 minutes 161 161 162 The 'base' path is daemon/session base. 162 The 'base' path is daemon/session base. 163 The 'lock' file is daemon's lock file guarding 163 The 'lock' file is daemon's lock file guarding that no other 164 daemon is running on top of the base. 164 daemon is running on top of the base. 165 The 'output' file is perf record output for sp 165 The 'output' file is perf record output for specific session. 166 The 'control' and 'ack' files are perf control 166 The 'control' and 'ack' files are perf control files. 167 The 'up' number shows minutes daemon/session i 167 The 'up' number shows minutes daemon/session is running. 168 168 169 169 170 Make sure control session is online: 170 Make sure control session is online: 171 171 172 # perf daemon ping 172 # perf daemon ping 173 OK cycles 173 OK cycles 174 OK sched 174 OK sched 175 175 176 176 177 Send USR2 signal to session 'cycles' to genera 177 Send USR2 signal to session 'cycles' to generate perf.data file: 178 178 179 # perf daemon signal --session cycles 179 # perf daemon signal --session cycles 180 signal 12 sent to session 'cycles [603452]' 180 signal 12 sent to session 'cycles [603452]' 181 181 182 # tail -2 /opt/perfdata/session-cycles/outp 182 # tail -2 /opt/perfdata/session-cycles/output 183 [ perf record: dump data: Woken up 1 times ] 183 [ perf record: dump data: Woken up 1 times ] 184 [ perf record: Dump perf.data.20201230170131 184 [ perf record: Dump perf.data.2020123017013149 ] 185 185 186 186 187 Send USR2 signal to all sessions: 187 Send USR2 signal to all sessions: 188 188 189 # perf daemon signal 189 # perf daemon signal 190 signal 12 sent to session 'cycles [603452]' 190 signal 12 sent to session 'cycles [603452]' 191 signal 12 sent to session 'sched [603453]' 191 signal 12 sent to session 'sched [603453]' 192 192 193 # tail -2 /opt/perfdata/session-cycles/outp 193 # tail -2 /opt/perfdata/session-cycles/output 194 [ perf record: dump data: Woken up 1 times ] 194 [ perf record: dump data: Woken up 1 times ] 195 [ perf record: Dump perf.data.20201230170246 195 [ perf record: Dump perf.data.2020123017024689 ] 196 # tail -2 /opt/perfdata/session-sched/outpu 196 # tail -2 /opt/perfdata/session-sched/output 197 [ perf record: dump data: Woken up 1 times ] 197 [ perf record: dump data: Woken up 1 times ] 198 [ perf record: Dump perf.data.20201230170247 198 [ perf record: Dump perf.data.2020123017024713 ] 199 199 200 200 201 Stop daemon: 201 Stop daemon: 202 202 203 # perf daemon stop 203 # perf daemon stop 204 204 205 205 206 SEE ALSO 206 SEE ALSO 207 -------- 207 -------- 208 linkperf:perf-record[1], linkperf:perf-config[ 208 linkperf:perf-record[1], linkperf:perf-config[1]
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.