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.rst24
1 files changed, 12 insertions, 12 deletions
diff --git a/documentation/profile-manual/usage.rst b/documentation/profile-manual/usage.rst
index 3c9321f09c..a190e743cd 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
17with the Linux kernel. 17with the Linux kernel.
18 18
19Don't let the fact that it's part of the kernel fool you into thinking 19Don't let the fact that it's part of the kernel fool you into thinking
20that it's only for tracing and profiling the kernel - you can indeed use 20that it's only for tracing and profiling the kernel --- you can indeed use
21it to trace and profile just the kernel, but you can also use it to 21it to trace and profile just the kernel, but you can also use it to
22profile specific applications separately (with or without kernel 22profile specific applications separately (with or without kernel
23context), and you can also use it to trace and profile the kernel and 23context), 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
177As our first attempt at profiling this workload, we'll simply run 'perf 177As our first attempt at profiling this workload, we'll simply run 'perf
178record', handing it the workload we want to profile (everything after 178record', 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
180executed in a new shell). perf collects samples until the process exits 180executed in a new shell). perf collects samples until the process exits
181and records them in a file named 'perf.data' in the current working 181and records them in a file named 'perf.data' in the current working
182directory. :: 182directory. ::
@@ -202,7 +202,7 @@ The above screenshot displays a 'flat' profile, one entry for each
202'bucket' corresponding to the functions that were profiled during the 202'bucket' corresponding to the functions that were profiled during the
203profiling run, ordered from the most popular to the least (perf has 203profiling run, ordered from the most popular to the least (perf has
204options to sort in various orders and keys as well as display entries 204options to sort in various orders and keys as well as display entries
205only above a certain threshold and so on - see the perf documentation 205only above a certain threshold and so on --- see the perf documentation
206for details). Note that this includes both userspace functions (entries 206for details). Note that this includes both userspace functions (entries
207containing a [.]) and kernel functions accounted to the process (entries 207containing a [.]) and kernel functions accounted to the process (entries
208containing a [k]). (perf has command-line modifiers that can be used to 208containing a [k]). (perf has command-line modifiers that can be used to
@@ -597,7 +597,7 @@ and tell perf to do a profile using it as the sampling event::
597The screenshot above shows the results of running a profile using 597The screenshot above shows the results of running a profile using
598sched:sched_switch tracepoint, which shows the relative costs of various 598sched:sched_switch tracepoint, which shows the relative costs of various
599paths to sched_wakeup (note that sched_wakeup is the name of the 599paths to sched_wakeup (note that sched_wakeup is the name of the
600tracepoint - it's actually defined just inside ttwu_do_wakeup(), which 600tracepoint --- it's actually defined just inside ttwu_do_wakeup(), which
601accounts for the function name actually displayed in the profile: 601accounts for the function name actually displayed in the profile:
602 602
603.. code-block:: c 603.. code-block:: c
@@ -866,7 +866,7 @@ System-Wide Tracing and Profiling
866~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 866~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
867 867
868The examples so far have focused on tracing a particular program or 868The examples so far have focused on tracing a particular program or
869workload - in other words, every profiling run has specified the program 869workload --- in other words, every profiling run has specified the program
870to profile in the command-line e.g. 'perf record wget ...'. 870to profile in the command-line e.g. 'perf record wget ...'.
871 871
872It's also possible, and more interesting in many cases, to run a 872It's also possible, and more interesting in many cases, to run a
@@ -950,7 +950,7 @@ Filtering
950Notice that there are a lot of events that don't really have anything to 950Notice that there are a lot of events that don't really have anything to
951do with what we're interested in, namely events that schedule 'perf' 951do with what we're interested in, namely events that schedule 'perf'
952itself in and out or that wake perf up. We can get rid of those by using 952itself in and out or that wake perf up. We can get rid of those by using
953the '--filter' option - for each event we specify using -e, we can add a 953the '--filter' option --- for each event we specify using -e, we can add a
954--filter after that to filter out trace events that contain fields with 954--filter after that to filter out trace events that contain fields with
955specific values:: 955specific values::
956 956
@@ -1120,7 +1120,7 @@ callgraphs from starting a few programs during those 30 seconds:
1120.. admonition:: Tying it Together 1120.. admonition:: Tying it Together
1121 1121
1122 The trace events subsystem accommodate static and dynamic tracepoints 1122 The trace events subsystem accommodate static and dynamic tracepoints
1123 in exactly the same way - there's no difference as far as the 1123 in exactly the same way --- there's no difference as far as the
1124 infrastructure is concerned. See the ftrace section for more details 1124 infrastructure is concerned. See the ftrace section for more details
1125 on the trace event subsystem. 1125 on the trace event subsystem.
1126 1126
@@ -1186,7 +1186,7 @@ For this section, we'll assume you've already performed the basic setup
1186outlined in the ":ref:`profile-manual/intro:General Setup`" section. 1186outlined in the ":ref:`profile-manual/intro:General Setup`" section.
1187 1187
1188ftrace, trace-cmd, and kernelshark run on the target system, and are 1188ftrace, trace-cmd, and kernelshark run on the target system, and are
1189ready to go out-of-the-box - no additional setup is necessary. For the 1189ready to go out-of-the-box --- no additional setup is necessary. For the
1190rest of this section we assume you've ssh'ed to the host and will be 1190rest of this section we assume you've ssh'ed to the host and will be
1191running ftrace on the target. kernelshark is a GUI application and if 1191running ftrace on the target. kernelshark is a GUI application and if
1192you use the '-X' option to ssh you can have the kernelshark GUI run on 1192you use the '-X' option to ssh you can have the kernelshark GUI run on
@@ -1306,7 +1306,7 @@ great way to learn about how the kernel code works in a dynamic sense.
1306 ftrace:function tracepoint. 1306 ftrace:function tracepoint.
1307 1307
1308It is a little more difficult to follow the call chains than it needs to 1308It is a little more difficult to follow the call chains than it needs to
1309be - luckily there's a variant of the function tracer that displays the 1309be --- luckily there's a variant of the function tracer that displays the
1310callchains explicitly, called the 'function_graph' tracer:: 1310callchains explicitly, called the 'function_graph' tracer::
1311 1311
1312 root@sugarbay:/sys/kernel/debug/tracing# echo function_graph > current_tracer 1312 root@sugarbay:/sys/kernel/debug/tracing# echo function_graph > current_tracer
@@ -2116,7 +2116,7 @@ You can now view the trace in text form on the target::
2116 . 2116 .
2117 2117
2118You can now safely destroy the trace 2118You can now safely destroy the trace
2119session (note that this doesn't delete the trace - it's still there in 2119session (note that this doesn't delete the trace --- it's still there in
2120~/lttng-traces):: 2120~/lttng-traces)::
2121 2121
2122 root@crownbay:~# lttng destroy 2122 root@crownbay:~# lttng destroy
@@ -2200,7 +2200,7 @@ You can now view the trace in text form on the target::
2200 . 2200 .
2201 2201
2202You can now safely destroy the trace session (note that this doesn't delete the 2202You can now safely destroy the trace session (note that this doesn't delete the
2203trace - it's still there in ~/lttng-traces):: 2203trace --- it's still there in ~/lttng-traces)::
2204 2204
2205 root@crownbay:~# lttng destroy 2205 root@crownbay:~# lttng destroy
2206 Session auto-20190303-021943 destroyed at /home/root 2206 Session auto-20190303-021943 destroyed at /home/root
@@ -2536,7 +2536,7 @@ Execute the workload you're interested in::
2536 root@crownbay:/sys/kernel/debug/tracing# cat /media/sdc/testfile.txt 2536 root@crownbay:/sys/kernel/debug/tracing# cat /media/sdc/testfile.txt
2537 2537
2538And look at the output (note here that we're using 'trace_pipe' instead of 2538And look at the output (note here that we're using 'trace_pipe' instead of
2539trace to capture this trace - this allows us to wait around on the pipe 2539trace to capture this trace --- this allows us to wait around on the pipe
2540for data to appear):: 2540for data to appear)::
2541 2541
2542 root@crownbay:/sys/kernel/debug/tracing# cat trace_pipe 2542 root@crownbay:/sys/kernel/debug/tracing# cat trace_pipe