summaryrefslogtreecommitdiffstats
path: root/documentation/profile-manual
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@crashcourse.ca>2013-11-15 08:52:26 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-03 12:53:09 +0000
commitb156232de86e78d4e604dd9752ed937a7b2282de (patch)
treecbd1d43538a0dde338ed940d453ed0cb39edf2ec /documentation/profile-manual
parent46ac6c616b8068c82812155644a735e7648b61f0 (diff)
downloadpoky-b156232de86e78d4e604dd9752ed937a7b2282de.tar.gz
profile-manual: Edits from Robert P. J. Day
If someone wants to check this over, make sure I didn't make any silly changes. (From yocto-docs rev: 3305553d84fbd09fb00d4608533f830348fda0cc) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/profile-manual')
-rw-r--r--documentation/profile-manual/profile-manual-usage.xml54
1 files changed, 28 insertions, 26 deletions
diff --git a/documentation/profile-manual/profile-manual-usage.xml b/documentation/profile-manual/profile-manual-usage.xml
index c1ceb5830a..5279730a5b 100644
--- a/documentation/profile-manual/profile-manual-usage.xml
+++ b/documentation/profile-manual/profile-manual-usage.xml
@@ -1377,7 +1377,7 @@
1377 the /tracing directory of the mounted debugfs filesystem 1377 the /tracing directory of the mounted debugfs filesystem
1378 (Yocto follows the standard convention and mounts it 1378 (Yocto follows the standard convention and mounts it
1379 at /sys/kernel/debug). Here's a listing of all the files 1379 at /sys/kernel/debug). Here's a listing of all the files
1380 found in /sys/kernel/debug/tracing on a Yocto system.: 1380 found in /sys/kernel/debug/tracing on a Yocto system:
1381 <literallayout class='monospaced'> 1381 <literallayout class='monospaced'>
1382 root@sugarbay:/sys/kernel/debug/tracing# ls 1382 root@sugarbay:/sys/kernel/debug/tracing# ls
1383 README kprobe_events trace 1383 README kprobe_events trace
@@ -1634,7 +1634,7 @@
1634 Also notice that there are various annotations on the left 1634 Also notice that there are various annotations on the left
1635 hand side of the display. For example if the total time it 1635 hand side of the display. For example if the total time it
1636 took for a given function to execute is above a certain 1636 took for a given function to execute is above a certain
1637 threshold, and exclamation point or plus sign appears on the 1637 threshold, an exclamation point or plus sign appears on the
1638 left hand side. Please see the ftrace documentation for 1638 left hand side. Please see the ftrace documentation for
1639 details on all these fields. 1639 details on all these fields.
1640 </para> 1640 </para>
@@ -1842,7 +1842,7 @@
1842 </literallayout> 1842 </literallayout>
1843 You can enable any number of events or complete subsystems 1843 You can enable any number of events or complete subsystems
1844 (by using the 'enable' file in the subsystem directory) and 1844 (by using the 'enable' file in the subsystem directory) and
1845 get am arbitrarily fine-grained idea of what's going on in the 1845 get an arbitrarily fine-grained idea of what's going on in the
1846 system by enabling as many of the appropriate tracepoints 1846 system by enabling as many of the appropriate tracepoints
1847 as applicable. 1847 as applicable.
1848 </para> 1848 </para>
@@ -1878,14 +1878,14 @@
1878 in /sys/kernel/debug/tracing, allowing users to specify 1878 in /sys/kernel/debug/tracing, allowing users to specify
1879 specific particular events within the 1879 specific particular events within the
1880 /sys/kernel/debug/tracing/events/ subdirectory and to collect 1880 /sys/kernel/debug/tracing/events/ subdirectory and to collect
1881 traces and avoiding having to deal with those details directly. 1881 traces and avoid having to deal with those details directly.
1882 </para> 1882 </para>
1883 1883
1884 <para> 1884 <para>
1885 As yet another layer on top of that, kernelshark provides a GUI 1885 As yet another layer on top of that, kernelshark provides a GUI
1886 that allows users to start and stop traces and specify sets 1886 that allows users to start and stop traces and specify sets
1887 of events using an intuitive interface, and view the 1887 of events using an intuitive interface, and view the
1888 output as both trace events and as a per-cpu graphical 1888 output as both trace events and as a per-CPU graphical
1889 display. It directly uses 'trace-cmd' as the plumbing 1889 display. It directly uses 'trace-cmd' as the plumbing
1890 that accomplishes all that underneath the covers (and 1890 that accomplishes all that underneath the covers (and
1891 actually displays the trace-cmd command it uses, as we'll see). 1891 actually displays the trace-cmd command it uses, as we'll see).
@@ -1896,13 +1896,13 @@
1896 <literallayout class='monospaced'> 1896 <literallayout class='monospaced'>
1897 root@sugarbay:~# kernelshark 1897 root@sugarbay:~# kernelshark
1898 </literallayout> 1898 </literallayout>
1899 The bring up the 'Capture' dialog by choosing from the 1899 Then bring up the 'Capture' dialog by choosing from the
1900 kernelshark menu: 1900 kernelshark menu:
1901 <literallayout class='monospaced'> 1901 <literallayout class='monospaced'>
1902 Capture | Record 1902 Capture | Record
1903 </literallayout> 1903 </literallayout>
1904 That will display the following dialog, which allows you to 1904 That will display the following dialog, which allows you to
1905 choose on or more events (or even one or more complete 1905 choose one or more events (or even one or more complete
1906 subsystems) to trace: 1906 subsystems) to trace:
1907 </para> 1907 </para>
1908 1908
@@ -1911,7 +1911,7 @@
1911 </para> 1911 </para>
1912 1912
1913 <para> 1913 <para>
1914 Note that these are exactly the same set of events described 1914 Note that these are exactly the same sets of events described
1915 in the previous trace events subsystem section, and in fact 1915 in the previous trace events subsystem section, and in fact
1916 is where trace-cmd gets them for kernelshark. 1916 is where trace-cmd gets them for kernelshark.
1917 </para> 1917 </para>
@@ -1980,13 +1980,15 @@
1980 <literallayout class='monospaced'> 1980 <literallayout class='monospaced'>
1981 Documentation/trace/events.txt 1981 Documentation/trace/events.txt
1982 </literallayout> 1982 </literallayout>
1983 There are a nice series of articles on using 1983 There is a nice series of articles on using
1984 ftrace and trace-cmd at LWN: 1984 ftrace and trace-cmd at LWN:
1985 <itemizedlist> 1985 <itemizedlist>
1986 <listitem><para><ulink url='http://lwn.net/Articles/365835/'>Debugging the kernel using Ftrace - part 1</ulink> 1986 <listitem><para><ulink url='http://lwn.net/Articles/365835/'>Debugging the kernel using Ftrace - part 1</ulink>
1987 </para></listitem> 1987 </para></listitem>
1988 <listitem><para><ulink url='http://lwn.net/Articles/366796/'>Debugging the kernel using Ftrace - part 2</ulink> 1988 <listitem><para><ulink url='http://lwn.net/Articles/366796/'>Debugging the kernel using Ftrace - part 2</ulink>
1989 </para></listitem> 1989 </para></listitem>
1990 <listitem><para><ulink url='http://lwn.net/Articles/370423/'>Secrets of the Ftrace function tracer</ulink>
1991 </para></listitem>
1990 <listitem><para><ulink url='https://lwn.net/Articles/410200/'>trace-cmd: A front-end for Ftrace</ulink> 1992 <listitem><para><ulink url='https://lwn.net/Articles/410200/'>trace-cmd: A front-end for Ftrace</ulink>
1991 </para></listitem> 1993 </para></listitem>
1992 </itemizedlist> 1994 </itemizedlist>
@@ -2022,7 +2024,7 @@
2022 <ulink url='http://sourceware.org/systemtap/tutorial/'>SystemTap tutorial</ulink> 2024 <ulink url='http://sourceware.org/systemtap/tutorial/'>SystemTap tutorial</ulink>
2023 simply prints a line every time any process on the system open()s 2025 simply prints a line every time any process on the system open()s
2024 a file. For each line, it prints the executable name of the 2026 a file. For each line, it prints the executable name of the
2025 program that opened the file, along with its pid, and the name 2027 program that opened the file, along with its PID, and the name
2026 of the file it opened (or tried to open), which it extracts 2028 of the file it opened (or tried to open), which it extracts
2027 from the open syscall's argstr. 2029 from the open syscall's argstr.
2028 <literallayout class='monospaced'> 2030 <literallayout class='monospaced'>
@@ -2099,11 +2101,11 @@
2099 <note> 2101 <note>
2100 SystemTap, which uses 'crosstap', assumes you can establish an 2102 SystemTap, which uses 'crosstap', assumes you can establish an
2101 ssh connection to the remote target. 2103 ssh connection to the remote target.
2102 Please refer to crosstap wiki page for details on verifying 2104 Please refer to the crosstap wiki page for details on verifying
2103 ssh connections at 2105 ssh connections at
2104 <ulink url='https://wiki.yoctoproject.org/wiki/Tracing_and_Profiling#systemtap'></ulink>. 2106 <ulink url='https://wiki.yoctoproject.org/wiki/Tracing_and_Profiling#systemtap'></ulink>.
2105 Also, the ability to ssh into the target system is not enabled 2107 Also, the ability to ssh into the target system is not enabled
2106 by default in -minimal images. 2108 by default in *-minimal images.
2107 </note> 2109 </note>
2108 <literallayout class='monospaced'> 2110 <literallayout class='monospaced'>
2109 $ crosstap root@192.168.1.88 trace_open.stp 2111 $ crosstap root@192.168.1.88 trace_open.stp
@@ -2201,7 +2203,7 @@
2201 <para> 2203 <para>
2202 If everything worked as planned, you should see something 2204 If everything worked as planned, you should see something
2203 like this (enter the password when prompted, or press enter 2205 like this (enter the password when prompted, or press enter
2204 if its set up to use no password): 2206 if it's set up to use no password):
2205 <literallayout class='monospaced'> 2207 <literallayout class='monospaced'>
2206 $ crosstap root@192.168.7.2 trace_open.stp 2208 $ crosstap root@192.168.7.2 trace_open.stp
2207 root@192.168.7.2's password: 2209 root@192.168.7.2's password:
@@ -2246,7 +2248,7 @@
2246 </para> 2248 </para>
2247 2249
2248 <para> 2250 <para>
2249 For the the section that deals with oprofile from the command-line, 2251 For the section that deals with running oprofile from the command-line,
2250 we assume you've ssh'ed to the host and will be running 2252 we assume you've ssh'ed to the host and will be running
2251 oprofile on the target. 2253 oprofile on the target.
2252 </para> 2254 </para>
@@ -2266,7 +2268,7 @@
2266 Oprofile as configured in Yocto is a system-wide profiler 2268 Oprofile as configured in Yocto is a system-wide profiler
2267 (i.e. the version in Yocto doesn't yet make use of the 2269 (i.e. the version in Yocto doesn't yet make use of the
2268 perf_events interface which would allow it to profile 2270 perf_events interface which would allow it to profile
2269 specific processes and workloads). It's relies on hardware 2271 specific processes and workloads). It relies on hardware
2270 counter support in the hardware (but can fall back to a 2272 counter support in the hardware (but can fall back to a
2271 timer-based mode), which means that it doesn't take 2273 timer-based mode), which means that it doesn't take
2272 advantage of tracepoints or other event sources for example. 2274 advantage of tracepoints or other event sources for example.
@@ -2287,8 +2289,8 @@
2287 <para> 2289 <para>
2288 The oprofile daemon should already be running, but before 2290 The oprofile daemon should already be running, but before
2289 you start profiling, you may need to change some settings 2291 you start profiling, you may need to change some settings
2290 and some of these settings may require the daemon not 2292 and some of these settings may require the daemon to not
2291 be running. One of these settings is the path the the 2293 be running. One of these settings is the path to the
2292 vmlinux file, which you'll want to set using the --vmlinux 2294 vmlinux file, which you'll want to set using the --vmlinux
2293 option if you want the kernel profiled: 2295 option if you want the kernel profiled:
2294 <literallayout class='monospaced'> 2296 <literallayout class='monospaced'>
@@ -2319,7 +2321,7 @@
2319 Using log file /var/lib/oprofile/samples/oprofiled.log 2321 Using log file /var/lib/oprofile/samples/oprofiled.log
2320 Daemon started. 2322 Daemon started.
2321 </literallayout> 2323 </literallayout>
2322 If we get the status again we now see our updated settings: 2324 If we check the status again we now see our updated settings:
2323 <literallayout class='monospaced'> 2325 <literallayout class='monospaced'>
2324 root@crownbay:~# opcontrol --status 2326 root@crownbay:~# opcontrol --status
2325 Daemon paused: pid 1649 2327 Daemon paused: pid 1649
@@ -2328,7 +2330,7 @@
2328 Image filter: none 2330 Image filter: none
2329 Call-graph depth: 6 2331 Call-graph depth: 6
2330 </literallayout> 2332 </literallayout>
2331 We're now in a position to run a profile. For that we used 2333 We're now in a position to run a profile. For that we use
2332 'opcontrol --start': 2334 'opcontrol --start':
2333 <literallayout class='monospaced'> 2335 <literallayout class='monospaced'>
2334 root@crownbay:~# opcontrol --start 2336 root@crownbay:~# opcontrol --start
@@ -2340,10 +2342,10 @@
2340 Connecting to downloads.yoctoproject.org (140.211.169.59:80) 2342 Connecting to downloads.yoctoproject.org (140.211.169.59:80)
2341 linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA 2343 linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA
2342 </literallayout> 2344 </literallayout>
2343 To stop the profile we use 'opcontrol --shudown', which not 2345 To stop the profile we use 'opcontrol --shutdown', which not
2344 only stops the profile but shuts down the daemon as well: 2346 only stops the profile but shuts down the daemon as well:
2345 <literallayout class='monospaced'> 2347 <literallayout class='monospaced'>
2346 root@crownbay:~# opcontrol --start 2348 root@crownbay:~# opcontrol --shutdown
2347 Stopping profiling. 2349 Stopping profiling.
2348 Killing daemon. 2350 Killing daemon.
2349 </literallayout> 2351 </literallayout>
@@ -2902,7 +2904,7 @@
2902 2904
2903 <para> 2905 <para>
2904 Once you've applied the above commits and built and booted your 2906 Once you've applied the above commits and built and booted your
2905 image (you need to build the core-image-sato-sdk image or the 2907 image (you need to build the core-image-sato-sdk image or use one of the
2906 other methods described in the General Setup section), you're 2908 other methods described in the General Setup section), you're
2907 ready to start tracing. 2909 ready to start tracing.
2908 </para> 2910 </para>
@@ -2911,7 +2913,7 @@
2911 <title>Collecting and viewing a trace on the target (inside a shell)</title> 2913 <title>Collecting and viewing a trace on the target (inside a shell)</title>
2912 2914
2913 <para> 2915 <para>
2914 First, from the target, ssh to the target: 2916 First, from the host, ssh to the target:
2915 <literallayout class='monospaced'> 2917 <literallayout class='monospaced'>
2916 $ ssh -l root 192.168.1.47 2918 $ ssh -l root 192.168.1.47
2917 The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established. 2919 The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established.
@@ -3012,7 +3014,7 @@
3012 <title>Collecting and viewing a userspace trace on the target (inside a shell)</title> 3014 <title>Collecting and viewing a userspace trace on the target (inside a shell)</title>
3013 3015
3014 <para> 3016 <para>
3015 For lttng userspace tracing, you need to have a properly 3017 For LTTng userspace tracing, you need to have a properly
3016 instrumented userspace program. For this example, we'll use 3018 instrumented userspace program. For this example, we'll use
3017 the 'hello' test program generated by the lttng-ust build. 3019 the 'hello' test program generated by the lttng-ust build.
3018 </para> 3020 </para>
@@ -3034,7 +3036,7 @@
3034 </para> 3036 </para>
3035 3037
3036 <para> 3038 <para>
3037 First, from the target, ssh to the target: 3039 First, from the host, ssh to the target:
3038 <literallayout class='monospaced'> 3040 <literallayout class='monospaced'>
3039 $ ssh -l root 192.168.1.47 3041 $ ssh -l root 192.168.1.47
3040 The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established. 3042 The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established.
@@ -3600,7 +3602,7 @@
3600 It's also possible to trace block I/O using only 3602 It's also possible to trace block I/O using only
3601 <link linkend='the-trace-events-subsystem'>trace events subsystem</link>, 3603 <link linkend='the-trace-events-subsystem'>trace events subsystem</link>,
3602 which can be useful for casual tracing 3604 which can be useful for casual tracing
3603 if you don't want bother dealing with the userspace tools. 3605 if you don't want to bother dealing with the userspace tools.
3604 </para> 3606 </para>
3605 3607
3606 <para> 3608 <para>