All of lore.kernel.org
 help / color / mirror / Atom feed
* Use lttng for my own module which already has trace events
@ 2013-10-08 11:03 Michael Lausch
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Lausch @ 2013-10-08 11:03 UTC (permalink / raw)
  To: lttng-dev

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. 

How to make these events available to lttng? Do i need to write a lttng
module? If so, what's the best way to do this for a out of kernel module
which is under the GPL? 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use lttng for my own module which already has trace events
       [not found]   ` <6B3AC2788014DD49B43AF9611365BBAA21CACCA461@mary.at.omicron.at>
@ 2013-10-08 13:10     ` Francis Giraldeau
  0 siblings, 0 replies; 4+ messages in thread
From: Francis Giraldeau @ 2013-10-08 13:10 UTC (permalink / raw)
  To: lttng-dev

Le 2013-10-08 08:42, Michael Lausch a écrit :
> On Tue, 2013-10-08 at 13:25 +0200, Woegerer, Paul wrote:
>> 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.
> 
> I did this, but this has some maintenance problems. I'd like not to
> change or add something to the lttng-module source. I'd like to compile
> the lttng tracepoints, depending on some config variable int he same
> step as the kernel module.
> 
> If that's not possible, maintenannce of the module get's a little bit
> harder. 

I do maintain an "addons" module branch for experimental purposes. When
the utility of the tracepoints are demonstrated, then it becomes easier
to push them upstream. Your contributions are welcome.

https://github.com/giraldeau/lttng-modules

BTW, if the kernel has CONFIG_MODULE_SIG=y (from Ubuntu with kernel
3.8), then it won't load tracepoints defined in modules. The addons
branch has the necessary steps to create a x509 certificate and load the
key, such that the tracepoints are visible. It doesn't seems you are
affected by this, but still good to know ;-)

Cheers,

Francis

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use lttng for my own module which already has trace events
       [not found] ` <5253EBA8.2050205@mentor.com>
@ 2013-10-08 12:42   ` Michael Lausch
       [not found]   ` <6B3AC2788014DD49B43AF9611365BBAA21CACCA461@mary.at.omicron.at>
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Lausch @ 2013-10-08 12:42 UTC (permalink / raw)
  To: Paul_Woegerer; +Cc: lttng-dev

On Tue, 2013-10-08 at 13:25 +0200, Woegerer, Paul wrote:
> 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.

I did this, but this has some maintenance problems. I'd like not to
change or add something to the lttng-module source. I'd like to compile
the lttng tracepoints, depending on some config variable int he same
step as the kernel module.

If that's not possible, maintenannce of the module get's a little bit
harder. 

 thanks anyway.
michael

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use lttng for my own module which already has trace events
       [not found] <6B3AC2788014DD49B43AF9611365BBAA21CACCA460@mary.at.omicron.at>
@ 2013-10-08 11:25 ` Woegerer, Paul
       [not found] ` <5253EBA8.2050205@mentor.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Woegerer, Paul @ 2013-10-08 11:25 UTC (permalink / raw)
  To: Michael Lausch, lttng-dev

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-08 13:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-08 11:03 Use lttng for my own module which already has trace events Michael Lausch
     [not found] <6B3AC2788014DD49B43AF9611365BBAA21CACCA460@mary.at.omicron.at>
2013-10-08 11:25 ` Woegerer, Paul
     [not found] ` <5253EBA8.2050205@mentor.com>
2013-10-08 12:42   ` Michael Lausch
     [not found]   ` <6B3AC2788014DD49B43AF9611365BBAA21CACCA461@mary.at.omicron.at>
2013-10-08 13:10     ` Francis Giraldeau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.