ocfs2: add trace event support for ocfs2
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest0 of 2 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 2 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Ocfs2-devel] [PATCH 0/2] ocfs2: add trace event support for ocfs2
Quoted 11 lines · Wengang Wang
following patches add trace event support for ocfs2. for tracepoint, see
Documentation/trace/tracepoints.txtfor trace events, seeDocumentation/trace/events.txtthe first patch add file
include/trace/events/ocfs2.hto kernel tree. it is used to store trace declarations. it's contents are self-explained.
NOTE that each ocfs2 header file should be above "#include <linux/tracepoint.h>"the second one is an example which adds trace event to
ocfs2_file_aio_read(). NOTE thatCREATE_TRACE_POINTSmust be defined before includingtrace/event/ocfs2.hwhen trace event is used.
and CREATE_TRACE_POINTS should be defined in only one .c file please.
regards,
wengang.
Quoted 28 lines
enable/disable the trace event:
1) debugfs is need to be mount for using trace event. mount -t debugfs debugfs /sys/kernel/debug(or somewhere else)
2) enable/disable some specific event,echo '1'/'0'>/sys/kernel/debug/tracing/events/ocfs2/ocfs2_file_aio_read/enable3) to see the trace log,
cat/sys/kernel/debug/tracing/tracean output example is:
[root at cool ocfs2_file_aio_read]# cat/sys/kernel/debug/tracing/trace# tracer: nop
#
# TASK-PID CPU# TIMESTAMP FUNCTION
# | | | | |cat-2587 [001] 708.929889: ocfs2_file_aio_read: 0xf544bed8 0xf544bf5c 1 0 cat-2587 [000] 708.944128: ocfs2_file_aio_read: 0xf544bed8 0xf544bf5c 1 43examples of using filter.
1) if pid is 0, do the trace:echo "common_pid == 0" >/sys/kernel/debug/tracing/events/ocfs2/ocfs2_file_aio_read/filter 2) if group id not 0, do the trace: echo "common_tgid != 0" >filterfor filter expression, so far, see http://article.gmane.org/gmane.linux.kernel/887690?