0

我正在尝试构建 LTTng 文档中可用的示例。我正面临这个致命的错误。我尝试了不同版本的 gcc。另外,我尝试使用 lttng 2.6 和 lttng 2.8.6 构建它。

你好-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>

你好-tp.c

#define TRACEPOINT_CREATE_PROBES
#define TRACEPOINT_DEFINE

#include "hello-tp.h"

通过运行:

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

错误:

 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.
4

1 回答 1

1

尝试安装软件包:liblttng-ust-devliblttng-ctl-dev

sudo apt-get install liblttng-ust-dev

sudo apt-get install liblttng-ctl-dev

希望有帮助。

于 2018-10-16T11:08:19.333 回答