diff options
Diffstat (limited to 'documentation/profile-manual')
| -rw-r--r-- | documentation/profile-manual/intro.rst | 4 | ||||
| -rw-r--r-- | documentation/profile-manual/usage.rst | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/documentation/profile-manual/intro.rst b/documentation/profile-manual/intro.rst index 9c8fa3dbfa..e9208dfde8 100644 --- a/documentation/profile-manual/intro.rst +++ b/documentation/profile-manual/intro.rst | |||
| @@ -7,7 +7,7 @@ Yocto Project Profiling and Tracing Manual | |||
| 7 | Introduction | 7 | Introduction |
| 8 | ============ | 8 | ============ |
| 9 | 9 | ||
| 10 | Yocto bundles a number of tracing and profiling tools - this 'HOWTO' | 10 | Yocto bundles a number of tracing and profiling tools --- this 'HOWTO' |
| 11 | describes their basic usage and shows by example how to make use of them | 11 | describes their basic usage and shows by example how to make use of them |
| 12 | to examine application and system behavior. | 12 | to examine application and system behavior. |
| 13 | 13 | ||
| @@ -26,7 +26,7 @@ please see the documentation and/or websites listed for each tool. | |||
| 26 | 26 | ||
| 27 | The final section of this 'HOWTO' is a collection of real-world examples | 27 | The final section of this 'HOWTO' is a collection of real-world examples |
| 28 | which we'll be continually adding to as we solve more problems using the | 28 | which we'll be continually adding to as we solve more problems using the |
| 29 | tools - feel free to add your own examples to the list! | 29 | tools --- feel free to add your own examples to the list! |
| 30 | 30 | ||
| 31 | General Setup | 31 | General Setup |
| 32 | ============= | 32 | ============= |
diff --git a/documentation/profile-manual/usage.rst b/documentation/profile-manual/usage.rst index 0ff9d921fd..49f8af4a74 100644 --- a/documentation/profile-manual/usage.rst +++ b/documentation/profile-manual/usage.rst | |||
| @@ -17,7 +17,7 @@ The 'perf' tool is the profiling and tracing tool that comes bundled | |||
| 17 | with the Linux kernel. | 17 | with the Linux kernel. |
| 18 | 18 | ||
| 19 | Don't let the fact that it's part of the kernel fool you into thinking | 19 | Don't let the fact that it's part of the kernel fool you into thinking |
| 20 | that it's only for tracing and profiling the kernel - you can indeed use | 20 | that it's only for tracing and profiling the kernel --- you can indeed use |
| 21 | it to trace and profile just the kernel, but you can also use it to | 21 | it to trace and profile just the kernel, but you can also use it to |
| 22 | profile specific applications separately (with or without kernel | 22 | profile specific applications separately (with or without kernel |
| 23 | context), and you can also use it to trace and profile the kernel and | 23 | context), and you can also use it to trace and profile the kernel and |
| @@ -176,7 +176,7 @@ interactive text-based UI (or simply as text if we specify ``--stdio`` to | |||
| 176 | 176 | ||
| 177 | As our first attempt at profiling this workload, we'll simply run 'perf | 177 | As our first attempt at profiling this workload, we'll simply run 'perf |
| 178 | record', handing it the workload we want to profile (everything after | 178 | record', handing it the workload we want to profile (everything after |
| 179 | 'perf record' and any perf options we hand it - here none - will be | 179 | 'perf record' and any perf options we hand it --- here none, will be |
| 180 | executed in a new shell). perf collects samples until the process exits | 180 | executed in a new shell). perf collects samples until the process exits |
| 181 | and records them in a file named 'perf.data' in the current working | 181 | and records them in a file named 'perf.data' in the current working |
| 182 | directory. :: | 182 | directory. :: |
| @@ -203,7 +203,7 @@ The above screenshot displays a 'flat' profile, one entry for each | |||
| 203 | 'bucket' corresponding to the functions that were profiled during the | 203 | 'bucket' corresponding to the functions that were profiled during the |
| 204 | profiling run, ordered from the most popular to the least (perf has | 204 | profiling run, ordered from the most popular to the least (perf has |
| 205 | options to sort in various orders and keys as well as display entries | 205 | options to sort in various orders and keys as well as display entries |
| 206 | only above a certain threshold and so on - see the perf documentation | 206 | only above a certain threshold and so on --- see the perf documentation |
| 207 | for details). Note that this includes both userspace functions (entries | 207 | for details). Note that this includes both userspace functions (entries |
| 208 | containing a [.]) and kernel functions accounted to the process (entries | 208 | containing a [.]) and kernel functions accounted to the process (entries |
| 209 | containing a [k]). (perf has command-line modifiers that can be used to | 209 | containing a [k]). (perf has command-line modifiers that can be used to |
| @@ -608,7 +608,7 @@ and tell perf to do a profile using it as the sampling event:: | |||
| 608 | The screenshot above shows the results of running a profile using | 608 | The screenshot above shows the results of running a profile using |
| 609 | sched:sched_switch tracepoint, which shows the relative costs of various | 609 | sched:sched_switch tracepoint, which shows the relative costs of various |
| 610 | paths to sched_wakeup (note that sched_wakeup is the name of the | 610 | paths to sched_wakeup (note that sched_wakeup is the name of the |
| 611 | tracepoint - it's actually defined just inside ttwu_do_wakeup(), which | 611 | tracepoint --- it's actually defined just inside ttwu_do_wakeup(), which |
| 612 | accounts for the function name actually displayed in the profile: | 612 | accounts for the function name actually displayed in the profile: |
| 613 | 613 | ||
| 614 | .. code-block:: c | 614 | .. code-block:: c |
| @@ -877,7 +877,7 @@ System-Wide Tracing and Profiling | |||
| 877 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 877 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 878 | 878 | ||
| 879 | The examples so far have focused on tracing a particular program or | 879 | The examples so far have focused on tracing a particular program or |
| 880 | workload - in other words, every profiling run has specified the program | 880 | workload --- in other words, every profiling run has specified the program |
| 881 | to profile in the command-line e.g. 'perf record wget ...'. | 881 | to profile in the command-line e.g. 'perf record wget ...'. |
| 882 | 882 | ||
| 883 | It's also possible, and more interesting in many cases, to run a | 883 | It's also possible, and more interesting in many cases, to run a |
| @@ -964,7 +964,7 @@ Filtering | |||
| 964 | Notice that there are a lot of events that don't really have anything to | 964 | Notice that there are a lot of events that don't really have anything to |
| 965 | do with what we're interested in, namely events that schedule 'perf' | 965 | do with what we're interested in, namely events that schedule 'perf' |
| 966 | itself in and out or that wake perf up. We can get rid of those by using | 966 | itself in and out or that wake perf up. We can get rid of those by using |
| 967 | the '--filter' option - for each event we specify using -e, we can add a | 967 | the '--filter' option --- for each event we specify using -e, we can add a |
| 968 | --filter after that to filter out trace events that contain fields with | 968 | --filter after that to filter out trace events that contain fields with |
| 969 | specific values:: | 969 | specific values:: |
| 970 | 970 | ||
| @@ -1135,7 +1135,7 @@ callgraphs from starting a few programs during those 30 seconds: | |||
| 1135 | .. admonition:: Tying it Together | 1135 | .. admonition:: Tying it Together |
| 1136 | 1136 | ||
| 1137 | The trace events subsystem accommodate static and dynamic tracepoints | 1137 | The trace events subsystem accommodate static and dynamic tracepoints |
| 1138 | in exactly the same way - there's no difference as far as the | 1138 | in exactly the same way --- there's no difference as far as the |
| 1139 | infrastructure is concerned. See the ftrace section for more details | 1139 | infrastructure is concerned. See the ftrace section for more details |
| 1140 | on the trace event subsystem. | 1140 | on the trace event subsystem. |
| 1141 | 1141 | ||
| @@ -1201,7 +1201,7 @@ For this section, we'll assume you've already performed the basic setup | |||
| 1201 | outlined in the ":ref:`profile-manual/intro:General Setup`" section. | 1201 | outlined in the ":ref:`profile-manual/intro:General Setup`" section. |
| 1202 | 1202 | ||
| 1203 | ftrace, trace-cmd, and kernelshark run on the target system, and are | 1203 | ftrace, trace-cmd, and kernelshark run on the target system, and are |
| 1204 | ready to go out-of-the-box - no additional setup is necessary. For the | 1204 | ready to go out-of-the-box --- no additional setup is necessary. For the |
| 1205 | rest of this section we assume you've ssh'ed to the host and will be | 1205 | rest of this section we assume you've ssh'ed to the host and will be |
| 1206 | running ftrace on the target. kernelshark is a GUI application and if | 1206 | running ftrace on the target. kernelshark is a GUI application and if |
| 1207 | you use the '-X' option to ssh you can have the kernelshark GUI run on | 1207 | you use the '-X' option to ssh you can have the kernelshark GUI run on |
| @@ -1321,7 +1321,7 @@ great way to learn about how the kernel code works in a dynamic sense. | |||
| 1321 | ftrace:function tracepoint. | 1321 | ftrace:function tracepoint. |
| 1322 | 1322 | ||
| 1323 | It is a little more difficult to follow the call chains than it needs to | 1323 | It is a little more difficult to follow the call chains than it needs to |
| 1324 | be - luckily there's a variant of the function tracer that displays the | 1324 | be --- luckily there's a variant of the function tracer that displays the |
| 1325 | callchains explicitly, called the 'function_graph' tracer:: | 1325 | callchains explicitly, called the 'function_graph' tracer:: |
| 1326 | 1326 | ||
| 1327 | root@sugarbay:/sys/kernel/debug/tracing# echo function_graph > current_tracer | 1327 | root@sugarbay:/sys/kernel/debug/tracing# echo function_graph > current_tracer |
| @@ -2138,7 +2138,7 @@ You can now view the trace in text form on the target:: | |||
| 2138 | . | 2138 | . |
| 2139 | 2139 | ||
| 2140 | You can now safely destroy the trace | 2140 | You can now safely destroy the trace |
| 2141 | session (note that this doesn't delete the trace - it's still there in | 2141 | session (note that this doesn't delete the trace --- it's still there in |
| 2142 | ~/lttng-traces):: | 2142 | ~/lttng-traces):: |
| 2143 | 2143 | ||
| 2144 | root@crownbay:~# lttng destroy | 2144 | root@crownbay:~# lttng destroy |
| @@ -2222,7 +2222,7 @@ You can now view the trace in text form on the target:: | |||
| 2222 | . | 2222 | . |
| 2223 | 2223 | ||
| 2224 | You can now safely destroy the trace session (note that this doesn't delete the | 2224 | You can now safely destroy the trace session (note that this doesn't delete the |
| 2225 | trace - it's still there in ~/lttng-traces):: | 2225 | trace --- it's still there in ~/lttng-traces):: |
| 2226 | 2226 | ||
| 2227 | root@crownbay:~# lttng destroy | 2227 | root@crownbay:~# lttng destroy |
| 2228 | Session auto-20190303-021943 destroyed at /home/root | 2228 | Session auto-20190303-021943 destroyed at /home/root |
| @@ -2557,7 +2557,7 @@ Execute the workload you're interested in:: | |||
| 2557 | root@crownbay:/sys/kernel/debug/tracing# cat /media/sdc/testfile.txt | 2557 | root@crownbay:/sys/kernel/debug/tracing# cat /media/sdc/testfile.txt |
| 2558 | 2558 | ||
| 2559 | And look at the output (note here that we're using 'trace_pipe' instead of | 2559 | And look at the output (note here that we're using 'trace_pipe' instead of |
| 2560 | trace to capture this trace - this allows us to wait around on the pipe | 2560 | trace to capture this trace --- this allows us to wait around on the pipe |
| 2561 | for data to appear):: | 2561 | for data to appear):: |
| 2562 | 2562 | ||
| 2563 | root@crownbay:/sys/kernel/debug/tracing# cat trace_pipe | 2563 | root@crownbay:/sys/kernel/debug/tracing# cat trace_pipe |
