Repository navigation
Use of memcpy in bpf programs #4517
Unanswered
Dave Thaler (dthaler)
asked this question in
Q&A
Replies: 2 comments 2 replies
|
llvm/llvm-project#93700 says __builtin_memcpy only works if the size is a constant, but also says "Optimization level -O3 introduces memcpy calls with non-constexpr length." |
1 reply
|
Recommendation is to document __builtin_memcpy in the bpf_memcpy helper function. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
PR #3324 added helpers like bpf_memcpy.
However some web docs (e.g., stackoverflow thread, bpftrace discussion) recommend using
__builtin_memcpyinstead (supported by clang and gcc).Though https://blogs.oracle.com/linux/post/intro-to-bcc-2 says it's a bcc thing.
Does the builtin work with clang and ebpf-for-windows?
Is there a difference in functionality?
Aren't the helper functions slower?
Are the helper functions really needed?
Also related to PR #4509
All reactions