]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
libbpf: Normalize PT_REGS_xxx() macro definitions
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 22 Dec 2021 21:39:23 +0000 (13:39 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 29 Dec 2021 03:14:44 +0000 (19:14 -0800)
commit3cc31d794097a0de5ac619d4a20b1975139e6b05
treebfbac52f8f66f82330814ea81986734083f3f64a
parentecf45e60a62dfeb65658abac02f0bdb45b786911
libbpf: Normalize PT_REGS_xxx() macro definitions

Refactor PT_REGS macros definitions in  bpf_tracing.h to avoid excessive
duplication. We currently have classic PT_REGS_xxx() and CO-RE-enabled
PT_REGS_xxx_CORE(). We are about to add also _SYSCALL variants, which
would require excessive copying of all the per-architecture definitions.

Instead, separate architecture-specific field/register names from the
final macro that utilize them. That way for upcoming _SYSCALL variants
we'll be able to just define x86_64 exception and otherwise have one
common set of _SYSCALL macro definitions common for all architectures.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/bpf/20211222213924.1869758-1-andrii@kernel.org
tools/lib/bpf/bpf_tracing.h