diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-10 22:53:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-10 22:53:40 -0400 |
commit | 862366118026a358882eefc70238dbcc3db37aac (patch) | |
tree | 4eb62bc10327a5afac064a95a091ea05ecd2acc1 /Documentation | |
parent | 57eee9ae7bbcfb692dc96c739a5184adb6349733 (diff) | |
parent | 511b01bdf64ad8a38414096eab283c7784aebfc4 (diff) |
Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (244 commits)
Revert "x86, bts: reenable ptrace branch trace support"
tracing: do not translate event helper macros in print format
ftrace/documentation: fix typo in function grapher name
tracing/events: convert block trace points to TRACE_EVENT(), fix !CONFIG_BLOCK
tracing: add protection around module events unload
tracing: add trace_seq_vprint interface
tracing: fix the block trace points print size
tracing/events: convert block trace points to TRACE_EVENT()
ring-buffer: fix ret in rb_add_time_stamp
ring-buffer: pass in lockdep class key for reader_lock
tracing: add annotation to what type of stack trace is recorded
tracing: fix multiple use of __print_flags and __print_symbolic
tracing/events: fix output format of user stack
tracing/events: fix output format of kernel stack
tracing/trace_stack: fix the number of entries in the header
ring-buffer: discard timestamps that are at the start of the buffer
ring-buffer: try to discard unneeded timestamps
ring-buffer: fix bug in ring_buffer_discard_commit
ftrace: do not profile functions when disabled
tracing: make trace pipe recognize latency format flag
...
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/DocBook/Makefile | 3 | ||||
-rw-r--r-- | Documentation/DocBook/tracepoint.tmpl | 89 | ||||
-rw-r--r-- | Documentation/kernel-parameters.txt | 27 | ||||
-rw-r--r-- | Documentation/trace/events.txt | 90 | ||||
-rw-r--r-- | Documentation/trace/ftrace.txt | 2 | ||||
-rw-r--r-- | Documentation/trace/power.txt | 17 |
6 files changed, 214 insertions, 14 deletions
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index b1eb661e6302..9632444f6c62 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
@@ -13,7 +13,8 @@ DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \ | |||
13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ | 13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ |
14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ | 14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ |
15 | mac80211.xml debugobjects.xml sh.xml regulator.xml \ | 15 | mac80211.xml debugobjects.xml sh.xml regulator.xml \ |
16 | alsa-driver-api.xml writing-an-alsa-driver.xml | 16 | alsa-driver-api.xml writing-an-alsa-driver.xml \ |
17 | tracepoint.xml | ||
17 | 18 | ||
18 | ### | 19 | ### |
19 | # The build process is as follows (targets): | 20 | # The build process is as follows (targets): |
diff --git a/Documentation/DocBook/tracepoint.tmpl b/Documentation/DocBook/tracepoint.tmpl new file mode 100644 index 000000000000..b0756d0fd579 --- /dev/null +++ b/Documentation/DocBook/tracepoint.tmpl | |||
@@ -0,0 +1,89 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> | ||
4 | |||
5 | <book id="Tracepoints"> | ||
6 | <bookinfo> | ||
7 | <title>The Linux Kernel Tracepoint API</title> | ||
8 | |||
9 | <authorgroup> | ||
10 | <author> | ||
11 | <firstname>Jason</firstname> | ||
12 | <surname>Baron</surname> | ||
13 | <affiliation> | ||
14 | <address> | ||
15 | <email>jbaron@redhat.com</email> | ||
16 | </address> | ||
17 | </affiliation> | ||
18 | </author> | ||
19 | </authorgroup> | ||
20 | |||
21 | <legalnotice> | ||
22 | <para> | ||
23 | This documentation is free software; you can redistribute | ||
24 | it and/or modify it under the terms of the GNU General Public | ||
25 | License as published by the Free Software Foundation; either | ||
26 | version 2 of the License, or (at your option) any later | ||
27 | version. | ||
28 | </para> | ||
29 | |||
30 | <para> | ||
31 | This program is distributed in the hope that it will be | ||
32 | useful, but WITHOUT ANY WARRANTY; without even the implied | ||
33 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
34 | See the GNU General Public License for more details. | ||
35 | </para> | ||
36 | |||
37 | <para> | ||
38 | You should have received a copy of the GNU General Public | ||
39 | License along with this program; if not, write to the Free | ||
40 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
41 | MA 02111-1307 USA | ||
42 | </para> | ||
43 | |||
44 | <para> | ||
45 | For more details see the file COPYING in the source | ||
46 | distribution of Linux. | ||
47 | </para> | ||
48 | </legalnotice> | ||
49 | </bookinfo> | ||
50 | |||
51 | <toc></toc> | ||
52 | <chapter id="intro"> | ||
53 | <title>Introduction</title> | ||
54 | <para> | ||
55 | Tracepoints are static probe points that are located in strategic points | ||
56 | throughout the kernel. 'Probes' register/unregister with tracepoints | ||
57 | via a callback mechanism. The 'probes' are strictly typed functions that | ||
58 | are passed a unique set of parameters defined by each tracepoint. | ||
59 | </para> | ||
60 | |||
61 | <para> | ||
62 | From this simple callback mechanism, 'probes' can be used to profile, debug, | ||
63 | and understand kernel behavior. There are a number of tools that provide a | ||
64 | framework for using 'probes'. These tools include Systemtap, ftrace, and | ||
65 | LTTng. | ||
66 | </para> | ||
67 | |||
68 | <para> | ||
69 | Tracepoints are defined in a number of header files via various macros. Thus, | ||
70 | the purpose of this document is to provide a clear accounting of the available | ||
71 | tracepoints. The intention is to understand not only what tracepoints are | ||
72 | available but also to understand where future tracepoints might be added. | ||
73 | </para> | ||
74 | |||
75 | <para> | ||
76 | The API presented has functions of the form: | ||
77 | <function>trace_tracepointname(function parameters)</function>. These are the | ||
78 | tracepoints callbacks that are found throughout the code. Registering and | ||
79 | unregistering probes with these callback sites is covered in the | ||
80 | <filename>Documentation/trace/*</filename> directory. | ||
81 | </para> | ||
82 | </chapter> | ||
83 | |||
84 | <chapter id="irq"> | ||
85 | <title>IRQ</title> | ||
86 | !Iinclude/trace/events/irq.h | ||
87 | </chapter> | ||
88 | |||
89 | </book> | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index f08e2bebb186..4a3c2209a124 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -56,7 +56,6 @@ parameter is applicable: | |||
56 | ISAPNP ISA PnP code is enabled. | 56 | ISAPNP ISA PnP code is enabled. |
57 | ISDN Appropriate ISDN support is enabled. | 57 | ISDN Appropriate ISDN support is enabled. |
58 | JOY Appropriate joystick support is enabled. | 58 | JOY Appropriate joystick support is enabled. |
59 | KMEMTRACE kmemtrace is enabled. | ||
60 | LIBATA Libata driver is enabled | 59 | LIBATA Libata driver is enabled |
61 | LP Printer support is enabled. | 60 | LP Printer support is enabled. |
62 | LOOP Loopback device support is enabled. | 61 | LOOP Loopback device support is enabled. |
@@ -754,12 +753,25 @@ and is between 256 and 4096 characters. It is defined in the file | |||
754 | ia64_pal_cache_flush instead of SAL_CACHE_FLUSH. | 753 | ia64_pal_cache_flush instead of SAL_CACHE_FLUSH. |
755 | 754 | ||
756 | ftrace=[tracer] | 755 | ftrace=[tracer] |
757 | [ftrace] will set and start the specified tracer | 756 | [FTRACE] will set and start the specified tracer |
758 | as early as possible in order to facilitate early | 757 | as early as possible in order to facilitate early |
759 | boot debugging. | 758 | boot debugging. |
760 | 759 | ||
761 | ftrace_dump_on_oops | 760 | ftrace_dump_on_oops |
762 | [ftrace] will dump the trace buffers on oops. | 761 | [FTRACE] will dump the trace buffers on oops. |
762 | |||
763 | ftrace_filter=[function-list] | ||
764 | [FTRACE] Limit the functions traced by the function | ||
765 | tracer at boot up. function-list is a comma separated | ||
766 | list of functions. This list can be changed at run | ||
767 | time by the set_ftrace_filter file in the debugfs | ||
768 | tracing directory. | ||
769 | |||
770 | ftrace_notrace=[function-list] | ||
771 | [FTRACE] Do not trace the functions specified in | ||
772 | function-list. This list can be changed at run time | ||
773 | by the set_ftrace_notrace file in the debugfs | ||
774 | tracing directory. | ||
763 | 775 | ||
764 | gamecon.map[2|3]= | 776 | gamecon.map[2|3]= |
765 | [HW,JOY] Multisystem joystick and NES/SNES/PSX pad | 777 | [HW,JOY] Multisystem joystick and NES/SNES/PSX pad |
@@ -1056,15 +1068,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1056 | use the HighMem zone if it exists, and the Normal | 1068 | use the HighMem zone if it exists, and the Normal |
1057 | zone if it does not. | 1069 | zone if it does not. |
1058 | 1070 | ||
1059 | kmemtrace.enable= [KNL,KMEMTRACE] Format: { yes | no } | ||
1060 | Controls whether kmemtrace is enabled | ||
1061 | at boot-time. | ||
1062 | |||
1063 | kmemtrace.subbufs=n [KNL,KMEMTRACE] Overrides the number of | ||
1064 | subbufs kmemtrace's relay channel has. Set this | ||
1065 | higher than default (KMEMTRACE_N_SUBBUFS in code) if | ||
1066 | you experience buffer overruns. | ||
1067 | |||
1068 | kgdboc= [HW] kgdb over consoles. | 1071 | kgdboc= [HW] kgdb over consoles. |
1069 | Requires a tty driver that supports console polling. | 1072 | Requires a tty driver that supports console polling. |
1070 | (only serial suported for now) | 1073 | (only serial suported for now) |
diff --git a/Documentation/trace/events.txt b/Documentation/trace/events.txt new file mode 100644 index 000000000000..f157d7594ea7 --- /dev/null +++ b/Documentation/trace/events.txt | |||
@@ -0,0 +1,90 @@ | |||
1 | Event Tracing | ||
2 | |||
3 | Documentation written by Theodore Ts'o | ||
4 | Updated by Li Zefan | ||
5 | |||
6 | 1. Introduction | ||
7 | =============== | ||
8 | |||
9 | Tracepoints (see Documentation/trace/tracepoints.txt) can be used | ||
10 | without creating custom kernel modules to register probe functions | ||
11 | using the event tracing infrastructure. | ||
12 | |||
13 | Not all tracepoints can be traced using the event tracing system; | ||
14 | the kernel developer must provide code snippets which define how the | ||
15 | tracing information is saved into the tracing buffer, and how the | ||
16 | tracing information should be printed. | ||
17 | |||
18 | 2. Using Event Tracing | ||
19 | ====================== | ||
20 | |||
21 | 2.1 Via the 'set_event' interface | ||
22 | --------------------------------- | ||
23 | |||
24 | The events which are available for tracing can be found in the file | ||
25 | /debug/tracing/available_events. | ||
26 | |||
27 | To enable a particular event, such as 'sched_wakeup', simply echo it | ||
28 | to /debug/tracing/set_event. For example: | ||
29 | |||
30 | # echo sched_wakeup >> /debug/tracing/set_event | ||
31 | |||
32 | [ Note: '>>' is necessary, otherwise it will firstly disable | ||
33 | all the events. ] | ||
34 | |||
35 | To disable an event, echo the event name to the set_event file prefixed | ||
36 | with an exclamation point: | ||
37 | |||
38 | # echo '!sched_wakeup' >> /debug/tracing/set_event | ||
39 | |||
40 | To disable all events, echo an empty line to the set_event file: | ||
41 | |||
42 | # echo > /debug/tracing/set_event | ||
43 | |||
44 | To enable all events, echo '*:*' or '*:' to the set_event file: | ||
45 | |||
46 | # echo *:* > /debug/tracing/set_event | ||
47 | |||
48 | The events are organized into subsystems, such as ext4, irq, sched, | ||
49 | etc., and a full event name looks like this: <subsystem>:<event>. The | ||
50 | subsystem name is optional, but it is displayed in the available_events | ||
51 | file. All of the events in a subsystem can be specified via the syntax | ||
52 | "<subsystem>:*"; for example, to enable all irq events, you can use the | ||
53 | command: | ||
54 | |||
55 | # echo 'irq:*' > /debug/tracing/set_event | ||
56 | |||
57 | 2.2 Via the 'enable' toggle | ||
58 | --------------------------- | ||
59 | |||
60 | The events available are also listed in /debug/tracing/events/ hierarchy | ||
61 | of directories. | ||
62 | |||
63 | To enable event 'sched_wakeup': | ||
64 | |||
65 | # echo 1 > /debug/tracing/events/sched/sched_wakeup/enable | ||
66 | |||
67 | To disable it: | ||
68 | |||
69 | # echo 0 > /debug/tracing/events/sched/sched_wakeup/enable | ||
70 | |||
71 | To enable all events in sched subsystem: | ||
72 | |||
73 | # echo 1 > /debug/tracing/events/sched/enable | ||
74 | |||
75 | To eanble all events: | ||
76 | |||
77 | # echo 1 > /debug/tracing/events/enable | ||
78 | |||
79 | When reading one of these enable files, there are four results: | ||
80 | |||
81 | 0 - all events this file affects are disabled | ||
82 | 1 - all events this file affects are enabled | ||
83 | X - there is a mixture of events enabled and disabled | ||
84 | ? - this file does not affect any event | ||
85 | |||
86 | 3. Defining an event-enabled tracepoint | ||
87 | ======================================= | ||
88 | |||
89 | See The example provided in samples/trace_events | ||
90 | |||
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index e362f50c496f..2a82d8602944 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt | |||
@@ -179,7 +179,7 @@ Here is the list of current tracers that may be configured. | |||
179 | 179 | ||
180 | Function call tracer to trace all kernel functions. | 180 | Function call tracer to trace all kernel functions. |
181 | 181 | ||
182 | "function_graph_tracer" | 182 | "function_graph" |
183 | 183 | ||
184 | Similar to the function tracer except that the | 184 | Similar to the function tracer except that the |
185 | function tracer probes the functions on their entry | 185 | function tracer probes the functions on their entry |
diff --git a/Documentation/trace/power.txt b/Documentation/trace/power.txt new file mode 100644 index 000000000000..cd805e16dc27 --- /dev/null +++ b/Documentation/trace/power.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | The power tracer collects detailed information about C-state and P-state | ||
2 | transitions, instead of just looking at the high-level "average" | ||
3 | information. | ||
4 | |||
5 | There is a helper script found in scrips/tracing/power.pl in the kernel | ||
6 | sources which can be used to parse this information and create a | ||
7 | Scalable Vector Graphics (SVG) picture from the trace data. | ||
8 | |||
9 | To use this tracer: | ||
10 | |||
11 | echo 0 > /sys/kernel/debug/tracing/tracing_enabled | ||
12 | echo power > /sys/kernel/debug/tracing/current_tracer | ||
13 | echo 1 > /sys/kernel/debug/tracing/tracing_enabled | ||
14 | sleep 1 | ||
15 | echo 0 > /sys/kernel/debug/tracing/tracing_enabled | ||
16 | cat /sys/kernel/debug/tracing/trace | \ | ||
17 | perl scripts/tracing/power.pl > out.sv | ||