[lttng-dev] Use lttng for my own module which already has trace events

Woegerer, Paul Paul_Woegerer at mentor.com
Tue Oct 8 07:25:28 EDT 2013


On 10/08/2013 01:03 PM, Michael Lausch wrote:
> Hi,
>
> I've developed a kernel module which defines TRACE_EVENTS. These events
> are shown in /sys/kernel/debug/tracing/events and i can read them
> from /sys/kernel/debug/tracing/trace if they are enabled.
>
> But i want to use these events in lttng. 
> # lttng list -k 
> does not show them. 

You need to add an lttng probe in lttng-modules to expose your ftrace
events as lttng kernel events.
See: http://git.lttng.org/?p=lttng-modules.git;a=tree;f=probes;hb=HEAD

1) Add e.g. "obj-m += lttng-probe-mycustomevents.o" in
http://git.lttng.org/?p=lttng-modules.git;a=blob_plain;f=probes/Makefile;hb=HEAD
2) Create the probe source file based on some existing probe source
file, e.g.
http://git.lttng.org/?p=lttng-modules.git;a=blob;f=probes/lttng-probe-vmscan.c;hb=HEAD
3) Add a header file that describes your events as lttng events in:
../instrumentation/events/lttng-module/mycustomevents.h
use e.g.
http://git.lttng.org/?p=lttng-modules.git;a=blob;f=instrumentation/events/lttng-module/udp.h;hb=HEAD
as a template.

HTH,
Paul

-- 
Paul Woegerer, SW Development Engineer
Sourcery Analyzer <http://go.mentor.com/sourceryanalyzer>
Mentor Graphics, Embedded Software Division




More information about the lttng-dev mailing list