aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/Documentation')
-rw-r--r--tools/perf/Documentation/Makefile31
-rw-r--r--tools/perf/Documentation/android.txt78
-rw-r--r--tools/perf/Documentation/perf-diff.txt60
-rw-r--r--tools/perf/Documentation/perf-inject.txt11
-rw-r--r--tools/perf/Documentation/perf-stat.txt5
-rw-r--r--tools/perf/Documentation/perf-trace.txt6
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 @@
1include ../config/utilities.mak
2
1OUTPUT := ./ 3OUTPUT := ./
2ifeq ("$(origin O)", "command line") 4ifeq ("$(origin O)", "command line")
3 ifneq ($(O),) 5 ifneq ($(O),)
@@ -64,6 +66,7 @@ MAKEINFO=makeinfo
64INSTALL_INFO=install-info 66INSTALL_INFO=install-info
65DOCBOOK2X_TEXI=docbook2x-texi 67DOCBOOK2X_TEXI=docbook2x-texi
66DBLATEX=dblatex 68DBLATEX=dblatex
69XMLTO=xmlto
67ifndef PERL_PATH 70ifndef PERL_PATH
68 PERL_PATH = /usr/bin/perl 71 PERL_PATH = /usr/bin/perl
69endif 72endif
@@ -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))
78ifeq ($(_tmp_tool_path),)
79 missing_tools = $(ASCIIDOC)
80endif
81
82_tmp_tool_path := $(call get-executable,$(XMLTO))
83ifeq ($(_tmp_tool_path),)
84 missing_tools += $(XMLTO)
85endif
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
171install: install-man 184install: install-man
172 185
173install-man: man 186check-man-tools:
187ifdef missing_tools
188 $(error "You need to install $(missing_tools) for man pages")
189endif
190
191do-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
199install-man: check-man-tools man
200
201try-install-man:
202ifdef missing_tools
203 $(warning Please install $(missing_tools) to have the man pages installed)
204else
205 $(MAKE) do-install-man
206endif
207
181install-info: info 208install-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 @@
1How to compile perf for Android
2=========================================
3
4I. Set the Android NDK environment
5------------------------------------------------
6
7(a). Use the Android NDK
8------------------------------------------------
91. You need to download and install the Android Native Development Kit (NDK).
10Set the NDK variable to point to the path where you installed the NDK:
11 export NDK=/path/to/android-ndk
12
132. Set cross-compiling environment variables for NDK toolchain and sysroot.
14For 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
17For 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
21This method is not working for Android NDK versions up to Revision 8b.
22perf uses some bionic enhancements that are not included in these NDK versions.
23You can use method (b) described below instead.
24
25(b). Use the Android source tree
26-----------------------------------------------
271. Download the master branch of the Android source tree.
28Set the environment for the target you want using:
29 source build/envsetup.sh
30 lunch
31
322. Build your own NDK sysroot to contain latest bionic changes and set the
33NDK sysroot environment variable.
34 cd ${ANDROID_BUILD_TOP}/ndk
35For arm:
36 ./build/tools/build-ndk-sysroot.sh --abi=arm
37 export NDK_SYSROOT=${ANDROID_BUILD_TOP}/ndk/build/platforms/android-3/arch-arm
38For 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
423. Set the NDK toolchain environment variable.
43For arm:
44 export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/arm-linux-androideabi-
45For x86:
46 export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/i686-linux-android-
47
48II. Compile perf for Android
49------------------------------------------------
50You need to run make with the NDK toolchain and sysroot defined above:
51For arm:
52 make ARCH=arm CROSS_COMPILE=${NDK_TOOLCHAIN} CFLAGS="--sysroot=${NDK_SYSROOT}"
53For x86:
54 make ARCH=x86 CROSS_COMPILE=${NDK_TOOLCHAIN} CFLAGS="--sysroot=${NDK_SYSROOT}"
55
56III. Install perf
57-----------------------------------------------
58You need to connect to your Android device/emulator using adb.
59Install perf using:
60 adb push perf /data/perf
61
62If you also want to use perf-archive you need busybox tools for Android.
63For 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
68IV. Environment settings for running perf
69------------------------------------------------
70Some perf features need environment variables to run properly.
71You need to set these before running perf on the target:
72 adb shell
73 # PERF_PAGER=cat
74
75IV. Run perf
76------------------------------------------------
77Run 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
94COMPARISON METHODS
95------------------
96delta
97~~~~~
98If specified the 'Delta' column is displayed with value 'd' computed as:
99
100 d = A->period_percent - B->period_percent
101
102with:
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
109ratio
110~~~~~
111If specified the 'Ratio' column is displayed with value 'r' computed as:
112
113 r = A->period / B->period
114
115with:
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
121wdiff
122~~~~~
123If 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
75SEE ALSO 135SEE ALSO
76-------- 136--------
77linkperf:perf-record[1] 137linkperf: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
33SEE ALSO 44SEE 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
115perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' -- make -s -j64 O=defconfig-build/ bzImage
111 116
112 117
113EXAMPLES 118EXAMPLES
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-
48In per-thread mode with inheritance mode on (default), Events are captured only when 48In per-thread mode with inheritance mode on (default), Events are captured only when
49the thread executes on the designated CPUs. Default is to monitor all CPUs. 49the 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
51SEE ALSO 57SEE ALSO
52-------- 58--------
53linkperf:perf-record[1], linkperf:perf-script[1] 59linkperf:perf-record[1], linkperf:perf-script[1]