Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf daemon: Add examples to man page

Add usage examples to the man page.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Budankov <abudankov@huawei.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: https://lore.kernel.org/r/20210208200908.1019149-19-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
13fb3b9f 5bdee4f0

+98
+98
tools/perf/Documentation/perf-daemon.txt
··· 41 41 Each session is started with control setup (with perf record --control 42 42 options). 43 43 44 + Sessions are configured through config file, see CONFIG FILE section 45 + with EXAMPLES. 46 + 47 + 44 48 OPTIONS 45 49 ------- 46 50 -v:: ··· 107 103 line without the 'record' keyword. 108 104 109 105 Each perf record session is run in daemon.base/<NAME> directory. 106 + 107 + 108 + EXAMPLES 109 + -------- 110 + Example with 2 record sessions: 111 + 112 + # cat ~/.perfconfig 113 + [daemon] 114 + base=/opt/perfdata 115 + 116 + [session-cycles] 117 + run = -m 10M -e cycles --overwrite --switch-output -a 118 + 119 + [session-sched] 120 + run = -m 20M -e sched:* --overwrite --switch-output -a 121 + 122 + 123 + Starting the daemon: 124 + 125 + # perf daemon start 126 + 127 + 128 + Check sessions: 129 + 130 + # perf daemon 131 + [603349:daemon] base: /opt/perfdata 132 + [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a 133 + [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a 134 + 135 + First line is daemon process info with configured daemon base. 136 + 137 + 138 + Check sessions with more info: 139 + 140 + # perf daemon -v 141 + [603349:daemon] base: /opt/perfdata 142 + output: /opt/perfdata/output 143 + lock: /opt/perfdata/lock 144 + up: 1 minutes 145 + [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a 146 + base: /opt/perfdata/session-cycles 147 + output: /opt/perfdata/session-cycles/output 148 + control: /opt/perfdata/session-cycles/control 149 + ack: /opt/perfdata/session-cycles/ack 150 + up: 1 minutes 151 + [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a 152 + base: /opt/perfdata/session-sched 153 + output: /opt/perfdata/session-sched/output 154 + control: /opt/perfdata/session-sched/control 155 + ack: /opt/perfdata/session-sched/ack 156 + up: 1 minutes 157 + 158 + The 'base' path is daemon/session base. 159 + The 'lock' file is daemon's lock file guarding that no other 160 + daemon is running on top of the base. 161 + The 'output' file is perf record output for specific session. 162 + The 'control' and 'ack' files are perf control files. 163 + The 'up' number shows minutes daemon/session is running. 164 + 165 + 166 + Make sure control session is online: 167 + 168 + # perf daemon ping 169 + OK cycles 170 + OK sched 171 + 172 + 173 + Send USR2 signal to session 'cycles' to generate perf.data file: 174 + 175 + # perf daemon signal --session cycles 176 + signal 12 sent to session 'cycles [603452]' 177 + 178 + # tail -2 /opt/perfdata/session-cycles/output 179 + [ perf record: dump data: Woken up 1 times ] 180 + [ perf record: Dump perf.data.2020123017013149 ] 181 + 182 + 183 + Send USR2 signal to all sessions: 184 + 185 + # perf daemon signal 186 + signal 12 sent to session 'cycles [603452]' 187 + signal 12 sent to session 'sched [603453]' 188 + 189 + # tail -2 /opt/perfdata/session-cycles/output 190 + [ perf record: dump data: Woken up 1 times ] 191 + [ perf record: Dump perf.data.2020123017024689 ] 192 + # tail -2 /opt/perfdata/session-sched/output 193 + [ perf record: dump data: Woken up 1 times ] 194 + [ perf record: Dump perf.data.2020123017024713 ] 195 + 196 + 197 + Stop daemon: 198 + 199 + # perf daemon stop 110 200 111 201 112 202 SEE ALSO