Re: [PATCH v6 02/26] perf trace: Include the augmented arg header in nanosleep's payload length

From: Namhyung Kim

Date: Wed Sep 30 2026 - 00:02:55 EST


On Mon, Sep 28, 2026 at 11:25:41AM -0700, Ian Rogers wrote:
> Unlike the other augmenters, sys_enter_nanosleep() leaves the struct
> augmented_arg size and err fields out of the record length, so the
> output stops 8 bytes short of the end of the timespec payload. Count
> the header.
>
> Assisted-by: Antigravity:gemini-3.1-pro
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>

It's a bit confusing to use sizeof(u64) for the two fields, but that's
what others do.. :(

Reviewed-by: Namhyung Kim <namhyung@xxxxxxxxxx>

Thanks,
Namhyung

> ---
> 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 f7c9eb49648f..cc70861a23d6 100644
> --- a/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
> +++ b/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
> @@ -419,7 +419,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
>