3 Documentation written by Theodore Ts'o
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.
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.
18 2. Using Event Tracing
19 ======================
21 2.1 Via the 'set_event' interface
22 ---------------------------------
24 The events which are available for tracing can be found in the file
25 /debug/tracing/available_events.
27 To enable a particular event, such as 'sched_wakeup', simply echo it
28 to /debug/tracing/set_event. For example:
30 # echo sched_wakeup >> /debug/tracing/set_event
32 [ Note: '>>' is necessary, otherwise it will firstly disable
35 To disable an event, echo the event name to the set_event file prefixed
36 with an exclamation point:
38 # echo '!sched_wakeup' >> /debug/tracing/set_event
40 To disable all events, echo an empty line to the set_event file:
42 # echo > /debug/tracing/set_event
44 To enable all events, echo '*:*' or '*:' to the set_event file:
46 # echo *:* > /debug/tracing/set_event
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
55 # echo 'irq:*' > /debug/tracing/set_event
57 2.2 Via the 'enable' toggle
58 ---------------------------
60 The events available are also listed in /debug/tracing/events/ hierarchy
63 To enable event 'sched_wakeup':
65 # echo 1 > /debug/tracing/events/sched/sched_wakeup/enable
69 # echo 0 > /debug/tracing/events/sched/sched_wakeup/enable
71 To enable all events in sched subsystem:
73 # echo 1 > /debug/tracing/events/sched/enable
77 # echo 1 > /debug/tracing/events/enable
79 When reading one of these enable files, there are four results:
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
86 3. Defining an event-enabled tracepoint
87 =======================================
89 See The example provided in samples/trace_events