Monday, January 2, 2012

Event Tracing and perf tool

event tracing in module: see sample/trace_events
event tracing in kernel: see lwn articles PI PII PIII

events are listed in /sys/kernel/debug/tracing/events/subsys/event function

also /sys/kernel/debug/tracing/available_events show a list of events.
again, an event can be sent to set_event entry for tracing.

three ways to stop/start tracing
1. echo 0/1 > subsys/enable or sybsys/event name/enable
2. echo '!func_name' > set_event... echo func_name > set_event
3. obvious echo 0/1 > tracing_on

NOTE: module Makefile should contain a line
CFLAGS_module-name.o := -I$(src)... so that the define_trace.h file can see the header file for the module where tracers are defined

tracing events can be used with perf tool (link), (link) and (link)

No comments:

Post a Comment