|
|
@@ -307,10 +307,13 @@ void perf_event_batch_output(void *ctx, struct l7_event *e) {
|
|
|
// for (int i = 0; i < e_length; i++) { //IK:ERROR: IK: BPF stack limit of 512 bytes is exceeded. Please move large on stack variables into BPF per-cpu array map.
|
|
|
// *dst++ = *src++;
|
|
|
// }
|
|
|
- *(unsigned int *)dst = *(unsigned int *)src;
|
|
|
- dst += e_length;
|
|
|
- src += e_length;
|
|
|
-
|
|
|
+ int remaining_space = e_buff->size - e_buff->len;
|
|
|
+ bpf_printk("IK...perf_event_batch_output...remaining_space=%d", remaining_space);
|
|
|
+ if (remaining_space >= e_length) {
|
|
|
+ *(unsigned int *)dst = *(unsigned int *)src;
|
|
|
+ dst += e_length;
|
|
|
+ src += e_length;
|
|
|
+ }
|
|
|
|
|
|
// IK: 更新e_buff.
|
|
|
// __u32 e_length = sizeof(*e);
|