我正在尝试构建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.
答案 0 :(得分:0)
尝试安装软件包: liblttng-ust-dev , liblttng-ctl-dev
sudo apt-get install liblttng-ust-dev
sudo apt-get install liblttng-ctl-dev
希望有帮助。