[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200110175539.7gqu3itjb5cs6kvg@kafai-mbp.dhcp.thefacebook.com>
Date: Fri, 10 Jan 2020 17:55:43 +0000
From: Martin Lau <kafai@...com>
To: Andrii Nakryiko <andriin@...com>
CC: "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
"daniel@...earbox.net" <daniel@...earbox.net>,
"andrii.nakryiko@...il.com" <andrii.nakryiko@...il.com>,
Kernel Team <Kernel-team@...com>
Subject: Re: [Potential Spoof] [PATCH v3 bpf-next] selftests/bpf: add
BPF_HANDLER, BPF_KPROBE, and BPF_KRETPROBE macros
On Fri, Jan 10, 2020 at 09:43:50AM -0800, Andrii Nakryiko wrote:
> Streamline BPF_TRACE_x macro by moving out return type and section attribute
> definition out of macro itself. That makes those function look in source code
> similar to other BPF programs. Additionally, simplify its usage by determining
> number of arguments automatically (so just single BPF_TRACE vs a family of
> BPF_TRACE_1, BPF_TRACE_2, etc). Also, allow more natural function argument
> syntax without commas inbetween argument type and name.
>
> Given this helper is useful not only for tracing tp_btf/fenty/fexit programs,
> but could be used for LSM programs and others following the same pattern,
> rename BPF_TRACE macro into more generic BPF_HANDLER. Existing BPF_TRACE_x
> usages in selftests are converted to new BPF_HANDLER macro.
>
> Following the same pattern, define BPF_KPROBE and BPF_KRETPROBE macros for
> nicer usage of kprobe/kretprobe arguments, respectively. BPF_KRETPROBE, adopts
> same convention used by fexit programs, that last defined argument is probed
> function's return result.
Acked-by: Martin KaFai Lau <kafai@...com>
Powered by blists - more mailing lists