Skip to content

Commit 882fcf2

Browse files
committed
update(driver/bpf): improve btf compatibility for 4.x kernels
Signed-off-by: Lorenzo Fontana <lo@linux.com>
1 parent a137c7f commit 882fcf2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

driver/bpf/filler_helpers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,8 @@ static __always_inline int __bpf_val_to_ring(struct filler_data *data,
739739
if (data->state->tail_ctx.curoff > SCRATCH_SIZE_HALF)
740740
return PPM_FAILURE_BUFFER_FULL;
741741

742+
fix_var_compat(data->state->tail_ctx.curoff);
743+
742744
switch (type) {
743745
case PT_CHARBUF:
744746
case PT_FSPATH:

driver/bpf/fillers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ struct timeval {
5454

5555
#else
5656
#include "vmlinux.h"
57+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
5758
#define compat_timespec __kernel_old_timespec
5859
#define timespec __kernel_old_timespec
5960
#define timeval __kernel_old_timeval
61+
#endif
6062

6163
#endif // __SYSDIG_BTF_BUILD__
6264

0 commit comments

Comments
 (0)