[PATCH v5 02/23] perf trace: Include the augmented arg header in nanosleep's payload length
From: Ian Rogers
Date: Wed Sep 23 2026 - 03:18:37 EST
sys_enter_nanosleep() sizes the record it outputs as
unsigned int len = sizeof(augmented_args->args);
where every other augmenter that appends a payload uses
unsigned int len = sizeof(u64) + sizeof(augmented_args->args);
the extra u64 being the size and err fields of the struct augmented_arg
that the payload follows.
The payload is copied to augmented_args->arg.value, which starts 8 bytes
after the tracepoint arguments, but only len + size bytes are output. So
the record stops 8 bytes short of the end of the timespec, and userspace
reads the tail of tv_nsec from whatever follows in the ring buffer.
Count the header, as the other augmenters do.
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c b/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
index dd3aa5bd910b..18904bebf672 100644
--- a/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
+++ b/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
@@ -426,7 +426,8 @@ int sys_enter_nanosleep(struct syscall_enter_args *args)
{
struct augmented_args_payload *augmented_args = augmented_args_payload();
const void *req_arg = (const void *)args->args[0];
- unsigned int len = sizeof(augmented_args->args);
+ // the size + err in all 'augmented_arg' structs
+ unsigned int len = sizeof(u64) + sizeof(augmented_args->args);
__u32 size = sizeof(struct timespec64);
int err;
--
2.56.0.rc1.315.gc6ed9934b7-goog