Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
| 2 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" |
| 3 | [<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 4 | <!--SPDX-License-Identifier: CC-BY-2.0-UK--> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | |
| 6 | <chapter id='profile-manual-intro'> |
| 7 | |
| 8 | <title>Yocto Project Profiling and Tracing Manual</title> |
| 9 | <section id='profile-intro'> |
| 10 | <title>Introduction</title> |
| 11 | |
| 12 | <para> |
| 13 | Yocto bundles a number of tracing and profiling tools - this 'HOWTO' |
| 14 | describes their basic usage and shows by example how to make use |
| 15 | of them to examine application and system behavior. |
| 16 | </para> |
| 17 | |
| 18 | <para> |
| 19 | The tools presented are for the most part completely open-ended and |
| 20 | have quite good and/or extensive documentation of their own which |
| 21 | can be used to solve just about any problem you might come across |
| 22 | in Linux. |
| 23 | Each section that describes a particular tool has links to that |
| 24 | tool's documentation and website. |
| 25 | </para> |
| 26 | |
| 27 | <para> |
| 28 | The purpose of this 'HOWTO' is to present a set of common and |
| 29 | generally useful tracing and profiling idioms along with their |
| 30 | application (as appropriate) to each tool, in the context of a |
| 31 | general-purpose 'drill-down' methodology that can be applied |
| 32 | to solving a large number (90%?) of problems. |
| 33 | For help with more advanced usages and problems, please see |
| 34 | the documentation and/or websites listed for each tool. |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | The final section of this 'HOWTO' is a collection of real-world |
| 39 | examples which we'll be continually adding to as we solve more |
| 40 | problems using the tools - feel free to add your own examples |
| 41 | to the list! |
| 42 | </para> |
| 43 | </section> |
| 44 | |
| 45 | <section id='profile-manual-general-setup'> |
| 46 | <title>General Setup</title> |
| 47 | |
| 48 | <para> |
| 49 | Most of the tools are available only in 'sdk' images or in images |
| 50 | built after adding 'tools-profile' to your local.conf. |
| 51 | So, in order to be able to access all of the tools described here, |
| 52 | please first build and boot an 'sdk' image e.g. |
| 53 | <literallayout class='monospaced'> |
| 54 | $ bitbake core-image-sato-sdk |
| 55 | </literallayout> |
| 56 | or alternatively by adding 'tools-profile' to the |
| 57 | EXTRA_IMAGE_FEATURES line in your local.conf: |
| 58 | <literallayout class='monospaced'> |
| 59 | EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile" |
| 60 | </literallayout> |
| 61 | If you use the 'tools-profile' method, you don't need to build an |
| 62 | sdk image - the tracing and profiling tools will be included in |
| 63 | non-sdk images as well e.g.: |
| 64 | <literallayout class='monospaced'> |
| 65 | $ bitbake core-image-sato |
| 66 | </literallayout> |
| 67 | <note><para> |
| 68 | By default, the Yocto build system strips symbols from the |
| 69 | binaries it packages, which makes it difficult to use some |
| 70 | of the tools. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 71 | </para><para>You can prevent that by setting the |
| 72 | <ulink url='&YOCTO_DOCS_REF_URL;#var-INHIBIT_PACKAGE_STRIP'><filename>INHIBIT_PACKAGE_STRIP</filename></ulink> |
| 73 | variable to "1" in your |
| 74 | <filename>local.conf</filename> when you build the image: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | </para> |
| 76 | </note> |
| 77 | <literallayout class='monospaced'> |
| 78 | INHIBIT_PACKAGE_STRIP = "1" |
| 79 | </literallayout> |
| 80 | The above setting will noticeably increase the size of your image. |
| 81 | </para> |
| 82 | |
| 83 | <para> |
| 84 | If you've already built a stripped image, you can generate |
| 85 | debug packages (xxx-dbg) which you can manually install as |
| 86 | needed. |
| 87 | </para> |
| 88 | |
| 89 | <para> |
| 90 | To generate debug info for packages, you can add dbg-pkgs to |
| 91 | EXTRA_IMAGE_FEATURES in local.conf. For example: |
| 92 | <literallayout class='monospaced'> |
| 93 | EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs" |
| 94 | </literallayout> |
| 95 | Additionally, in order to generate the right type of |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 96 | debuginfo, we also need to set |
| 97 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_DEBUG_SPLIT_STYLE'><filename>PACKAGE_DEBUG_SPLIT_STYLE</filename></ulink> |
| 98 | in the <filename>local.conf</filename> file: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 99 | <literallayout class='monospaced'> |
| 100 | PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory' |
| 101 | </literallayout> |
| 102 | </para> |
| 103 | </section> |
| 104 | </chapter> |
| 105 | <!-- |
| 106 | vim: expandtab tw=80 ts=4 |
| 107 | --> |