OpenCloudOS / nettrace

nettrace is a eBPF-based tool to trace network packet and diagnose network problem.
Other
326 stars 80 forks source link

make error #63

Closed linfordWu closed 1 year ago

linfordWu commented 1 year ago

make all for i in nodetrace src legacy; do make -C $i all; done make[1]: Entering directory '/root/nettrace/nodetrace' clang -O2 -c -S -Wall -fno-asynchronous-unwind-tables -Wno-incompatible-pointer-types-discards-qualifiers progs/ntrace.c -emit-llvm -Wno-unknown-attributes -I./ -I/root/nettrace/shared/bpf/ -Wno-unused-function -Wno-compare-distinct-pointer-types -Wuninitialized -D__TARGET_ARCH_x86 -target bpf -g -Xclang -disable-llvm-passes -o - | opt -O2 -mtriple=bpf-pc-linux | llvm-dis | llc -march=bpf -filetype=obj -o progs/ntrace.o bpftool gen skeleton progs/ntrace.o > progs/ntrace.skel.h gcc mark.c /root/nettrace/shared/pkt_utils.c /root/nettrace/component/net_utils.c /root/nettrace/component/arg_parse.c /root/nettrace/component/sys_utils.c /root/nettrace/shared/bpf_utils.c -o mark -lbpf -lelf -lz -O2 -static -I./ -I/root/nettrace/shared/bpf/ -Wno-deprecated-declarations -DVERSION=1.2.6 -DRELEASE=.tl3 -I/root/nettrace/shared/ -I/root/nettrace/component /root/nettrace/shared/pkt_utils.c: In function ‘ts_print_packet’: /root/nettrace/shared/pkt_utils.c:126:8: error: ‘ICMPV6_EXT_ECHO_REQUEST’ undeclared (first use in this function); did you mean ‘ICMPV6_ECHO_REQUEST’? 126 | case ICMPV6_EXT_ECHO_REQUEST: | ^~~~~~~ | ICMPV6_ECHO_REQUEST /root/nettrace/shared/pkt_utils.c:126:8: note: each undeclared identifier is reported only once for each function it appears in /root/nettrace/shared/pkt_utils.c:133:8: error: ‘ICMPV6_EXT_ECHO_REPLY’ undeclared (first use in this function); did you mean ‘ICMPV6_ECHO_REPLY’? 133 | case ICMPV6_EXT_ECHO_REPLY: | ^~~~~ | ICMPV6_ECHO_REPLY make[1]: [../common.mk:103: mark] Error 1 rm progs/ntrace.o make[1]: Leaving directory '/root/nettrace/nodetrace' make[1]: Entering directory '/root/nettrace/src' python3 gen_trace.py > trace_group.c Traceback (most recent call last): File "/root/nettrace/src/gen_trace.py", line 4, in import yaml ModuleNotFoundError: No module named 'yaml' make[1]: [Makefile:32: trace_group.c] Error 1 make[1]: Leaving directory '/root/nettrace/src' make[1]: Entering directory '/root/nettrace/legacy' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/root/nettrace/legacy'

报错原因: 1、ICMPV6_EXT_ECHO_REQUEST 和 ICMPV6_EXT_ECHO_REPLY 未定义 2、ModuleNotFoundError: No module named 'yaml'

内核版本5.10 ICMPV6_EXT_ECHO_REQUEST 和 ICMPV6_EXT_ECHO_REPLY 好像在更高版本才有

menglongdong commented 1 year ago

你好,

1、应该是用户态的库版本不够高导致,这里我做一下兼容吧。 2、python3需要安装yaml,这个我文档里也说明一下吧。

当前可先基于docker来编译,应该是没有这些问题的。 感谢!