deepflowio/deepflow

deepflow-agent compile failed: ND_UINT8、ND_SIZET undefined

Closed this issue · 2 comments

Search before asking

  • I had searched in the issues and found no similar feature requirement.

DeepFlow Component

Agent

What you expected to happen

内核版本为6.3.9,centos版本为7.9的虚拟机中,在deepflow tag v6.4.9上进行手动编译,出现如下error

--- stderr
user/symbol.c: In function ‘resolve_func_ret_addr’:
user/symbol.c:213:43: error: ‘ND_UINT8’ undeclared (first use in this function)
213 | status = NdDecodeEx(&ix, (ND_UINT8 *) (buffer + offset), remian,
| ^~~~~~~~
user/symbol.c:213:43: note: each undeclared identifier is reported only once for each function it appears in
user/symbol.c:213:53: error: expected expression before ‘)’ token
213 | status = NdDecodeEx(&ix, (ND_UINT8 *) (buffer + offset), remian,
| ^
user/symbol.c: At top level:
user/symbol.c:459:33: error: unknown type name ‘ND_SIZET’; did you mean ‘ND_SIB’?
459 | void *nd_memset(void *s, int c, ND_SIZET n)
| ^~~~~~~~
| ND_SIB
make: *** [Makefile:158:staticobjs/user/symbol.o] 错误 1

thread 'main' panicked at build.rs:94:9:
compile libtrace.a error!
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

image


在项目中全局搜索ND_UINT8和ND_SIZET,除agent/src/ebpf/user/symbol.c本身在使用外,均查询不到定义的地方
image

image

How to reproduce

cargo build

DeepFlow version

No response

DeepFlow agent list

No response

Kubernetes CNI

No response

Operation-System/Kernel version

centos版本为7.9
内核版本为6.3.9

Anything else

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

手动编译坑比较多,很多情况下即使按照文档来也不一定成功。所以我们更建议使用上一条回复的链接中我们构建好的镜像来编译。
如果情况特殊,不得不手动编译,可以参考我们的构建的环境的 Dockerfile,可以参考这个去装一下依赖:
https://github.com/deepflowio/deepflow/blob/package-rust-env/agent/docker/DockerfileToFix.build