libbpf: Fix the incorrect register read for syscalls on x86_64
authorKenta Tada <Kenta.Tada@sony.com>
Mon, 24 Jan 2022 14:16:21 +0000 (23:16 +0900)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 25 Jan 2022 05:04:10 +0000 (21:04 -0800)
commitd084df3b7a4c49fb2abec55f8d512c51d643c408
tree92a6231d132a6ecda520e4b653c67d7e9da60664
parent78a2054156dd6265619b230cc5372b74f9ba5233
libbpf: Fix the incorrect register read for syscalls on x86_64

Currently, rcx is read as the fourth parameter of syscall on x86_64.
But x86_64 Linux System Call convention uses r10 actually.
This commit adds the wrapper for users who want to access to
syscall params to analyze the user space.

Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220124141622.4378-3-Kenta.Tada@sony.com
tools/lib/bpf/bpf_tracing.h