This is an automated email from the ASF dual-hosted git repository.
liuhan pushed a commit to branch program-too-long
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git
The following commit(s) were added to refs/heads/program-too-long by this push:
new aa0f53e Reduce program size
aa0f53e is described below
commit aa0f53e0b951f2121aa2d6dbcd2aafb314566307
Author: mrproliu <[email protected]>
AuthorDate: Fri Dec 27 07:48:10 2024 +0800
Reduce program size
---
bpf/include/socket_data.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bpf/include/socket_data.h b/bpf/include/socket_data.h
index 59e02cb..e5842b3 100644
--- a/bpf/include/socket_data.h
+++ b/bpf/include/socket_data.h
@@ -172,7 +172,10 @@ static __always_inline void upload_socket_data_iov(void
*ctx, struct iovec* iov,
__u8 iov_index = 0;
#pragma unroll
- for (__u8 index = 0; index < SOCKET_UPLOAD_CHUNK_LIMIT && iov_index <
iovlen; index++) {
+ for (__u8 index = 0; index < SOCKET_UPLOAD_CHUNK_LIMIT; index++) {
+ if (iov_index >= iovlen) {
+ return;
+ }
struct iovec cur_iov;
bpf_probe_read(&cur_iov, sizeof(cur_iov), &iov[iov_index]);