Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 1 | perf-record(1) |
Ingo Molnar | c1c2365 | 2009-05-30 12:38:51 +0200 | [diff] [blame] | 2 | ============== |
Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
Ingo Molnar | 23ac9cb | 2009-05-27 09:33:18 +0200 | [diff] [blame] | 6 | perf-record - Run a command and record its profile into perf.data |
Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
| 10 | [verse] |
| 11 | 'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] <command> |
Mike Galbraith | 9e096753 | 2009-05-28 16:25:34 +0200 | [diff] [blame] | 12 | 'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] -- <command> [<options>] |
Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 13 | |
| 14 | DESCRIPTION |
| 15 | ----------- |
| 16 | This command runs a command and gathers a performance counter profile |
Ingo Molnar | 23ac9cb | 2009-05-27 09:33:18 +0200 | [diff] [blame] | 17 | from it, into perf.data - without displaying anything. |
Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 18 | |
| 19 | This file can then be inspected later on, using 'perf report'. |
| 20 | |
| 21 | |
| 22 | OPTIONS |
| 23 | ------- |
| 24 | <command>...:: |
| 25 | Any command you can specify in a shell. |
| 26 | |
| 27 | -e:: |
| 28 | --event=:: |
Frederic Weisbecker | 1b290d6 | 2009-11-23 15:42:35 +0100 | [diff] [blame] | 29 | Select the PMU event. Selection can be: |
Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 30 | |
Frederic Weisbecker | 1b290d6 | 2009-11-23 15:42:35 +0100 | [diff] [blame] | 31 | - a symbolic event name (use 'perf list' to list all events) |
| 32 | |
| 33 | - a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a |
| 34 | hexadecimal event descriptor. |
| 35 | |
| 36 | - a hardware breakpoint event in the form of '\mem:addr[:access]' |
| 37 | where addr is the address in memory you want to break in. |
| 38 | Access is the memory access type (read, write, execute) it can |
| 39 | be passed as follows: '\mem:addr[:[r][w][x]]'. |
| 40 | If you want to profile read-write accesses in 0x1000, just set |
| 41 | 'mem:0x1000:rw'. |
Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 42 | -a:: |
Arnaldo Carvalho de Melo | 386c0b7 | 2009-08-05 10:04:53 -0300 | [diff] [blame] | 43 | System-wide collection. |
Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 44 | |
| 45 | -l:: |
Arnaldo Carvalho de Melo | 386c0b7 | 2009-08-05 10:04:53 -0300 | [diff] [blame] | 46 | Scale counter values. |
| 47 | |
| 48 | -p:: |
| 49 | --pid=:: |
| 50 | Record events on existing pid. |
| 51 | |
| 52 | -r:: |
| 53 | --realtime=:: |
| 54 | Collect data with this RT SCHED_FIFO priority. |
| 55 | -A:: |
| 56 | --append:: |
| 57 | Append to the output file to do incremental profiling. |
| 58 | |
| 59 | -f:: |
| 60 | --force:: |
| 61 | Overwrite existing data file. |
| 62 | |
| 63 | -c:: |
| 64 | --count=:: |
| 65 | Event period to sample. |
| 66 | |
| 67 | -o:: |
| 68 | --output=:: |
| 69 | Output file name. |
| 70 | |
| 71 | -i:: |
| 72 | --inherit:: |
| 73 | Child tasks inherit counters. |
| 74 | -F:: |
| 75 | --freq=:: |
| 76 | Profile at this frequency. |
| 77 | |
| 78 | -m:: |
| 79 | --mmap-pages=:: |
| 80 | Number of mmap data pages. |
| 81 | |
| 82 | -g:: |
| 83 | --call-graph:: |
| 84 | Do call-graph (stack chain/backtrace) recording. |
| 85 | |
| 86 | -v:: |
| 87 | --verbose:: |
| 88 | Be more verbose (show counter open errors, etc). |
| 89 | |
| 90 | -s:: |
| 91 | --stat:: |
| 92 | Per thread counts. |
| 93 | |
| 94 | -d:: |
| 95 | --data:: |
| 96 | Sample addresses. |
| 97 | |
| 98 | -n:: |
| 99 | --no-samples:: |
| 100 | Don't sample. |
Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 101 | |
Frederic Weisbecker | ec7ba4e | 2009-08-31 03:32:03 +0200 | [diff] [blame] | 102 | -R:: |
| 103 | --raw-samples:: |
| 104 | Collect raw sample records from all opened counters (typically for tracepoint counters). |
| 105 | |
Ingo Molnar | e33e0a4 | 2009-04-20 15:58:01 +0200 | [diff] [blame] | 106 | SEE ALSO |
| 107 | -------- |
Thomas Gleixner | 386b05e | 2009-06-06 14:56:33 +0200 | [diff] [blame] | 108 | linkperf:perf-stat[1], linkperf:perf-list[1] |