]> bbs.cooldavid.org Git - net-next-2.6.git/blame - Documentation/trace/events.txt
hpilo: add poll f_op
[net-next-2.6.git] / Documentation / trace / events.txt
CommitLineData
abd41443
TT
1 Event Tracing
2
3 Documentation written by Theodore Ts'o
143c145e 4 Updated by Li Zefan
abd41443 5
143c145e
LZ
61. Introduction
7===============
abd41443
TT
8
9Tracepoints (see Documentation/trace/tracepoints.txt) can be used
10without creating custom kernel modules to register probe functions
11using the event tracing infrastructure.
12
13Not all tracepoints can be traced using the event tracing system;
14the kernel developer must provide code snippets which define how the
15tracing information is saved into the tracing buffer, and how the
143c145e 16tracing information should be printed.
abd41443 17
143c145e
LZ
182. Using Event Tracing
19======================
20
212.1 Via the 'set_event' interface
22---------------------------------
abd41443
TT
23
24The events which are available for tracing can be found in the file
143c145e 25/debug/tracing/available_events.
abd41443
TT
26
27To enable a particular event, such as 'sched_wakeup', simply echo it
143c145e 28to /debug/tracing/set_event. For example:
abd41443 29
143c145e 30 # echo sched_wakeup >> /debug/tracing/set_event
abd41443 31
143c145e
LZ
32[ Note: '>>' is necessary, otherwise it will firstly disable
33 all the events. ]
abd41443
TT
34
35To disable an event, echo the event name to the set_event file prefixed
36with an exclamation point:
37
143c145e
LZ
38 # echo '!sched_wakeup' >> /debug/tracing/set_event
39
40To disable all events, echo an empty line to the set_event file:
41
42 # echo > /debug/tracing/set_event
abd41443 43
143c145e 44To enable all events, echo '*:*' or '*:' to the set_event file:
abd41443 45
143c145e 46 # echo *:* > /debug/tracing/set_event
abd41443
TT
47
48The events are organized into subsystems, such as ext4, irq, sched,
49etc., and a full event name looks like this: <subsystem>:<event>. The
50subsystem name is optional, but it is displayed in the available_events
51file. 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
53command:
54
143c145e
LZ
55 # echo 'irq:*' > /debug/tracing/set_event
56
572.2 Via the 'enable' toggle
58---------------------------
59
60The events available are also listed in /debug/tracing/events/ hierarchy
61of directories.
62
63To enable event 'sched_wakeup':
64
65 # echo 1 > /debug/tracing/events/sched/sched_wakeup/enable
66
67To disable it:
68
69 # echo 0 > /debug/tracing/events/sched/sched_wakeup/enable
70
71To enable all events in sched subsystem:
72
73 # echo 1 > /debug/tracing/events/sched/enable
74
75To eanble all events:
76
77 # echo 1 > /debug/tracing/events/enable
78
79When 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
020e5f85
LZ
862.3 Boot option
87---------------
88
89In order to facilitate early boot debugging, use boot option:
90
91 trace_event=[event-list]
92
93The format of this boot option is the same as described in section 2.1.
94
143c145e
LZ
953. Defining an event-enabled tracepoint
96=======================================
97
98See The example provided in samples/trace_events
99