[lttng-dev] Out of Tree Kernel Module

Jonathan Haws Jonathan.Haws at sdl.usu.edu
Wed Jan 21 15:55:28 EST 2015


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


More information about the lttng-dev mailing list