[lttng-dev] Out of Tree Kernel Module

Alexandre Montplaisir alexmonthy at voxpopuli.im
Wed Jan 21 16:12:49 EST 2015


Hi,

I have never tried this myself, but a similar question was asked on 
StackOverflow recently:
http://stackoverflow.com/questions/27950396/is-it-possible-to-build-lttng-probe-module-outside-of-lttng-modules-tree

and the author found a solution. Maybe this can help?

Cheers,
Alex



On 01/21/2015 03:55 PM, Jonathan Haws wrote:
> I am developing an out-of-tree kernel module and would like to
> instrument it for tracing.  I understand I will need to create an LTTng
> probe in the modules source tree, however when I try to build my module,
> I get errors stating that a header file for the subsystem doesn't exist
> in the source tree.
>
> Here is my trace event file:
>
> #undef TRACE_SYSTEM
> #define TRACE_SYSTEM sigma
>
> #if !defined(_TRACE_SIGMA_H) || defined(TRACE_HEADER_MULTI_READ)
> #define _TRACE_SIGMA_H
>
> #include <linux/tracepoint.h>
>
> TRACE_EVENT(
>      sigma_exarioctl,
>      TP_PROTO(int cmd, int pin, int value),
>      TP_ARGS(cmd, pin, value),
>
>      /* LTTng doesn't need those */
>      TP_STRUCT__entry(),
>      TP_fast_assign(),
>      TP_printk("", 0)
> );
>
> #endif
>
> /* this part must be outside protection */
> #include <trace/define_trace.h>
>
>
> When I include that in my module, I do this:
>
> #define CREATE_TRACE_POINTS
> #include "exartrace.h"
>
>
> However, when I build, I get the error:
> <KERNELDIR>/include/trace/define_trace.h:83:43: fatal error:
> trace/events/sigma.h: No such file or directory
>   #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
>
>
> Any thoughts on what I am doing wrong?
>
> Thanks!
> Jon
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev




More information about the lttng-dev mailing list