diff options
Diffstat (limited to 'tools/perf/Documentation')
16 files changed, 324 insertions, 112 deletions
diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt index b2c63309a651..6f5a498608b2 100644 --- a/tools/perf/Documentation/perf-annotate.txt +++ b/tools/perf/Documentation/perf-annotate.txt | |||
@@ -24,12 +24,47 @@ OPTIONS | |||
24 | --input=:: | 24 | --input=:: |
25 | Input file name. (default: perf.data) | 25 | Input file name. (default: perf.data) |
26 | 26 | ||
27 | -d:: | ||
28 | --dsos=<dso[,dso...]>:: | ||
29 | Only consider symbols in these dsos. | ||
30 | -s:: | ||
31 | --symbol=<symbol>:: | ||
32 | Symbol to annotate. | ||
33 | |||
34 | -f:: | ||
35 | --force:: | ||
36 | Don't complain, do it. | ||
37 | |||
38 | -v:: | ||
39 | --verbose:: | ||
40 | Be more verbose. (Show symbol address, etc) | ||
41 | |||
42 | -D:: | ||
43 | --dump-raw-trace:: | ||
44 | Dump raw trace in ASCII. | ||
45 | |||
46 | -k:: | ||
47 | --vmlinux=<file>:: | ||
48 | vmlinux pathname. | ||
49 | |||
50 | -m:: | ||
51 | --modules:: | ||
52 | Load module symbols. WARNING: use only with -k and LIVE kernel. | ||
53 | |||
54 | -l:: | ||
55 | --print-line:: | ||
56 | Print matching source lines (may be slow). | ||
57 | |||
58 | -P:: | ||
59 | --full-paths:: | ||
60 | Don't shorten the displayed pathnames. | ||
61 | |||
27 | --stdio:: Use the stdio interface. | 62 | --stdio:: Use the stdio interface. |
28 | 63 | ||
29 | --tui:: Use the TUI interface Use of --tui requires a tty, if one is not | 64 | --tui:: Use the TUI interface Use of --tui requires a tty, if one is not |
30 | present, as when piping to other commands, the stdio interface is | 65 | present, as when piping to other commands, the stdio interface is |
31 | used. This interfaces starts by centering on the line with more | 66 | used. This interfaces starts by centering on the line with more |
32 | samples, TAB/UNTAB cycles thru the lines with more samples. | 67 | samples, TAB/UNTAB cycles through the lines with more samples. |
33 | 68 | ||
34 | SEE ALSO | 69 | SEE ALSO |
35 | -------- | 70 | -------- |
diff --git a/tools/perf/Documentation/perf-buildid-list.txt b/tools/perf/Documentation/perf-buildid-list.txt index 01b642c0bf8f..5eaac6f26d51 100644 --- a/tools/perf/Documentation/perf-buildid-list.txt +++ b/tools/perf/Documentation/perf-buildid-list.txt | |||
@@ -18,6 +18,9 @@ perf report. | |||
18 | 18 | ||
19 | OPTIONS | 19 | OPTIONS |
20 | ------- | 20 | ------- |
21 | -H:: | ||
22 | --with-hits:: | ||
23 | Show only DSOs with hits. | ||
21 | -i:: | 24 | -i:: |
22 | --input=:: | 25 | --input=:: |
23 | Input file name. (default: perf.data) | 26 | Input file name. (default: perf.data) |
diff --git a/tools/perf/Documentation/perf-diff.txt b/tools/perf/Documentation/perf-diff.txt index 20d97d84ea1c..74d7481ed7a6 100644 --- a/tools/perf/Documentation/perf-diff.txt +++ b/tools/perf/Documentation/perf-diff.txt | |||
@@ -19,6 +19,18 @@ If no parameters are passed it will assume perf.data.old and perf.data. | |||
19 | 19 | ||
20 | OPTIONS | 20 | OPTIONS |
21 | ------- | 21 | ------- |
22 | -M:: | ||
23 | --displacement:: | ||
24 | Show position displacement relative to baseline. | ||
25 | |||
26 | -D:: | ||
27 | --dump-raw-trace:: | ||
28 | Dump raw trace in ASCII. | ||
29 | |||
30 | -m:: | ||
31 | --modules:: | ||
32 | Load module symbols. WARNING: use only with -k and LIVE kernel | ||
33 | |||
22 | -d:: | 34 | -d:: |
23 | --dsos=:: | 35 | --dsos=:: |
24 | Only consider symbols in these dsos. CSV that understands | 36 | Only consider symbols in these dsos. CSV that understands |
@@ -42,7 +54,7 @@ OPTIONS | |||
42 | --field-separator=:: | 54 | --field-separator=:: |
43 | 55 | ||
44 | Use a special separator character and don't pad with spaces, replacing | 56 | Use a special separator character and don't pad with spaces, replacing |
45 | all occurances of this separator in symbol names (and other output) | 57 | all occurrences of this separator in symbol names (and other output) |
46 | with a '.' character, that thus it's the only non valid separator. | 58 | with a '.' character, that thus it's the only non valid separator. |
47 | 59 | ||
48 | -v:: | 60 | -v:: |
@@ -50,6 +62,13 @@ OPTIONS | |||
50 | Be verbose, for instance, show the raw counts in addition to the | 62 | Be verbose, for instance, show the raw counts in addition to the |
51 | diff. | 63 | diff. |
52 | 64 | ||
65 | -f:: | ||
66 | --force:: | ||
67 | Don't complain, do it. | ||
68 | |||
69 | --symfs=<directory>:: | ||
70 | Look for files with symbols relative to this directory. | ||
71 | |||
53 | SEE ALSO | 72 | SEE ALSO |
54 | -------- | 73 | -------- |
55 | linkperf:perf-record[1] | 74 | linkperf:perf-record[1] |
diff --git a/tools/perf/Documentation/perf-kvm.txt b/tools/perf/Documentation/perf-kvm.txt index d004e19fe6d6..dd84cb2f0a88 100644 --- a/tools/perf/Documentation/perf-kvm.txt +++ b/tools/perf/Documentation/perf-kvm.txt | |||
@@ -22,7 +22,7 @@ There are a couple of variants of perf kvm: | |||
22 | a performance counter profile of guest os in realtime | 22 | a performance counter profile of guest os in realtime |
23 | of an arbitrary workload. | 23 | of an arbitrary workload. |
24 | 24 | ||
25 | 'perf kvm record <command>' to record the performance couinter profile | 25 | 'perf kvm record <command>' to record the performance counter profile |
26 | of an arbitrary workload and save it into a perf data file. If both | 26 | of an arbitrary workload and save it into a perf data file. If both |
27 | --host and --guest are input, the perf data file name is perf.data.kvm. | 27 | --host and --guest are input, the perf data file name is perf.data.kvm. |
28 | If there is no --host but --guest, the file name is perf.data.guest. | 28 | If there is no --host but --guest, the file name is perf.data.guest. |
@@ -40,6 +40,12 @@ There are a couple of variants of perf kvm: | |||
40 | 40 | ||
41 | OPTIONS | 41 | OPTIONS |
42 | ------- | 42 | ------- |
43 | -i:: | ||
44 | --input=:: | ||
45 | Input file name. | ||
46 | -o:: | ||
47 | --output:: | ||
48 | Output file name. | ||
43 | --host=:: | 49 | --host=:: |
44 | Collect host side performance profile. | 50 | Collect host side performance profile. |
45 | --guest=:: | 51 | --guest=:: |
diff --git a/tools/perf/Documentation/perf-lock.txt b/tools/perf/Documentation/perf-lock.txt index b317102138c8..921de259ea10 100644 --- a/tools/perf/Documentation/perf-lock.txt +++ b/tools/perf/Documentation/perf-lock.txt | |||
@@ -24,6 +24,21 @@ and statistics with this 'perf lock' command. | |||
24 | 24 | ||
25 | 'perf lock report' reports statistical data. | 25 | 'perf lock report' reports statistical data. |
26 | 26 | ||
27 | OPTIONS | ||
28 | ------- | ||
29 | |||
30 | -i:: | ||
31 | --input=<file>:: | ||
32 | Input file name. | ||
33 | |||
34 | -v:: | ||
35 | --verbose:: | ||
36 | Be more verbose (show symbol address, etc). | ||
37 | |||
38 | -D:: | ||
39 | --dump-raw-trace:: | ||
40 | Dump raw trace in ASCII. | ||
41 | |||
27 | SEE ALSO | 42 | SEE ALSO |
28 | -------- | 43 | -------- |
29 | linkperf:perf[1] | 44 | linkperf:perf[1] |
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt index 62de1b7f4e76..86b797a35aa6 100644 --- a/tools/perf/Documentation/perf-probe.txt +++ b/tools/perf/Documentation/perf-probe.txt | |||
@@ -115,9 +115,9 @@ Each probe argument follows below syntax. | |||
115 | 115 | ||
116 | LINE SYNTAX | 116 | LINE SYNTAX |
117 | ----------- | 117 | ----------- |
118 | Line range is descripted by following syntax. | 118 | Line range is described by following syntax. |
119 | 119 | ||
120 | "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]" | 120 | "FUNC[:RLN[+NUM|-RLN2]]|SRC[:ALN[+NUM|-ALN2]]" |
121 | 121 | ||
122 | FUNC specifies the function name of showing lines. 'RLN' is the start line | 122 | FUNC specifies the function name of showing lines. 'RLN' is the start line |
123 | number from function entry line, and 'RLN2' is the end line number. As same as | 123 | number from function entry line, and 'RLN2' is the end line number. As same as |
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index a91f9f9e6e5c..52462ae26455 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt | |||
@@ -39,15 +39,24 @@ OPTIONS | |||
39 | be passed as follows: '\mem:addr[:[r][w][x]]'. | 39 | be passed as follows: '\mem:addr[:[r][w][x]]'. |
40 | If you want to profile read-write accesses in 0x1000, just set | 40 | If you want to profile read-write accesses in 0x1000, just set |
41 | 'mem:0x1000:rw'. | 41 | 'mem:0x1000:rw'. |
42 | |||
43 | --filter=<filter>:: | ||
44 | Event filter. | ||
45 | |||
42 | -a:: | 46 | -a:: |
43 | System-wide collection. | 47 | --all-cpus:: |
48 | System-wide collection from all CPUs. | ||
44 | 49 | ||
45 | -l:: | 50 | -l:: |
46 | Scale counter values. | 51 | Scale counter values. |
47 | 52 | ||
48 | -p:: | 53 | -p:: |
49 | --pid=:: | 54 | --pid=:: |
50 | Record events on existing pid. | 55 | Record events on existing process ID. |
56 | |||
57 | -t:: | ||
58 | --tid=:: | ||
59 | Record events on existing thread ID. | ||
51 | 60 | ||
52 | -r:: | 61 | -r:: |
53 | --realtime=:: | 62 | --realtime=:: |
@@ -99,6 +108,11 @@ OPTIONS | |||
99 | --data:: | 108 | --data:: |
100 | Sample addresses. | 109 | Sample addresses. |
101 | 110 | ||
111 | -T:: | ||
112 | --timestamp:: | ||
113 | Sample timestamps. Use it with 'perf report -D' to see the timestamps, | ||
114 | for instance. | ||
115 | |||
102 | -n:: | 116 | -n:: |
103 | --no-samples:: | 117 | --no-samples:: |
104 | Don't sample. | 118 | Don't sample. |
@@ -109,8 +123,8 @@ Collect raw sample records from all opened counters (default for tracepoint coun | |||
109 | 123 | ||
110 | -C:: | 124 | -C:: |
111 | --cpu:: | 125 | --cpu:: |
112 | Collect samples only on the list of cpus provided. Multiple CPUs can be provided as a | 126 | Collect samples only on the list of CPUs provided. Multiple CPUs can be provided as a |
113 | comma-sperated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. | 127 | comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. |
114 | In per-thread mode with inheritance mode on (default), samples are captured only when | 128 | In per-thread mode with inheritance mode on (default), samples are captured only when |
115 | the thread executes on the designated CPUs. Default is to monitor all CPUs. | 129 | the thread executes on the designated CPUs. Default is to monitor all CPUs. |
116 | 130 | ||
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index 12052c9ed0ba..8ba03d6e5398 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt | |||
@@ -20,6 +20,11 @@ OPTIONS | |||
20 | -i:: | 20 | -i:: |
21 | --input=:: | 21 | --input=:: |
22 | Input file name. (default: perf.data) | 22 | Input file name. (default: perf.data) |
23 | |||
24 | -v:: | ||
25 | --verbose:: | ||
26 | Be more verbose. (show symbol address, etc) | ||
27 | |||
23 | -d:: | 28 | -d:: |
24 | --dsos=:: | 29 | --dsos=:: |
25 | Only consider symbols in these dsos. CSV that understands | 30 | Only consider symbols in these dsos. CSV that understands |
@@ -27,6 +32,10 @@ OPTIONS | |||
27 | -n:: | 32 | -n:: |
28 | --show-nr-samples:: | 33 | --show-nr-samples:: |
29 | Show the number of samples for each symbol | 34 | Show the number of samples for each symbol |
35 | |||
36 | --showcpuutilization:: | ||
37 | Show sample percentage for different cpu modes. | ||
38 | |||
30 | -T:: | 39 | -T:: |
31 | --threads:: | 40 | --threads:: |
32 | Show per-thread event counters | 41 | Show per-thread event counters |
@@ -39,12 +48,24 @@ OPTIONS | |||
39 | Only consider these symbols. CSV that understands | 48 | Only consider these symbols. CSV that understands |
40 | file://filename entries. | 49 | file://filename entries. |
41 | 50 | ||
51 | -U:: | ||
52 | --hide-unresolved:: | ||
53 | Only display entries resolved to a symbol. | ||
54 | |||
42 | -s:: | 55 | -s:: |
43 | --sort=:: | 56 | --sort=:: |
44 | Sort by key(s): pid, comm, dso, symbol, parent. | 57 | Sort by key(s): pid, comm, dso, symbol, parent. |
45 | 58 | ||
59 | -p:: | ||
60 | --parent=<regex>:: | ||
61 | regex filter to identify parent, see: '--sort parent' | ||
62 | |||
63 | -x:: | ||
64 | --exclude-other:: | ||
65 | Only display entries with parent-match. | ||
66 | |||
46 | -w:: | 67 | -w:: |
47 | --field-width=:: | 68 | --column-widths=<width[,width...]>:: |
48 | Force each column width to the provided list, for large terminal | 69 | Force each column width to the provided list, for large terminal |
49 | readability. | 70 | readability. |
50 | 71 | ||
@@ -52,19 +73,26 @@ OPTIONS | |||
52 | --field-separator=:: | 73 | --field-separator=:: |
53 | 74 | ||
54 | Use a special separator character and don't pad with spaces, replacing | 75 | Use a special separator character and don't pad with spaces, replacing |
55 | all occurances of this separator in symbol names (and other output) | 76 | all occurrences of this separator in symbol names (and other output) |
56 | with a '.' character, that thus it's the only non valid separator. | 77 | with a '.' character, that thus it's the only non valid separator. |
57 | 78 | ||
79 | -D:: | ||
80 | --dump-raw-trace:: | ||
81 | Dump raw trace in ASCII. | ||
82 | |||
58 | -g [type,min]:: | 83 | -g [type,min]:: |
59 | --call-graph:: | 84 | --call-graph:: |
60 | Display callchains using type and min percent threshold. | 85 | Display call chains using type and min percent threshold. |
61 | type can be either: | 86 | type can be either: |
62 | - flat: single column, linear exposure of callchains. | 87 | - flat: single column, linear exposure of call chains. |
63 | - graph: use a graph tree, displaying absolute overhead rates. | 88 | - graph: use a graph tree, displaying absolute overhead rates. |
64 | - fractal: like graph, but displays relative rates. Each branch of | 89 | - fractal: like graph, but displays relative rates. Each branch of |
65 | the tree is considered as a new profiled object. + | 90 | the tree is considered as a new profiled object. + |
66 | Default: fractal,0.5. | 91 | Default: fractal,0.5. |
67 | 92 | ||
93 | --pretty=<key>:: | ||
94 | Pretty printing style. key: normal, raw | ||
95 | |||
68 | --stdio:: Use the stdio interface. | 96 | --stdio:: Use the stdio interface. |
69 | 97 | ||
70 | --tui:: Use the TUI interface, that is integrated with annotate and allows | 98 | --tui:: Use the TUI interface, that is integrated with annotate and allows |
@@ -72,6 +100,25 @@ OPTIONS | |||
72 | requires a tty, if one is not present, as when piping to other | 100 | requires a tty, if one is not present, as when piping to other |
73 | commands, the stdio interface is used. | 101 | commands, the stdio interface is used. |
74 | 102 | ||
103 | -k:: | ||
104 | --vmlinux=<file>:: | ||
105 | vmlinux pathname | ||
106 | |||
107 | --kallsyms=<file>:: | ||
108 | kallsyms pathname | ||
109 | |||
110 | -m:: | ||
111 | --modules:: | ||
112 | Load module symbols. WARNING: This should only be used with -k and | ||
113 | a LIVE kernel. | ||
114 | |||
115 | -f:: | ||
116 | --force:: | ||
117 | Don't complain, do it. | ||
118 | |||
119 | --symfs=<directory>:: | ||
120 | Look for files with symbols relative to this directory. | ||
121 | |||
75 | SEE ALSO | 122 | SEE ALSO |
76 | -------- | 123 | -------- |
77 | linkperf:perf-stat[1] | 124 | linkperf:perf-stat[1] |
diff --git a/tools/perf/Documentation/perf-sched.txt b/tools/perf/Documentation/perf-sched.txt index 8417644a6166..46822d5fde1c 100644 --- a/tools/perf/Documentation/perf-sched.txt +++ b/tools/perf/Documentation/perf-sched.txt | |||
@@ -8,11 +8,11 @@ perf-sched - Tool to trace/measure scheduler properties (latencies) | |||
8 | SYNOPSIS | 8 | SYNOPSIS |
9 | -------- | 9 | -------- |
10 | [verse] | 10 | [verse] |
11 | 'perf sched' {record|latency|replay|trace} | 11 | 'perf sched' {record|latency|map|replay|trace} |
12 | 12 | ||
13 | DESCRIPTION | 13 | DESCRIPTION |
14 | ----------- | 14 | ----------- |
15 | There are four variants of perf sched: | 15 | There are five variants of perf sched: |
16 | 16 | ||
17 | 'perf sched record <command>' to record the scheduling events | 17 | 'perf sched record <command>' to record the scheduling events |
18 | of an arbitrary workload. | 18 | of an arbitrary workload. |
@@ -30,8 +30,22 @@ There are four variants of perf sched: | |||
30 | of the workload as it occurred when it was recorded - and can repeat | 30 | of the workload as it occurred when it was recorded - and can repeat |
31 | it a number of times, measuring its performance.) | 31 | it a number of times, measuring its performance.) |
32 | 32 | ||
33 | 'perf sched map' to print a textual context-switching outline of | ||
34 | workload captured via perf sched record. Columns stand for | ||
35 | individual CPUs, and the two-letter shortcuts stand for tasks that | ||
36 | are running on a CPU. A '*' denotes the CPU that had the event, and | ||
37 | a dot signals an idle CPU. | ||
38 | |||
33 | OPTIONS | 39 | OPTIONS |
34 | ------- | 40 | ------- |
41 | -i:: | ||
42 | --input=<file>:: | ||
43 | Input file name. (default: perf.data) | ||
44 | |||
45 | -v:: | ||
46 | --verbose:: | ||
47 | Be more verbose. (show symbol address, etc) | ||
48 | |||
35 | -D:: | 49 | -D:: |
36 | --dump-raw-trace=:: | 50 | --dump-raw-trace=:: |
37 | Display verbose dump of the sched data. | 51 | Display verbose dump of the sched data. |
diff --git a/tools/perf/Documentation/perf-trace-perl.txt b/tools/perf/Documentation/perf-script-perl.txt index ee6525ee6d69..5bb41e55a3ac 100644 --- a/tools/perf/Documentation/perf-trace-perl.txt +++ b/tools/perf/Documentation/perf-script-perl.txt | |||
@@ -1,19 +1,19 @@ | |||
1 | perf-trace-perl(1) | 1 | perf-script-perl(1) |
2 | ================== | 2 | ================== |
3 | 3 | ||
4 | NAME | 4 | NAME |
5 | ---- | 5 | ---- |
6 | perf-trace-perl - Process trace data with a Perl script | 6 | perf-script-perl - Process trace data with a Perl script |
7 | 7 | ||
8 | SYNOPSIS | 8 | SYNOPSIS |
9 | -------- | 9 | -------- |
10 | [verse] | 10 | [verse] |
11 | 'perf trace' [-s [Perl]:script[.pl] ] | 11 | 'perf script' [-s [Perl]:script[.pl] ] |
12 | 12 | ||
13 | DESCRIPTION | 13 | DESCRIPTION |
14 | ----------- | 14 | ----------- |
15 | 15 | ||
16 | This perf trace option is used to process perf trace data using perf's | 16 | This perf script option is used to process perf script data using perf's |
17 | built-in Perl interpreter. It reads and processes the input file and | 17 | built-in Perl interpreter. It reads and processes the input file and |
18 | displays the results of the trace analysis implemented in the given | 18 | displays the results of the trace analysis implemented in the given |
19 | Perl script, if any. | 19 | Perl script, if any. |
@@ -21,7 +21,7 @@ Perl script, if any. | |||
21 | STARTER SCRIPTS | 21 | STARTER SCRIPTS |
22 | --------------- | 22 | --------------- |
23 | 23 | ||
24 | You can avoid reading the rest of this document by running 'perf trace | 24 | You can avoid reading the rest of this document by running 'perf script |
25 | -g perl' in the same directory as an existing perf.data trace file. | 25 | -g perl' in the same directory as an existing perf.data trace file. |
26 | That will generate a starter script containing a handler for each of | 26 | That will generate a starter script containing a handler for each of |
27 | the event types in the trace file; it simply prints every available | 27 | the event types in the trace file; it simply prints every available |
@@ -30,13 +30,13 @@ field for each event in the trace file. | |||
30 | You can also look at the existing scripts in | 30 | You can also look at the existing scripts in |
31 | ~/libexec/perf-core/scripts/perl for typical examples showing how to | 31 | ~/libexec/perf-core/scripts/perl for typical examples showing how to |
32 | do basic things like aggregate event data, print results, etc. Also, | 32 | do basic things like aggregate event data, print results, etc. Also, |
33 | the check-perf-trace.pl script, while not interesting for its results, | 33 | the check-perf-script.pl script, while not interesting for its results, |
34 | attempts to exercise all of the main scripting features. | 34 | attempts to exercise all of the main scripting features. |
35 | 35 | ||
36 | EVENT HANDLERS | 36 | EVENT HANDLERS |
37 | -------------- | 37 | -------------- |
38 | 38 | ||
39 | When perf trace is invoked using a trace script, a user-defined | 39 | When perf script is invoked using a trace script, a user-defined |
40 | 'handler function' is called for each event in the trace. If there's | 40 | 'handler function' is called for each event in the trace. If there's |
41 | no handler function defined for a given event type, the event is | 41 | no handler function defined for a given event type, the event is |
42 | ignored (or passed to a 'trace_handled' function, see below) and the | 42 | ignored (or passed to a 'trace_handled' function, see below) and the |
@@ -112,13 +112,13 @@ write a useful trace script. The sections below cover the rest. | |||
112 | SCRIPT LAYOUT | 112 | SCRIPT LAYOUT |
113 | ------------- | 113 | ------------- |
114 | 114 | ||
115 | Every perf trace Perl script should start by setting up a Perl module | 115 | Every perf script Perl script should start by setting up a Perl module |
116 | search path and 'use'ing a few support modules (see module | 116 | search path and 'use'ing a few support modules (see module |
117 | descriptions below): | 117 | descriptions below): |
118 | 118 | ||
119 | ---- | 119 | ---- |
120 | use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib"; | 120 | use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/perf-script-Util/lib"; |
121 | use lib "./Perf-Trace-Util/lib"; | 121 | use lib "./perf-script-Util/lib"; |
122 | use Perf::Trace::Core; | 122 | use Perf::Trace::Core; |
123 | use Perf::Trace::Context; | 123 | use Perf::Trace::Context; |
124 | use Perf::Trace::Util; | 124 | use Perf::Trace::Util; |
@@ -162,7 +162,7 @@ sub trace_unhandled | |||
162 | ---- | 162 | ---- |
163 | 163 | ||
164 | The remaining sections provide descriptions of each of the available | 164 | The remaining sections provide descriptions of each of the available |
165 | built-in perf trace Perl modules and their associated functions. | 165 | built-in perf script Perl modules and their associated functions. |
166 | 166 | ||
167 | AVAILABLE MODULES AND FUNCTIONS | 167 | AVAILABLE MODULES AND FUNCTIONS |
168 | ------------------------------- | 168 | ------------------------------- |
@@ -170,7 +170,7 @@ AVAILABLE MODULES AND FUNCTIONS | |||
170 | The following sections describe the functions and variables available | 170 | The following sections describe the functions and variables available |
171 | via the various Perf::Trace::* Perl modules. To use the functions and | 171 | via the various Perf::Trace::* Perl modules. To use the functions and |
172 | variables from the given module, add the corresponding 'use | 172 | variables from the given module, add the corresponding 'use |
173 | Perf::Trace::XXX' line to your perf trace script. | 173 | Perf::Trace::XXX' line to your perf script script. |
174 | 174 | ||
175 | Perf::Trace::Core Module | 175 | Perf::Trace::Core Module |
176 | ~~~~~~~~~~~~~~~~~~~~~~~~ | 176 | ~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -204,7 +204,7 @@ argument. | |||
204 | Perf::Trace::Util Module | 204 | Perf::Trace::Util Module |
205 | ~~~~~~~~~~~~~~~~~~~~~~~~ | 205 | ~~~~~~~~~~~~~~~~~~~~~~~~ |
206 | 206 | ||
207 | Various utility functions for use with perf trace: | 207 | Various utility functions for use with perf script: |
208 | 208 | ||
209 | nsecs($secs, $nsecs) - returns total nsecs given secs/nsecs pair | 209 | nsecs($secs, $nsecs) - returns total nsecs given secs/nsecs pair |
210 | nsecs_secs($nsecs) - returns whole secs portion given nsecs | 210 | nsecs_secs($nsecs) - returns whole secs portion given nsecs |
@@ -214,4 +214,4 @@ Various utility functions for use with perf trace: | |||
214 | 214 | ||
215 | SEE ALSO | 215 | SEE ALSO |
216 | -------- | 216 | -------- |
217 | linkperf:perf-trace[1] | 217 | linkperf:perf-script[1] |
diff --git a/tools/perf/Documentation/perf-trace-python.txt b/tools/perf/Documentation/perf-script-python.txt index 693be804dd3d..36b38277422c 100644 --- a/tools/perf/Documentation/perf-trace-python.txt +++ b/tools/perf/Documentation/perf-script-python.txt | |||
@@ -1,19 +1,19 @@ | |||
1 | perf-trace-python(1) | 1 | perf-script-python(1) |
2 | ==================== | 2 | ==================== |
3 | 3 | ||
4 | NAME | 4 | NAME |
5 | ---- | 5 | ---- |
6 | perf-trace-python - Process trace data with a Python script | 6 | perf-script-python - Process trace data with a Python script |
7 | 7 | ||
8 | SYNOPSIS | 8 | SYNOPSIS |
9 | -------- | 9 | -------- |
10 | [verse] | 10 | [verse] |
11 | 'perf trace' [-s [Python]:script[.py] ] | 11 | 'perf script' [-s [Python]:script[.py] ] |
12 | 12 | ||
13 | DESCRIPTION | 13 | DESCRIPTION |
14 | ----------- | 14 | ----------- |
15 | 15 | ||
16 | This perf trace option is used to process perf trace data using perf's | 16 | This perf script option is used to process perf script data using perf's |
17 | built-in Python interpreter. It reads and processes the input file and | 17 | built-in Python interpreter. It reads and processes the input file and |
18 | displays the results of the trace analysis implemented in the given | 18 | displays the results of the trace analysis implemented in the given |
19 | Python script, if any. | 19 | Python script, if any. |
@@ -23,15 +23,15 @@ A QUICK EXAMPLE | |||
23 | 23 | ||
24 | This section shows the process, start to finish, of creating a working | 24 | This section shows the process, start to finish, of creating a working |
25 | Python script that aggregates and extracts useful information from a | 25 | Python script that aggregates and extracts useful information from a |
26 | raw perf trace stream. You can avoid reading the rest of this | 26 | raw perf script stream. You can avoid reading the rest of this |
27 | document if an example is enough for you; the rest of the document | 27 | document if an example is enough for you; the rest of the document |
28 | provides more details on each step and lists the library functions | 28 | provides more details on each step and lists the library functions |
29 | available to script writers. | 29 | available to script writers. |
30 | 30 | ||
31 | This example actually details the steps that were used to create the | 31 | This example actually details the steps that were used to create the |
32 | 'syscall-counts' script you see when you list the available perf trace | 32 | 'syscall-counts' script you see when you list the available perf script |
33 | scripts via 'perf trace -l'. As such, this script also shows how to | 33 | scripts via 'perf script -l'. As such, this script also shows how to |
34 | integrate your script into the list of general-purpose 'perf trace' | 34 | integrate your script into the list of general-purpose 'perf script' |
35 | scripts listed by that command. | 35 | scripts listed by that command. |
36 | 36 | ||
37 | The syscall-counts script is a simple script, but demonstrates all the | 37 | The syscall-counts script is a simple script, but demonstrates all the |
@@ -105,31 +105,31 @@ That single stream will be recorded in a file in the current directory | |||
105 | called perf.data. | 105 | called perf.data. |
106 | 106 | ||
107 | Once we have a perf.data file containing our data, we can use the -g | 107 | Once we have a perf.data file containing our data, we can use the -g |
108 | 'perf trace' option to generate a Python script that will contain a | 108 | 'perf script' option to generate a Python script that will contain a |
109 | callback handler for each event type found in the perf.data trace | 109 | callback handler for each event type found in the perf.data trace |
110 | stream (for more details, see the STARTER SCRIPTS section). | 110 | stream (for more details, see the STARTER SCRIPTS section). |
111 | 111 | ||
112 | ---- | 112 | ---- |
113 | # perf trace -g python | 113 | # perf script -g python |
114 | generated Python script: perf-trace.py | 114 | generated Python script: perf-script.py |
115 | 115 | ||
116 | The output file created also in the current directory is named | 116 | The output file created also in the current directory is named |
117 | perf-trace.py. Here's the file in its entirety: | 117 | perf-script.py. Here's the file in its entirety: |
118 | 118 | ||
119 | # perf trace event handlers, generated by perf trace -g python | 119 | # perf script event handlers, generated by perf script -g python |
120 | # Licensed under the terms of the GNU GPL License version 2 | 120 | # Licensed under the terms of the GNU GPL License version 2 |
121 | 121 | ||
122 | # The common_* event handler fields are the most useful fields common to | 122 | # The common_* event handler fields are the most useful fields common to |
123 | # all events. They don't necessarily correspond to the 'common_*' fields | 123 | # all events. They don't necessarily correspond to the 'common_*' fields |
124 | # in the format files. Those fields not available as handler params can | 124 | # in the format files. Those fields not available as handler params can |
125 | # be retrieved using Python functions of the form common_*(context). | 125 | # be retrieved using Python functions of the form common_*(context). |
126 | # See the perf-trace-python Documentation for the list of available functions. | 126 | # See the perf-script-python Documentation for the list of available functions. |
127 | 127 | ||
128 | import os | 128 | import os |
129 | import sys | 129 | import sys |
130 | 130 | ||
131 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ | 131 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ |
132 | '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') | 132 | '/scripts/python/perf-script-Util/lib/Perf/Trace') |
133 | 133 | ||
134 | from perf_trace_context import * | 134 | from perf_trace_context import * |
135 | from Core import * | 135 | from Core import * |
@@ -160,7 +160,7 @@ def print_header(event_name, cpu, secs, nsecs, pid, comm): | |||
160 | ---- | 160 | ---- |
161 | 161 | ||
162 | At the top is a comment block followed by some import statements and a | 162 | At the top is a comment block followed by some import statements and a |
163 | path append which every perf trace script should include. | 163 | path append which every perf script script should include. |
164 | 164 | ||
165 | Following that are a couple generated functions, trace_begin() and | 165 | Following that are a couple generated functions, trace_begin() and |
166 | trace_end(), which are called at the beginning and the end of the | 166 | trace_end(), which are called at the beginning and the end of the |
@@ -189,8 +189,8 @@ simply a utility function used for that purpose. Let's rename the | |||
189 | script and run it to see the default output: | 189 | script and run it to see the default output: |
190 | 190 | ||
191 | ---- | 191 | ---- |
192 | # mv perf-trace.py syscall-counts.py | 192 | # mv perf-script.py syscall-counts.py |
193 | # perf trace -s syscall-counts.py | 193 | # perf script -s syscall-counts.py |
194 | 194 | ||
195 | raw_syscalls__sys_enter 1 00840.847582083 7506 perf id=1, args= | 195 | raw_syscalls__sys_enter 1 00840.847582083 7506 perf id=1, args= |
196 | raw_syscalls__sys_enter 1 00840.847595764 7506 perf id=1, args= | 196 | raw_syscalls__sys_enter 1 00840.847595764 7506 perf id=1, args= |
@@ -216,7 +216,7 @@ import os | |||
216 | import sys | 216 | import sys |
217 | 217 | ||
218 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ | 218 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ |
219 | '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') | 219 | '/scripts/python/perf-script-Util/lib/Perf/Trace') |
220 | 220 | ||
221 | from perf_trace_context import * | 221 | from perf_trace_context import * |
222 | from Core import * | 222 | from Core import * |
@@ -279,7 +279,7 @@ import os | |||
279 | import sys | 279 | import sys |
280 | 280 | ||
281 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ | 281 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ |
282 | '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') | 282 | '/scripts/python/perf-script-Util/lib/Perf/Trace') |
283 | 283 | ||
284 | from perf_trace_context import * | 284 | from perf_trace_context import * |
285 | from Core import * | 285 | from Core import * |
@@ -315,7 +315,7 @@ def print_syscall_totals(): | |||
315 | 315 | ||
316 | The script can be run just as before: | 316 | The script can be run just as before: |
317 | 317 | ||
318 | # perf trace -s syscall-counts.py | 318 | # perf script -s syscall-counts.py |
319 | 319 | ||
320 | So those are the essential steps in writing and running a script. The | 320 | So those are the essential steps in writing and running a script. The |
321 | process can be generalized to any tracepoint or set of tracepoints | 321 | process can be generalized to any tracepoint or set of tracepoints |
@@ -324,17 +324,17 @@ interested in by looking at the list of available events shown by | |||
324 | 'perf list' and/or look in /sys/kernel/debug/tracing events for | 324 | 'perf list' and/or look in /sys/kernel/debug/tracing events for |
325 | detailed event and field info, record the corresponding trace data | 325 | detailed event and field info, record the corresponding trace data |
326 | using 'perf record', passing it the list of interesting events, | 326 | using 'perf record', passing it the list of interesting events, |
327 | generate a skeleton script using 'perf trace -g python' and modify the | 327 | generate a skeleton script using 'perf script -g python' and modify the |
328 | code to aggregate and display it for your particular needs. | 328 | code to aggregate and display it for your particular needs. |
329 | 329 | ||
330 | After you've done that you may end up with a general-purpose script | 330 | After you've done that you may end up with a general-purpose script |
331 | that you want to keep around and have available for future use. By | 331 | that you want to keep around and have available for future use. By |
332 | writing a couple of very simple shell scripts and putting them in the | 332 | writing a couple of very simple shell scripts and putting them in the |
333 | right place, you can have your script listed alongside the other | 333 | right place, you can have your script listed alongside the other |
334 | scripts listed by the 'perf trace -l' command e.g.: | 334 | scripts listed by the 'perf script -l' command e.g.: |
335 | 335 | ||
336 | ---- | 336 | ---- |
337 | root@tropicana:~# perf trace -l | 337 | root@tropicana:~# perf script -l |
338 | List of available trace scripts: | 338 | List of available trace scripts: |
339 | workqueue-stats workqueue stats (ins/exe/create/destroy) | 339 | workqueue-stats workqueue stats (ins/exe/create/destroy) |
340 | wakeup-latency system-wide min/max/avg wakeup latency | 340 | wakeup-latency system-wide min/max/avg wakeup latency |
@@ -365,14 +365,14 @@ perf record -a -e raw_syscalls:sys_enter | |||
365 | The 'report' script is also a shell script with the same base name as | 365 | The 'report' script is also a shell script with the same base name as |
366 | your script, but with -report appended. It should also be located in | 366 | your script, but with -report appended. It should also be located in |
367 | the perf/scripts/python/bin directory. In that script, you write the | 367 | the perf/scripts/python/bin directory. In that script, you write the |
368 | 'perf trace -s' command-line needed for running your script: | 368 | 'perf script -s' command-line needed for running your script: |
369 | 369 | ||
370 | ---- | 370 | ---- |
371 | # cat kernel-source/tools/perf/scripts/python/bin/syscall-counts-report | 371 | # cat kernel-source/tools/perf/scripts/python/bin/syscall-counts-report |
372 | 372 | ||
373 | #!/bin/bash | 373 | #!/bin/bash |
374 | # description: system-wide syscall counts | 374 | # description: system-wide syscall counts |
375 | perf trace -s ~/libexec/perf-core/scripts/python/syscall-counts.py | 375 | perf script -s ~/libexec/perf-core/scripts/python/syscall-counts.py |
376 | ---- | 376 | ---- |
377 | 377 | ||
378 | Note that the location of the Python script given in the shell script | 378 | Note that the location of the Python script given in the shell script |
@@ -390,17 +390,17 @@ total 32 | |||
390 | drwxr-xr-x 4 trz trz 4096 2010-01-26 22:30 . | 390 | drwxr-xr-x 4 trz trz 4096 2010-01-26 22:30 . |
391 | drwxr-xr-x 4 trz trz 4096 2010-01-26 22:29 .. | 391 | drwxr-xr-x 4 trz trz 4096 2010-01-26 22:29 .. |
392 | drwxr-xr-x 2 trz trz 4096 2010-01-26 22:29 bin | 392 | drwxr-xr-x 2 trz trz 4096 2010-01-26 22:29 bin |
393 | -rw-r--r-- 1 trz trz 2548 2010-01-26 22:29 check-perf-trace.py | 393 | -rw-r--r-- 1 trz trz 2548 2010-01-26 22:29 check-perf-script.py |
394 | drwxr-xr-x 3 trz trz 4096 2010-01-26 22:49 Perf-Trace-Util | 394 | drwxr-xr-x 3 trz trz 4096 2010-01-26 22:49 perf-script-Util |
395 | -rw-r--r-- 1 trz trz 1462 2010-01-26 22:30 syscall-counts.py | 395 | -rw-r--r-- 1 trz trz 1462 2010-01-26 22:30 syscall-counts.py |
396 | ---- | 396 | ---- |
397 | 397 | ||
398 | Once you've done that (don't forget to do a new 'make install', | 398 | Once you've done that (don't forget to do a new 'make install', |
399 | otherwise your script won't show up at run-time), 'perf trace -l' | 399 | otherwise your script won't show up at run-time), 'perf script -l' |
400 | should show a new entry for your script: | 400 | should show a new entry for your script: |
401 | 401 | ||
402 | ---- | 402 | ---- |
403 | root@tropicana:~# perf trace -l | 403 | root@tropicana:~# perf script -l |
404 | List of available trace scripts: | 404 | List of available trace scripts: |
405 | workqueue-stats workqueue stats (ins/exe/create/destroy) | 405 | workqueue-stats workqueue stats (ins/exe/create/destroy) |
406 | wakeup-latency system-wide min/max/avg wakeup latency | 406 | wakeup-latency system-wide min/max/avg wakeup latency |
@@ -409,19 +409,19 @@ List of available trace scripts: | |||
409 | syscall-counts system-wide syscall counts | 409 | syscall-counts system-wide syscall counts |
410 | ---- | 410 | ---- |
411 | 411 | ||
412 | You can now perform the record step via 'perf trace record': | 412 | You can now perform the record step via 'perf script record': |
413 | 413 | ||
414 | # perf trace record syscall-counts | 414 | # perf script record syscall-counts |
415 | 415 | ||
416 | and display the output using 'perf trace report': | 416 | and display the output using 'perf script report': |
417 | 417 | ||
418 | # perf trace report syscall-counts | 418 | # perf script report syscall-counts |
419 | 419 | ||
420 | STARTER SCRIPTS | 420 | STARTER SCRIPTS |
421 | --------------- | 421 | --------------- |
422 | 422 | ||
423 | You can quickly get started writing a script for a particular set of | 423 | You can quickly get started writing a script for a particular set of |
424 | trace data by generating a skeleton script using 'perf trace -g | 424 | trace data by generating a skeleton script using 'perf script -g |
425 | python' in the same directory as an existing perf.data trace file. | 425 | python' in the same directory as an existing perf.data trace file. |
426 | That will generate a starter script containing a handler for each of | 426 | That will generate a starter script containing a handler for each of |
427 | the event types in the trace file; it simply prints every available | 427 | the event types in the trace file; it simply prints every available |
@@ -430,13 +430,13 @@ field for each event in the trace file. | |||
430 | You can also look at the existing scripts in | 430 | You can also look at the existing scripts in |
431 | ~/libexec/perf-core/scripts/python for typical examples showing how to | 431 | ~/libexec/perf-core/scripts/python for typical examples showing how to |
432 | do basic things like aggregate event data, print results, etc. Also, | 432 | do basic things like aggregate event data, print results, etc. Also, |
433 | the check-perf-trace.py script, while not interesting for its results, | 433 | the check-perf-script.py script, while not interesting for its results, |
434 | attempts to exercise all of the main scripting features. | 434 | attempts to exercise all of the main scripting features. |
435 | 435 | ||
436 | EVENT HANDLERS | 436 | EVENT HANDLERS |
437 | -------------- | 437 | -------------- |
438 | 438 | ||
439 | When perf trace is invoked using a trace script, a user-defined | 439 | When perf script is invoked using a trace script, a user-defined |
440 | 'handler function' is called for each event in the trace. If there's | 440 | 'handler function' is called for each event in the trace. If there's |
441 | no handler function defined for a given event type, the event is | 441 | no handler function defined for a given event type, the event is |
442 | ignored (or passed to a 'trace_handled' function, see below) and the | 442 | ignored (or passed to a 'trace_handled' function, see below) and the |
@@ -510,7 +510,7 @@ write a useful trace script. The sections below cover the rest. | |||
510 | SCRIPT LAYOUT | 510 | SCRIPT LAYOUT |
511 | ------------- | 511 | ------------- |
512 | 512 | ||
513 | Every perf trace Python script should start by setting up a Python | 513 | Every perf script Python script should start by setting up a Python |
514 | module search path and 'import'ing a few support modules (see module | 514 | module search path and 'import'ing a few support modules (see module |
515 | descriptions below): | 515 | descriptions below): |
516 | 516 | ||
@@ -519,7 +519,7 @@ descriptions below): | |||
519 | import sys | 519 | import sys |
520 | 520 | ||
521 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ | 521 | sys.path.append(os.environ['PERF_EXEC_PATH'] + \ |
522 | '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') | 522 | '/scripts/python/perf-script-Util/lib/Perf/Trace') |
523 | 523 | ||
524 | from perf_trace_context import * | 524 | from perf_trace_context import * |
525 | from Core import * | 525 | from Core import * |
@@ -559,15 +559,15 @@ def trace_unhandled(event_name, context, common_cpu, common_secs, | |||
559 | ---- | 559 | ---- |
560 | 560 | ||
561 | The remaining sections provide descriptions of each of the available | 561 | The remaining sections provide descriptions of each of the available |
562 | built-in perf trace Python modules and their associated functions. | 562 | built-in perf script Python modules and their associated functions. |
563 | 563 | ||
564 | AVAILABLE MODULES AND FUNCTIONS | 564 | AVAILABLE MODULES AND FUNCTIONS |
565 | ------------------------------- | 565 | ------------------------------- |
566 | 566 | ||
567 | The following sections describe the functions and variables available | 567 | The following sections describe the functions and variables available |
568 | via the various perf trace Python modules. To use the functions and | 568 | via the various perf script Python modules. To use the functions and |
569 | variables from the given module, add the corresponding 'from XXXX | 569 | variables from the given module, add the corresponding 'from XXXX |
570 | import' line to your perf trace script. | 570 | import' line to your perf script script. |
571 | 571 | ||
572 | Core.py Module | 572 | Core.py Module |
573 | ~~~~~~~~~~~~~~ | 573 | ~~~~~~~~~~~~~~ |
@@ -610,7 +610,7 @@ argument. | |||
610 | Util.py Module | 610 | Util.py Module |
611 | ~~~~~~~~~~~~~~ | 611 | ~~~~~~~~~~~~~~ |
612 | 612 | ||
613 | Various utility functions for use with perf trace: | 613 | Various utility functions for use with perf script: |
614 | 614 | ||
615 | nsecs(secs, nsecs) - returns total nsecs given secs/nsecs pair | 615 | nsecs(secs, nsecs) - returns total nsecs given secs/nsecs pair |
616 | nsecs_secs(nsecs) - returns whole secs portion given nsecs | 616 | nsecs_secs(nsecs) - returns whole secs portion given nsecs |
@@ -620,4 +620,4 @@ Various utility functions for use with perf trace: | |||
620 | 620 | ||
621 | SEE ALSO | 621 | SEE ALSO |
622 | -------- | 622 | -------- |
623 | linkperf:perf-trace[1] | 623 | linkperf:perf-script[1] |
diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-script.txt index 26aff6bf9e50..29ad94293cd2 100644 --- a/tools/perf/Documentation/perf-trace.txt +++ b/tools/perf/Documentation/perf-script.txt | |||
@@ -1,71 +1,71 @@ | |||
1 | perf-trace(1) | 1 | perf-script(1) |
2 | ============= | 2 | ============= |
3 | 3 | ||
4 | NAME | 4 | NAME |
5 | ---- | 5 | ---- |
6 | perf-trace - Read perf.data (created by perf record) and display trace output | 6 | perf-script - Read perf.data (created by perf record) and display trace output |
7 | 7 | ||
8 | SYNOPSIS | 8 | SYNOPSIS |
9 | -------- | 9 | -------- |
10 | [verse] | 10 | [verse] |
11 | 'perf trace' [<options>] | 11 | 'perf script' [<options>] |
12 | 'perf trace' [<options>] record <script> [<record-options>] <command> | 12 | 'perf script' [<options>] record <script> [<record-options>] <command> |
13 | 'perf trace' [<options>] report <script> [script-args] | 13 | 'perf script' [<options>] report <script> [script-args] |
14 | 'perf trace' [<options>] <script> <required-script-args> [<record-options>] <command> | 14 | 'perf script' [<options>] <script> <required-script-args> [<record-options>] <command> |
15 | 'perf trace' [<options>] <top-script> [script-args] | 15 | 'perf script' [<options>] <top-script> [script-args] |
16 | 16 | ||
17 | DESCRIPTION | 17 | DESCRIPTION |
18 | ----------- | 18 | ----------- |
19 | This command reads the input file and displays the trace recorded. | 19 | This command reads the input file and displays the trace recorded. |
20 | 20 | ||
21 | There are several variants of perf trace: | 21 | There are several variants of perf script: |
22 | 22 | ||
23 | 'perf trace' to see a detailed trace of the workload that was | 23 | 'perf script' to see a detailed trace of the workload that was |
24 | recorded. | 24 | recorded. |
25 | 25 | ||
26 | You can also run a set of pre-canned scripts that aggregate and | 26 | You can also run a set of pre-canned scripts that aggregate and |
27 | summarize the raw trace data in various ways (the list of scripts is | 27 | summarize the raw trace data in various ways (the list of scripts is |
28 | available via 'perf trace -l'). The following variants allow you to | 28 | available via 'perf script -l'). The following variants allow you to |
29 | record and run those scripts: | 29 | record and run those scripts: |
30 | 30 | ||
31 | 'perf trace record <script> <command>' to record the events required | 31 | 'perf script record <script> <command>' to record the events required |
32 | for 'perf trace report'. <script> is the name displayed in the | 32 | for 'perf script report'. <script> is the name displayed in the |
33 | output of 'perf trace --list' i.e. the actual script name minus any | 33 | output of 'perf script --list' i.e. the actual script name minus any |
34 | language extension. If <command> is not specified, the events are | 34 | language extension. If <command> is not specified, the events are |
35 | recorded using the -a (system-wide) 'perf record' option. | 35 | recorded using the -a (system-wide) 'perf record' option. |
36 | 36 | ||
37 | 'perf trace report <script> [args]' to run and display the results | 37 | 'perf script report <script> [args]' to run and display the results |
38 | of <script>. <script> is the name displayed in the output of 'perf | 38 | of <script>. <script> is the name displayed in the output of 'perf |
39 | trace --list' i.e. the actual script name minus any language | 39 | trace --list' i.e. the actual script name minus any language |
40 | extension. The perf.data output from a previous run of 'perf trace | 40 | extension. The perf.data output from a previous run of 'perf script |
41 | record <script>' is used and should be present for this command to | 41 | record <script>' is used and should be present for this command to |
42 | succeed. [args] refers to the (mainly optional) args expected by | 42 | succeed. [args] refers to the (mainly optional) args expected by |
43 | the script. | 43 | the script. |
44 | 44 | ||
45 | 'perf trace <script> <required-script-args> <command>' to both | 45 | 'perf script <script> <required-script-args> <command>' to both |
46 | record the events required for <script> and to run the <script> | 46 | record the events required for <script> and to run the <script> |
47 | using 'live-mode' i.e. without writing anything to disk. <script> | 47 | using 'live-mode' i.e. without writing anything to disk. <script> |
48 | is the name displayed in the output of 'perf trace --list' i.e. the | 48 | is the name displayed in the output of 'perf script --list' i.e. the |
49 | actual script name minus any language extension. If <command> is | 49 | actual script name minus any language extension. If <command> is |
50 | not specified, the events are recorded using the -a (system-wide) | 50 | not specified, the events are recorded using the -a (system-wide) |
51 | 'perf record' option. If <script> has any required args, they | 51 | 'perf record' option. If <script> has any required args, they |
52 | should be specified before <command>. This mode doesn't allow for | 52 | should be specified before <command>. This mode doesn't allow for |
53 | optional script args to be specified; if optional script args are | 53 | optional script args to be specified; if optional script args are |
54 | desired, they can be specified using separate 'perf trace record' | 54 | desired, they can be specified using separate 'perf script record' |
55 | and 'perf trace report' commands, with the stdout of the record step | 55 | and 'perf script report' commands, with the stdout of the record step |
56 | piped to the stdin of the report script, using the '-o -' and '-i -' | 56 | piped to the stdin of the report script, using the '-o -' and '-i -' |
57 | options of the corresponding commands. | 57 | options of the corresponding commands. |
58 | 58 | ||
59 | 'perf trace <top-script>' to both record the events required for | 59 | 'perf script <top-script>' to both record the events required for |
60 | <top-script> and to run the <top-script> using 'live-mode' | 60 | <top-script> and to run the <top-script> using 'live-mode' |
61 | i.e. without writing anything to disk. <top-script> is the name | 61 | i.e. without writing anything to disk. <top-script> is the name |
62 | displayed in the output of 'perf trace --list' i.e. the actual | 62 | displayed in the output of 'perf script --list' i.e. the actual |
63 | script name minus any language extension; a <top-script> is defined | 63 | script name minus any language extension; a <top-script> is defined |
64 | as any script name ending with the string 'top'. | 64 | as any script name ending with the string 'top'. |
65 | 65 | ||
66 | [<record-options>] can be passed to the record steps of 'perf trace | 66 | [<record-options>] can be passed to the record steps of 'perf script |
67 | record' and 'live-mode' variants; this isn't possible however for | 67 | record' and 'live-mode' variants; this isn't possible however for |
68 | <top-script> 'live-mode' or 'perf trace report' variants. | 68 | <top-script> 'live-mode' or 'perf script report' variants. |
69 | 69 | ||
70 | See the 'SEE ALSO' section for links to language-specific | 70 | See the 'SEE ALSO' section for links to language-specific |
71 | information on how to write and run your own trace scripts. | 71 | information on how to write and run your own trace scripts. |
@@ -76,7 +76,7 @@ OPTIONS | |||
76 | Any command you can specify in a shell. | 76 | Any command you can specify in a shell. |
77 | 77 | ||
78 | -D:: | 78 | -D:: |
79 | --dump-raw-trace=:: | 79 | --dump-raw-script=:: |
80 | Display verbose dump of the trace data. | 80 | Display verbose dump of the trace data. |
81 | 81 | ||
82 | -L:: | 82 | -L:: |
@@ -95,7 +95,7 @@ OPTIONS | |||
95 | 95 | ||
96 | -g:: | 96 | -g:: |
97 | --gen-script=:: | 97 | --gen-script=:: |
98 | Generate perf-trace.[ext] starter script for given language, | 98 | Generate perf-script.[ext] starter script for given language, |
99 | using current perf.data. | 99 | using current perf.data. |
100 | 100 | ||
101 | -a:: | 101 | -a:: |
@@ -104,8 +104,15 @@ OPTIONS | |||
104 | normally don't - this option allows the latter to be run in | 104 | normally don't - this option allows the latter to be run in |
105 | system-wide mode. | 105 | system-wide mode. |
106 | 106 | ||
107 | -i:: | ||
108 | --input=:: | ||
109 | Input file name. | ||
110 | |||
111 | -d:: | ||
112 | --debug-mode:: | ||
113 | Do various checks like samples ordering and lost events. | ||
107 | 114 | ||
108 | SEE ALSO | 115 | SEE ALSO |
109 | -------- | 116 | -------- |
110 | linkperf:perf-record[1], linkperf:perf-trace-perl[1], | 117 | linkperf:perf-record[1], linkperf:perf-script-perl[1], |
111 | linkperf:perf-trace-python[1] | 118 | linkperf:perf-script-python[1] |
diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt index 4b3a2d46b437..b6da7affbbee 100644 --- a/tools/perf/Documentation/perf-stat.txt +++ b/tools/perf/Documentation/perf-stat.txt | |||
@@ -8,8 +8,8 @@ perf-stat - Run a command and gather performance counter statistics | |||
8 | SYNOPSIS | 8 | SYNOPSIS |
9 | -------- | 9 | -------- |
10 | [verse] | 10 | [verse] |
11 | 'perf stat' [-e <EVENT> | --event=EVENT] [-S] [-a] <command> | 11 | 'perf stat' [-e <EVENT> | --event=EVENT] [-a] <command> |
12 | 'perf stat' [-e <EVENT> | --event=EVENT] [-S] [-a] -- <command> [<options>] | 12 | 'perf stat' [-e <EVENT> | --event=EVENT] [-a] -- <command> [<options>] |
13 | 13 | ||
14 | DESCRIPTION | 14 | DESCRIPTION |
15 | ----------- | 15 | ----------- |
@@ -35,24 +35,54 @@ OPTIONS | |||
35 | child tasks do not inherit counters | 35 | child tasks do not inherit counters |
36 | -p:: | 36 | -p:: |
37 | --pid=<pid>:: | 37 | --pid=<pid>:: |
38 | stat events on existing pid | 38 | stat events on existing process id |
39 | |||
40 | -t:: | ||
41 | --tid=<tid>:: | ||
42 | stat events on existing thread id | ||
43 | |||
39 | 44 | ||
40 | -a:: | 45 | -a:: |
41 | system-wide collection | 46 | --all-cpus:: |
47 | system-wide collection from all CPUs | ||
42 | 48 | ||
43 | -c:: | 49 | -c:: |
44 | scale counter values | 50 | --scale:: |
51 | scale/normalize counter values | ||
52 | |||
53 | -r:: | ||
54 | --repeat=<n>:: | ||
55 | repeat command and print average + stddev (max: 100) | ||
45 | 56 | ||
46 | -B:: | 57 | -B:: |
58 | --big-num:: | ||
47 | print large numbers with thousands' separators according to locale | 59 | print large numbers with thousands' separators according to locale |
48 | 60 | ||
49 | -C:: | 61 | -C:: |
50 | --cpu=:: | 62 | --cpu=:: |
51 | Count only on the list of cpus provided. Multiple CPUs can be provided as a | 63 | Count only on the list of CPUs provided. Multiple CPUs can be provided as a |
52 | comma-sperated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. | 64 | comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. |
53 | In per-thread mode, this option is ignored. The -a option is still necessary | 65 | In per-thread mode, this option is ignored. The -a option is still necessary |
54 | to activate system-wide monitoring. Default is to count on all CPUs. | 66 | to activate system-wide monitoring. Default is to count on all CPUs. |
55 | 67 | ||
68 | -A:: | ||
69 | --no-aggr:: | ||
70 | Do not aggregate counts across all monitored CPUs in system-wide mode (-a). | ||
71 | This option is only valid in system-wide mode. | ||
72 | |||
73 | -n:: | ||
74 | --null:: | ||
75 | null run - don't start any counters | ||
76 | |||
77 | -v:: | ||
78 | --verbose:: | ||
79 | be more verbose (show counter open errors, etc) | ||
80 | |||
81 | -x SEP:: | ||
82 | --field-separator SEP:: | ||
83 | print counts using a CSV-style output to make it easy to import directly into | ||
84 | spreadsheets. Columns are separated by the string specified in SEP. | ||
85 | |||
56 | EXAMPLES | 86 | EXAMPLES |
57 | -------- | 87 | -------- |
58 | 88 | ||
diff --git a/tools/perf/Documentation/perf-test.txt b/tools/perf/Documentation/perf-test.txt index 1c4b5f5b7f71..2c3b462f64b0 100644 --- a/tools/perf/Documentation/perf-test.txt +++ b/tools/perf/Documentation/perf-test.txt | |||
@@ -12,7 +12,7 @@ SYNOPSIS | |||
12 | 12 | ||
13 | DESCRIPTION | 13 | DESCRIPTION |
14 | ----------- | 14 | ----------- |
15 | This command does assorted sanity tests, initially thru linked routines but | 15 | This command does assorted sanity tests, initially through linked routines but |
16 | also will look for a directory with more tests in the form of scripts. | 16 | also will look for a directory with more tests in the form of scripts. |
17 | 17 | ||
18 | OPTIONS | 18 | OPTIONS |
diff --git a/tools/perf/Documentation/perf-timechart.txt b/tools/perf/Documentation/perf-timechart.txt index 4b1788355eca..d7b79e2ba2ad 100644 --- a/tools/perf/Documentation/perf-timechart.txt +++ b/tools/perf/Documentation/perf-timechart.txt | |||
@@ -38,6 +38,8 @@ OPTIONS | |||
38 | --process:: | 38 | --process:: |
39 | Select the processes to display, by name or PID | 39 | Select the processes to display, by name or PID |
40 | 40 | ||
41 | --symfs=<directory>:: | ||
42 | Look for files with symbols relative to this directory. | ||
41 | 43 | ||
42 | SEE ALSO | 44 | SEE ALSO |
43 | -------- | 45 | -------- |
diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt index 1f9687663f2a..f6eb1cdafb77 100644 --- a/tools/perf/Documentation/perf-top.txt +++ b/tools/perf/Documentation/perf-top.txt | |||
@@ -12,7 +12,7 @@ SYNOPSIS | |||
12 | 12 | ||
13 | DESCRIPTION | 13 | DESCRIPTION |
14 | ----------- | 14 | ----------- |
15 | This command generates and displays a performance counter profile in realtime. | 15 | This command generates and displays a performance counter profile in real time. |
16 | 16 | ||
17 | 17 | ||
18 | OPTIONS | 18 | OPTIONS |
@@ -27,8 +27,8 @@ OPTIONS | |||
27 | 27 | ||
28 | -C <cpu-list>:: | 28 | -C <cpu-list>:: |
29 | --cpu=<cpu>:: | 29 | --cpu=<cpu>:: |
30 | Monitor only on the list of cpus provided. Multiple CPUs can be provided as a | 30 | Monitor only on the list of CPUs provided. Multiple CPUs can be provided as a |
31 | comma-sperated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. | 31 | comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. |
32 | Default is to monitor all CPUS. | 32 | Default is to monitor all CPUS. |
33 | 33 | ||
34 | -d <seconds>:: | 34 | -d <seconds>:: |
@@ -50,6 +50,10 @@ Default is to monitor all CPUS. | |||
50 | --count-filter=<count>:: | 50 | --count-filter=<count>:: |
51 | Only display functions with more events than this. | 51 | Only display functions with more events than this. |
52 | 52 | ||
53 | -g:: | ||
54 | --group:: | ||
55 | Put the counters into a counter group. | ||
56 | |||
53 | -F <freq>:: | 57 | -F <freq>:: |
54 | --freq=<freq>:: | 58 | --freq=<freq>:: |
55 | Profile at this frequency. | 59 | Profile at this frequency. |
@@ -68,7 +72,11 @@ Default is to monitor all CPUS. | |||
68 | 72 | ||
69 | -p <pid>:: | 73 | -p <pid>:: |
70 | --pid=<pid>:: | 74 | --pid=<pid>:: |
71 | Profile events on existing pid. | 75 | Profile events on existing Process ID. |
76 | |||
77 | -t <tid>:: | ||
78 | --tid=<tid>:: | ||
79 | Profile events on existing thread ID. | ||
72 | 80 | ||
73 | -r <priority>:: | 81 | -r <priority>:: |
74 | --realtime=<priority>:: | 82 | --realtime=<priority>:: |
@@ -78,6 +86,18 @@ Default is to monitor all CPUS. | |||
78 | --sym-annotate=<symbol>:: | 86 | --sym-annotate=<symbol>:: |
79 | Annotate this symbol. | 87 | Annotate this symbol. |
80 | 88 | ||
89 | -K:: | ||
90 | --hide_kernel_symbols:: | ||
91 | Hide kernel symbols. | ||
92 | |||
93 | -U:: | ||
94 | --hide_user_symbols:: | ||
95 | Hide user symbols. | ||
96 | |||
97 | -D:: | ||
98 | --dump-symtab:: | ||
99 | Dump the symbol table used for profiling. | ||
100 | |||
81 | -v:: | 101 | -v:: |
82 | --verbose:: | 102 | --verbose:: |
83 | Be more verbose (show counter open errors, etc). | 103 | Be more verbose (show counter open errors, etc). |