Skip to content

Conversation

@kylewanginchina
Copy link
Contributor

@kylewanginchina kylewanginchina commented Dec 22, 2025

This PR is for:

  • Agent

Support output the debug log of failed ebpf loading into temporary file.

Support degrade into continuous-profiler-common when continuous-profiler-5.2_plus load failed

Checklist

  • Added unit test.

Backport to branches

@kylewanginchina
Copy link
Contributor Author

kernel v5.2:
image

kernel v5.4:
image
image

kernel v5.15:
image
image

obj->license, obj->kern_version, 0, NULL,
0 /*EBPF_LOG_LEVEL, log_buf, LOG_BUF_SZ */ );
resume_stderr(stderr_fd);
if (new_prog->prog_fd < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/iovisor/bcc/blob/b1335d1ed479ebbae738c46d90dcce5adcb3dbb1/src/cc/libbpf.c#L938
bcc_prog_load()内部实现已经考虑到这种情况,看看能不能把标准错误直接输出到一个临时文件

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已去掉额外的verifier日志尾部打印,保持原先的正常错误输出,只将完整错误日志写到临时文件
image

@kylewanginchina kylewanginchina changed the title refactor: support output the debug log of failed ebpf loading into temporary file refactor: support output failed log of ebpf loading and degrade into profiler-common when profiler-5.2_plus load failed Dec 26, 2025
@kylewanginchina
Copy link
Contributor Author

加入了加载出错自动降级的逻辑,效果如下图所示:
image

另外,错误信息文件输出这块,对于指令非常多(超出1000000)导致加载出错的情况,会比较耗时,比如下图中耗时:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants