summaryrefslogtreecommitdiffstats
path: root/documentation/profile-manual/usage.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/profile-manual/usage.rst')
-rw-r--r--documentation/profile-manual/usage.rst26
1 files changed, 13 insertions, 13 deletions
diff --git a/documentation/profile-manual/usage.rst b/documentation/profile-manual/usage.rst
index b401cf9040..fd6da6fc41 100644
--- a/documentation/profile-manual/usage.rst
+++ b/documentation/profile-manual/usage.rst
@@ -100,8 +100,8 @@ Using perf to do Basic Profiling
100As a simple test case, we'll profile the 'wget' of a fairly large file, 100As a simple test case, we'll profile the 'wget' of a fairly large file,
101which is a minimally interesting case because it has both file and 101which is a minimally interesting case because it has both file and
102network I/O aspects, and at least in the case of standard Yocto images, 102network I/O aspects, and at least in the case of standard Yocto images,
103it's implemented as part of busybox, so the methods we use to analyze it 103it's implemented as part of BusyBox, so the methods we use to analyze it
104can be used in a very similar way to the whole host of supported busybox 104can be used in a very similar way to the whole host of supported BusyBox
105applets in Yocto. :: 105applets in Yocto. ::
106 106
107 root@crownbay:~# rm linux-2.6.19.2.tar.bz2; \ 107 root@crownbay:~# rm linux-2.6.19.2.tar.bz2; \
@@ -251,7 +251,7 @@ As a bit of background explanation for these callchains, think about
251what happens at a high level when you run wget to get a file out on the 251what happens at a high level when you run wget to get a file out on the
252network. Basically what happens is that the data comes into the kernel 252network. Basically what happens is that the data comes into the kernel
253via the network connection (socket) and is passed to the userspace 253via the network connection (socket) and is passed to the userspace
254program 'wget' (which is actually a part of busybox, but that's not 254program 'wget' (which is actually a part of BusyBox, but that's not
255important for now), which takes the buffers the kernel passes to it and 255important for now), which takes the buffers the kernel passes to it and
256writes it to a disk file to save it. 256writes it to a disk file to save it.
257 257
@@ -277,16 +277,16 @@ Now that we've seen the basic layout of the profile data and the basics
277of how to extract useful information out of it, let's get back to the 277of how to extract useful information out of it, let's get back to the
278task at hand and see if we can get some basic idea about where the time 278task at hand and see if we can get some basic idea about where the time
279is spent in the program we're profiling, wget. Remember that wget is 279is spent in the program we're profiling, wget. Remember that wget is
280actually implemented as an applet in busybox, so while the process name 280actually implemented as an applet in BusyBox, so while the process name
281is 'wget', the executable we're actually interested in is busybox. So 281is 'wget', the executable we're actually interested in is BusyBox. So
282let's expand the first entry containing busybox: 282let's expand the first entry containing BusyBox:
283 283
284.. image:: figures/perf-wget-busybox-expanded-stripped.png 284.. image:: figures/perf-wget-busybox-expanded-stripped.png
285 :align: center 285 :align: center
286 286
287Again, before we expanded we saw that the function was labeled with a 287Again, before we expanded we saw that the function was labeled with a
288hex value instead of a symbol as with most of the kernel entries. 288hex value instead of a symbol as with most of the kernel entries.
289Expanding the busybox entry doesn't make it any better. 289Expanding the BusyBox entry doesn't make it any better.
290 290
291The problem is that perf can't find the symbol information for the 291The problem is that perf can't find the symbol information for the
292busybox binary, which is actually stripped out by the Yocto build 292busybox binary, which is actually stripped out by the Yocto build
@@ -299,7 +299,7 @@ when you build the image: ::
299 299
300However, we already have an image with the binaries stripped, so 300However, we already have an image with the binaries stripped, so
301what can we do to get perf to resolve the symbols? Basically we need to 301what can we do to get perf to resolve the symbols? Basically we need to
302install the debuginfo for the busybox package. 302install the debuginfo for the BusyBox package.
303 303
304To generate the debug info for the packages in the image, we can add 304To generate the debug info for the packages in the image, we can add
305``dbg-pkgs`` to :term:`EXTRA_IMAGE_FEATURES` in ``local.conf``. For example: :: 305``dbg-pkgs`` to :term:`EXTRA_IMAGE_FEATURES` in ``local.conf``. For example: ::
@@ -314,7 +314,7 @@ in the ``local.conf`` file: ::
314 PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory' 314 PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
315 315
316Once we've done that, we can install the 316Once we've done that, we can install the
317debuginfo for busybox. The debug packages once built can be found in 317debuginfo for BusyBox. The debug packages once built can be found in
318``build/tmp/deploy/rpm/*`` on the host system. Find the busybox-dbg-...rpm 318``build/tmp/deploy/rpm/*`` on the host system. Find the busybox-dbg-...rpm
319file and copy it to the target. For example: :: 319file and copy it to the target. For example: ::
320 320
@@ -325,7 +325,7 @@ Now install the debug rpm on the target: ::
325 325
326 root@crownbay:~# rpm -i busybox-dbg-1.20.2-r2.core2_32.rpm 326 root@crownbay:~# rpm -i busybox-dbg-1.20.2-r2.core2_32.rpm
327 327
328Now that the debuginfo is installed, we see that the busybox entries now display 328Now that the debuginfo is installed, we see that the BusyBox entries now display
329their functions symbolically: 329their functions symbolically:
330 330
331.. image:: figures/perf-wget-busybox-debuginfo.png 331.. image:: figures/perf-wget-busybox-debuginfo.png
@@ -345,11 +345,11 @@ expanded all the nodes using the 'E' key):
345.. image:: figures/perf-wget-busybox-dso-zoom.png 345.. image:: figures/perf-wget-busybox-dso-zoom.png
346 :align: center 346 :align: center
347 347
348Finally, we can see that now that the busybox debuginfo is installed, 348Finally, we can see that now that the BusyBox debuginfo is installed,
349the previously unresolved symbol in the ``sys_clock_gettime()`` entry 349the previously unresolved symbol in the ``sys_clock_gettime()`` entry
350mentioned previously is now resolved, and shows that the 350mentioned previously is now resolved, and shows that the
351sys_clock_gettime system call that was the source of 6.75% of the 351sys_clock_gettime system call that was the source of 6.75% of the
352copy-to-user overhead was initiated by the ``handle_input()`` busybox 352copy-to-user overhead was initiated by the ``handle_input()`` BusyBox
353function: 353function:
354 354
355.. image:: figures/perf-wget-g-copy-to-user-expanded-debuginfo.png 355.. image:: figures/perf-wget-g-copy-to-user-expanded-debuginfo.png
@@ -1900,7 +1900,7 @@ the target: ::
1900 meta-toolchain 1900 meta-toolchain
1901 meta-ide-support 1901 meta-ide-support
1902 1902
1903 You can also run generated qemu images with a command like 'runqemu qemux86-64' 1903 You can also run generated QEMU images with a command like 'runqemu qemux86-64'
1904 1904
1905Once you've done that, you can cd to whatever 1905Once you've done that, you can cd to whatever
1906directory contains your scripts and use 'crosstap' to run the script: :: 1906directory contains your scripts and use 'crosstap' to run the script: ::