Zeeshan Hayat
Zeeshan Hayat

Reputation: 431

LTTng: user application tracing fatal error

I am trying to build the example available in the LTTng documentation. I am facing this fatal error. I tried it with different versions of gcc. Also, I tried to build it with lttng 2.6 and lttng 2.8.6.

hello-tp.h

#undef TRACEPOINT_PROVIDER 
#define TRACEPOINT_PROVIDER hello_world

#undef TRACEPOINT_INCLUDE
#define TRACEPOINT_INCLUDE "./hello-tp.h"

#if !defined(_HELLO_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
#define _HELLO_TP_H

#include <lttng/tracepoint.h>

TRACEPOINT_EVENT(
hello_world,
my_first_tracepoint,
TP_ARGS(
    int, my_integer_arg,
    char*, my_string_arg
),
TP_FIELDS(
    ctf_string(my_string_field, my_string_arg)
    ctf_integer(int, my_integer_field, my_integer_arg)
)
)

#endif /* _HELLO_TP_H */

#include <lttng/tracepoint-event.h>

hello-tp.c

#define TRACEPOINT_CREATE_PROBES
#define TRACEPOINT_DEFINE

#include "hello-tp.h"

by running this:

gcc -c -I /lttng/2.6/include/ hello-tp.c

error:

 lttng/2.6/include/lttng/tracepoint-event.h:56:28: fatal error: hello-tp.h: 
 No such file or directory
 #include TRACEPOINT_INCLUDE
                        ^
 compilation terminated.

Upvotes: 0

Views: 1001

Answers (1)

WuestenFuchs
WuestenFuchs

Reputation: 11

try to install the packages: liblttng-ust-dev, liblttng-ctl-dev

sudo apt-get install liblttng-ust-dev

sudo apt-get install liblttng-ctl-dev

Hope that helps.

Upvotes: 1

Related Questions