Skip to content

Conversation

@kylewanginchina
Copy link
Contributor

…mporary file

This PR is for:

  • Agent

support output the debug log of failed ebpf loading into temporary file

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()内部实现已经考虑到这种情况,看看能不能把标准错误直接输出到一个临时文件


/*
* Don't mislead users on kernels whose max insns limit
* is already bumped (>=5.3). Only warn if the kernel
Copy link
Contributor

Choose a reason for hiding this comment

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

这个地方应该是5.2
https://blog.trailofbits.com/2023/01/19/ebpf-verifier-harness/

As mentioned earlier in the post, the constraints that the verifier enforces have changed over time. For example, eBPF programs were limited to a maximum of 4,096 instructions until kernel version 5.2, which increased that number to 1 million. Kernel version 5.3 introduced the ability for eBPF programs to use bounded loops. Note, though, that the verifier will always be backward compatible in that all future versions of the verifier will accept any eBPF program accepted by older versions of the verifier.

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