OSDN Git Service

perf trace: Fix setting of augmented payload when using eBPF + raw_syscalls
authorArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 3 Nov 2018 11:19:56 +0000 (08:19 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 3 Nov 2018 11:19:56 +0000 (08:19 -0300)
commitcd26ea6d50a207ee37e0364ecc2d196d6c9671e8
tree8031bd6a064f4ecb065ae6a8bffa64b80216b065
parent3c5e3dabf3722a883227623a4adf61976c2224ff
perf trace: Fix setting of augmented payload when using eBPF + raw_syscalls

For now with BPF raw_augmented we hook into raw_syscalls:sys_enter and
there we get all 6 syscall args plus the tracepoint common fields
(sizeof(long)) and the syscall_nr (another long). So we check if that is
the case and if so don't look after the sc->args_size, but always after
the full raw_syscalls:sys_enter payload, which is fixed.

We'll revisit this later to pass s->args_size to the BPF augmenter (now
tools/perf/examples/bpf/augmented_raw_syscalls.c, so that it copies only
what we need for each syscall, like what happens when we use
syscalls:sys_enter_NAME, so that we reduce the kernel/userspace traffic
to just what is needed for each syscall.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-nlslrg8apxdsobt4pwl3n7ur@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c