diff --git a/driver/modern_bpf/definitions/vmlinux.h b/driver/modern_bpf/definitions/vmlinux.h index aabda206a6..e4348edc53 100644 --- a/driver/modern_bpf/definitions/vmlinux.h +++ b/driver/modern_bpf/definitions/vmlinux.h @@ -2692,6 +2692,10 @@ enum rseq_cs_flags_bit { RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT = 2, }; +enum { + TASK_COMM_LEN = 16, +}; + struct rseq { __u32 cpu_id_start; __u32 cpu_id; @@ -136555,6 +136559,10 @@ enum rseq_cs_flags_bit { RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT = 2, }; +enum { + TASK_COMM_LEN = 16, +}; + enum uclamp_id { UCLAMP_MIN = 0, UCLAMP_MAX = 1, diff --git a/driver/modern_bpf/programs/attached/events/sched_process_exec.bpf.c b/driver/modern_bpf/programs/attached/events/sched_process_exec.bpf.c index c14217b654..b761a6f9e0 100644 --- a/driver/modern_bpf/programs/attached/events/sched_process_exec.bpf.c +++ b/driver/modern_bpf/programs/attached/events/sched_process_exec.bpf.c @@ -125,7 +125,7 @@ int BPF_PROG(sched_p_exec, auxmap__store_u32_param(auxmap, vm_swap); /* Parameter 14: comm (type: PT_CHARBUF) */ - auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, MAX_PROC_EXE, KERNEL); + auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, TASK_COMM_LEN, KERNEL); /*=============================== COLLECT PARAMETERS ===========================*/ diff --git a/driver/modern_bpf/programs/attached/events/sched_process_fork.bpf.c b/driver/modern_bpf/programs/attached/events/sched_process_fork.bpf.c index c7fdd23e9a..bac5f982fc 100644 --- a/driver/modern_bpf/programs/attached/events/sched_process_fork.bpf.c +++ b/driver/modern_bpf/programs/attached/events/sched_process_fork.bpf.c @@ -135,7 +135,7 @@ int BPF_PROG(sched_p_fork, auxmap__store_u32_param(auxmap, vm_swap); /* Parameter 14: comm (type: PT_CHARBUF) */ - auxmap__store_charbuf_param(auxmap, (unsigned long)child->comm, MAX_PROC_EXE, KERNEL); + auxmap__store_charbuf_param(auxmap, (unsigned long)child->comm, TASK_COMM_LEN, KERNEL); /*=============================== COLLECT PARAMETERS ===========================*/ diff --git a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/clone.bpf.c b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/clone.bpf.c index 8966d406f1..11c590166d 100644 --- a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/clone.bpf.c +++ b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/clone.bpf.c @@ -160,7 +160,7 @@ int BPF_PROG(clone_x, auxmap__store_u32_param(auxmap, vm_swap); /* Parameter 14: comm (type: PT_CHARBUF) */ - auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, MAX_PROC_EXE, KERNEL); + auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, TASK_COMM_LEN, KERNEL); /*=============================== COLLECT PARAMETERS ===========================*/ diff --git a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/clone3.bpf.c b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/clone3.bpf.c index ec664e09a3..0aba85312c 100644 --- a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/clone3.bpf.c +++ b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/clone3.bpf.c @@ -160,7 +160,7 @@ int BPF_PROG(clone3_x, auxmap__store_u32_param(auxmap, vm_swap); /* Parameter 14: comm (type: PT_CHARBUF) */ - auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, MAX_PROC_EXE, KERNEL); + auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, TASK_COMM_LEN, KERNEL); /*=============================== COLLECT PARAMETERS ===========================*/ diff --git a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/execve.bpf.c b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/execve.bpf.c index 64aa522f00..ce08c68937 100644 --- a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/execve.bpf.c +++ b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/execve.bpf.c @@ -168,7 +168,7 @@ int BPF_PROG(execve_x, auxmap__store_u32_param(auxmap, vm_swap); /* Parameter 14: comm (type: PT_CHARBUF) */ - auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, MAX_PROC_EXE, KERNEL); + auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, TASK_COMM_LEN, KERNEL); /*=============================== COLLECT PARAMETERS ===========================*/ diff --git a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/execveat.bpf.c b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/execveat.bpf.c index b97bedea07..7b74e62c91 100644 --- a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/execveat.bpf.c +++ b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/execveat.bpf.c @@ -185,7 +185,7 @@ int BPF_PROG(execveat_x, auxmap__store_u32_param(auxmap, vm_swap); /* Parameter 14: comm (type: PT_CHARBUF) */ - auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, MAX_PROC_EXE, KERNEL); + auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, TASK_COMM_LEN, KERNEL); /*=============================== COLLECT PARAMETERS ===========================*/ diff --git a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/fork.bpf.c b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/fork.bpf.c index 1d4c4f197b..4100ed7e61 100644 --- a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/fork.bpf.c +++ b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/fork.bpf.c @@ -162,7 +162,7 @@ int BPF_PROG(fork_x, auxmap__store_u32_param(auxmap, vm_swap); /* Parameter 14: comm (type: PT_CHARBUF) */ - auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, MAX_PROC_EXE, KERNEL); + auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, TASK_COMM_LEN, KERNEL); /*=============================== COLLECT PARAMETERS ===========================*/ diff --git a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/vfork.bpf.c b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/vfork.bpf.c index 592b477986..06eb5b1e03 100644 --- a/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/vfork.bpf.c +++ b/driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/vfork.bpf.c @@ -147,7 +147,7 @@ int BPF_PROG(vfork_x, auxmap__store_u32_param(auxmap, vm_swap); /* Parameter 14: comm (type: PT_CHARBUF) */ - auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, MAX_PROC_EXE, KERNEL); + auxmap__store_charbuf_param(auxmap, (unsigned long)task->comm, TASK_COMM_LEN, KERNEL); /*=============================== COLLECT PARAMETERS ===========================*/ diff --git a/test/modern_bpf/test_suites/generic_tracepoints_suite/sched_process_fork.cpp b/test/modern_bpf/test_suites/generic_tracepoints_suite/sched_process_fork.cpp index 057e7874bf..b254cc9772 100644 --- a/test/modern_bpf/test_suites/generic_tracepoints_suite/sched_process_fork.cpp +++ b/test/modern_bpf/test_suites/generic_tracepoints_suite/sched_process_fork.cpp @@ -399,7 +399,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_fork) evt_test->assert_cgroup_param(15); /* Parameter 16: flags (type: PT_FLAGS32) */ - evt_test->assert_numeric_param(16, (uint32_t)(uint32_t)0); + evt_test->assert_numeric_param(16, (uint32_t)0); /* Parameter 17: uid (type: PT_UINT32) */ evt_test->assert_numeric_param(17, (uint32_t)info.uid);