diff options
Diffstat (limited to 'tools/perf/Documentation')
-rw-r--r-- | tools/perf/Documentation/Makefile | 31 | ||||
-rw-r--r-- | tools/perf/Documentation/android.txt | 78 | ||||
-rw-r--r-- | tools/perf/Documentation/perf-diff.txt | 60 | ||||
-rw-r--r-- | tools/perf/Documentation/perf-inject.txt | 11 | ||||
-rw-r--r-- | tools/perf/Documentation/perf-stat.txt | 5 | ||||
-rw-r--r-- | tools/perf/Documentation/perf-trace.txt | 6 |
6 files changed, 189 insertions, 2 deletions
diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile index 9f2e44f2b17a..ef6d22e879eb 100644 --- a/tools/perf/Documentation/Makefile +++ b/tools/perf/Documentation/Makefile | |||
@@ -1,3 +1,5 @@ | |||
1 | include ../config/utilities.mak | ||
2 | |||
1 | OUTPUT := ./ | 3 | OUTPUT := ./ |
2 | ifeq ("$(origin O)", "command line") | 4 | ifeq ("$(origin O)", "command line") |
3 | ifneq ($(O),) | 5 | ifneq ($(O),) |
@@ -64,6 +66,7 @@ MAKEINFO=makeinfo | |||
64 | INSTALL_INFO=install-info | 66 | INSTALL_INFO=install-info |
65 | DOCBOOK2X_TEXI=docbook2x-texi | 67 | DOCBOOK2X_TEXI=docbook2x-texi |
66 | DBLATEX=dblatex | 68 | DBLATEX=dblatex |
69 | XMLTO=xmlto | ||
67 | ifndef PERL_PATH | 70 | ifndef PERL_PATH |
68 | PERL_PATH = /usr/bin/perl | 71 | PERL_PATH = /usr/bin/perl |
69 | endif | 72 | endif |
@@ -71,6 +74,16 @@ endif | |||
71 | -include ../config.mak.autogen | 74 | -include ../config.mak.autogen |
72 | -include ../config.mak | 75 | -include ../config.mak |
73 | 76 | ||
77 | _tmp_tool_path := $(call get-executable,$(ASCIIDOC)) | ||
78 | ifeq ($(_tmp_tool_path),) | ||
79 | missing_tools = $(ASCIIDOC) | ||
80 | endif | ||
81 | |||
82 | _tmp_tool_path := $(call get-executable,$(XMLTO)) | ||
83 | ifeq ($(_tmp_tool_path),) | ||
84 | missing_tools += $(XMLTO) | ||
85 | endif | ||
86 | |||
74 | # | 87 | # |
75 | # For asciidoc ... | 88 | # For asciidoc ... |
76 | # -7.1.2, no extra settings are needed. | 89 | # -7.1.2, no extra settings are needed. |
@@ -170,7 +183,12 @@ pdf: $(OUTPUT)user-manual.pdf | |||
170 | 183 | ||
171 | install: install-man | 184 | install: install-man |
172 | 185 | ||
173 | install-man: man | 186 | check-man-tools: |
187 | ifdef missing_tools | ||
188 | $(error "You need to install $(missing_tools) for man pages") | ||
189 | endif | ||
190 | |||
191 | do-install-man: man | ||
174 | $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) | 192 | $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) |
175 | # $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir) | 193 | # $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir) |
176 | # $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir) | 194 | # $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir) |
@@ -178,6 +196,15 @@ install-man: man | |||
178 | # $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir) | 196 | # $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir) |
179 | # $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir) | 197 | # $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir) |
180 | 198 | ||
199 | install-man: check-man-tools man | ||
200 | |||
201 | try-install-man: | ||
202 | ifdef missing_tools | ||
203 | $(warning Please install $(missing_tools) to have the man pages installed) | ||
204 | else | ||
205 | $(MAKE) do-install-man | ||
206 | endif | ||
207 | |||
181 | install-info: info | 208 | install-info: info |
182 | $(INSTALL) -d -m 755 $(DESTDIR)$(infodir) | 209 | $(INSTALL) -d -m 755 $(DESTDIR)$(infodir) |
183 | $(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir) | 210 | $(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir) |
@@ -246,7 +273,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt | |||
246 | 273 | ||
247 | $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml | 274 | $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml |
248 | $(QUIET_XMLTO)$(RM) $@ && \ | 275 | $(QUIET_XMLTO)$(RM) $@ && \ |
249 | xmlto -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< | 276 | $(XMLTO) -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< |
250 | 277 | ||
251 | $(OUTPUT)%.xml : %.txt | 278 | $(OUTPUT)%.xml : %.txt |
252 | $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ | 279 | $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ |
diff --git a/tools/perf/Documentation/android.txt b/tools/perf/Documentation/android.txt new file mode 100644 index 000000000000..8484c3a04a6a --- /dev/null +++ b/tools/perf/Documentation/android.txt | |||
@@ -0,0 +1,78 @@ | |||
1 | How to compile perf for Android | ||
2 | ========================================= | ||
3 | |||
4 | I. Set the Android NDK environment | ||
5 | ------------------------------------------------ | ||
6 | |||
7 | (a). Use the Android NDK | ||
8 | ------------------------------------------------ | ||
9 | 1. You need to download and install the Android Native Development Kit (NDK). | ||
10 | Set the NDK variable to point to the path where you installed the NDK: | ||
11 | export NDK=/path/to/android-ndk | ||
12 | |||
13 | 2. Set cross-compiling environment variables for NDK toolchain and sysroot. | ||
14 | For arm: | ||
15 | export NDK_TOOLCHAIN=${NDK}/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi- | ||
16 | export NDK_SYSROOT=${NDK}/platforms/android-9/arch-arm | ||
17 | For x86: | ||
18 | export NDK_TOOLCHAIN=${NDK}/toolchains/x86-4.6/prebuilt/linux-x86/bin/i686-linux-android- | ||
19 | export NDK_SYSROOT=${NDK}/platforms/android-9/arch-x86 | ||
20 | |||
21 | This method is not working for Android NDK versions up to Revision 8b. | ||
22 | perf uses some bionic enhancements that are not included in these NDK versions. | ||
23 | You can use method (b) described below instead. | ||
24 | |||
25 | (b). Use the Android source tree | ||
26 | ----------------------------------------------- | ||
27 | 1. Download the master branch of the Android source tree. | ||
28 | Set the environment for the target you want using: | ||
29 | source build/envsetup.sh | ||
30 | lunch | ||
31 | |||
32 | 2. Build your own NDK sysroot to contain latest bionic changes and set the | ||
33 | NDK sysroot environment variable. | ||
34 | cd ${ANDROID_BUILD_TOP}/ndk | ||
35 | For arm: | ||
36 | ./build/tools/build-ndk-sysroot.sh --abi=arm | ||
37 | export NDK_SYSROOT=${ANDROID_BUILD_TOP}/ndk/build/platforms/android-3/arch-arm | ||
38 | For x86: | ||
39 | ./build/tools/build-ndk-sysroot.sh --abi=x86 | ||
40 | export NDK_SYSROOT=${ANDROID_BUILD_TOP}/ndk/build/platforms/android-3/arch-x86 | ||
41 | |||
42 | 3. Set the NDK toolchain environment variable. | ||
43 | For arm: | ||
44 | export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/arm-linux-androideabi- | ||
45 | For x86: | ||
46 | export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/i686-linux-android- | ||
47 | |||
48 | II. Compile perf for Android | ||
49 | ------------------------------------------------ | ||
50 | You need to run make with the NDK toolchain and sysroot defined above: | ||
51 | For arm: | ||
52 | make ARCH=arm CROSS_COMPILE=${NDK_TOOLCHAIN} CFLAGS="--sysroot=${NDK_SYSROOT}" | ||
53 | For x86: | ||
54 | make ARCH=x86 CROSS_COMPILE=${NDK_TOOLCHAIN} CFLAGS="--sysroot=${NDK_SYSROOT}" | ||
55 | |||
56 | III. Install perf | ||
57 | ----------------------------------------------- | ||
58 | You need to connect to your Android device/emulator using adb. | ||
59 | Install perf using: | ||
60 | adb push perf /data/perf | ||
61 | |||
62 | If you also want to use perf-archive you need busybox tools for Android. | ||
63 | For installing perf-archive, you first need to replace #!/bin/bash with #!/system/bin/sh: | ||
64 | sed 's/#!\/bin\/bash/#!\/system\/bin\/sh/g' perf-archive >> /tmp/perf-archive | ||
65 | chmod +x /tmp/perf-archive | ||
66 | adb push /tmp/perf-archive /data/perf-archive | ||
67 | |||
68 | IV. Environment settings for running perf | ||
69 | ------------------------------------------------ | ||
70 | Some perf features need environment variables to run properly. | ||
71 | You need to set these before running perf on the target: | ||
72 | adb shell | ||
73 | # PERF_PAGER=cat | ||
74 | |||
75 | IV. Run perf | ||
76 | ------------------------------------------------ | ||
77 | Run perf on your device/emulator to which you previously connected using adb: | ||
78 | # ./data/perf | ||
diff --git a/tools/perf/Documentation/perf-diff.txt b/tools/perf/Documentation/perf-diff.txt index ab7f667de1b1..194f37d635df 100644 --- a/tools/perf/Documentation/perf-diff.txt +++ b/tools/perf/Documentation/perf-diff.txt | |||
@@ -72,6 +72,66 @@ OPTIONS | |||
72 | --symfs=<directory>:: | 72 | --symfs=<directory>:: |
73 | Look for files with symbols relative to this directory. | 73 | Look for files with symbols relative to this directory. |
74 | 74 | ||
75 | -b:: | ||
76 | --baseline-only:: | ||
77 | Show only items with match in baseline. | ||
78 | |||
79 | -c:: | ||
80 | --compute:: | ||
81 | Differential computation selection - delta,ratio,wdiff (default is delta). | ||
82 | If '+' is specified as a first character, the output is sorted based | ||
83 | on the computation results. | ||
84 | See COMPARISON METHODS section for more info. | ||
85 | |||
86 | -p:: | ||
87 | --period:: | ||
88 | Show period values for both compared hist entries. | ||
89 | |||
90 | -F:: | ||
91 | --formula:: | ||
92 | Show formula for given computation. | ||
93 | |||
94 | COMPARISON METHODS | ||
95 | ------------------ | ||
96 | delta | ||
97 | ~~~~~ | ||
98 | If specified the 'Delta' column is displayed with value 'd' computed as: | ||
99 | |||
100 | d = A->period_percent - B->period_percent | ||
101 | |||
102 | with: | ||
103 | - A/B being matching hist entry from first/second file specified | ||
104 | (or perf.data/perf.data.old) respectively. | ||
105 | |||
106 | - period_percent being the % of the hist entry period value within | ||
107 | single data file | ||
108 | |||
109 | ratio | ||
110 | ~~~~~ | ||
111 | If specified the 'Ratio' column is displayed with value 'r' computed as: | ||
112 | |||
113 | r = A->period / B->period | ||
114 | |||
115 | with: | ||
116 | - A/B being matching hist entry from first/second file specified | ||
117 | (or perf.data/perf.data.old) respectively. | ||
118 | |||
119 | - period being the hist entry period value | ||
120 | |||
121 | wdiff | ||
122 | ~~~~~ | ||
123 | If specified the 'Weighted diff' column is displayed with value 'd' computed as: | ||
124 | |||
125 | d = B->period * WEIGHT-A - A->period * WEIGHT-B | ||
126 | |||
127 | - A/B being matching hist entry from first/second file specified | ||
128 | (or perf.data/perf.data.old) respectively. | ||
129 | |||
130 | - period being the hist entry period value | ||
131 | |||
132 | - WEIGHT-A/WEIGHT-B being user suplied weights in the the '-c' option | ||
133 | behind ':' separator like '-c wdiff:1,2'. | ||
134 | |||
75 | SEE ALSO | 135 | SEE ALSO |
76 | -------- | 136 | -------- |
77 | linkperf:perf-record[1] | 137 | linkperf:perf-record[1] |
diff --git a/tools/perf/Documentation/perf-inject.txt b/tools/perf/Documentation/perf-inject.txt index 025630d43cd2..a00a34276c54 100644 --- a/tools/perf/Documentation/perf-inject.txt +++ b/tools/perf/Documentation/perf-inject.txt | |||
@@ -29,6 +29,17 @@ OPTIONS | |||
29 | -v:: | 29 | -v:: |
30 | --verbose:: | 30 | --verbose:: |
31 | Be more verbose. | 31 | Be more verbose. |
32 | -i:: | ||
33 | --input=:: | ||
34 | Input file name. (default: stdin) | ||
35 | -o:: | ||
36 | --output=:: | ||
37 | Output file name. (default: stdout) | ||
38 | -s:: | ||
39 | --sched-stat:: | ||
40 | Merge sched_stat and sched_switch for getting events where and how long | ||
41 | tasks slept. sched_switch contains a callchain where a task slept and | ||
42 | sched_stat contains a timeslice how long a task slept. | ||
32 | 43 | ||
33 | SEE ALSO | 44 | SEE ALSO |
34 | -------- | 45 | -------- |
diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt index 2fa173b51970..cf0c3107e06e 100644 --- a/tools/perf/Documentation/perf-stat.txt +++ b/tools/perf/Documentation/perf-stat.txt | |||
@@ -108,6 +108,11 @@ with it. --append may be used here. Examples: | |||
108 | 3>results perf stat --log-fd 3 -- $cmd | 108 | 3>results perf stat --log-fd 3 -- $cmd |
109 | 3>>results perf stat --log-fd 3 --append -- $cmd | 109 | 3>>results perf stat --log-fd 3 --append -- $cmd |
110 | 110 | ||
111 | --pre:: | ||
112 | --post:: | ||
113 | Pre and post measurement hooks, e.g.: | ||
114 | |||
115 | perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' -- make -s -j64 O=defconfig-build/ bzImage | ||
111 | 116 | ||
112 | 117 | ||
113 | EXAMPLES | 118 | EXAMPLES |
diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt index 3a2ae37310a9..68718ccdd178 100644 --- a/tools/perf/Documentation/perf-trace.txt +++ b/tools/perf/Documentation/perf-trace.txt | |||
@@ -48,6 +48,12 @@ comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0- | |||
48 | In per-thread mode with inheritance mode on (default), Events are captured only when | 48 | In per-thread mode with inheritance mode on (default), Events are captured only when |
49 | the thread executes on the designated CPUs. Default is to monitor all CPUs. | 49 | the thread executes on the designated CPUs. Default is to monitor all CPUs. |
50 | 50 | ||
51 | --duration: | ||
52 | Show only events that had a duration greater than N.M ms. | ||
53 | |||
54 | --sched: | ||
55 | Accrue thread runtime and provide a summary at the end of the session. | ||
56 | |||
51 | SEE ALSO | 57 | SEE ALSO |
52 | -------- | 58 | -------- |
53 | linkperf:perf-record[1], linkperf:perf-script[1] | 59 | linkperf:perf-record[1], linkperf:perf-script[1] |