BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/4] bpftool: Fix skeletons compilation for older kernels
@ 2023-05-12 10:33 Quentin Monnet
  2023-05-12 10:33 ` [PATCH bpf-next 1/4] bpftool: use a local copy of perf_event to fix accessing ::bpf_cookie Quentin Monnet
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Quentin Monnet @ 2023-05-12 10:33 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, bpf,
	Quentin Monnet, Alexander Lobakin, Michal Suchánek

At runtime, bpftool may run its own BPF programs to get the pids of
processes referencing BPF programs, or to profile programs. The skeletons
for these programs rely on a vmlinux.h header and may fail to compile when
building bpftool on hosts running older kernels, where some structs or
enums are not defined. In this set, we address this issue by using local
definitions for struct perf_event, struct bpf_perf_link,
BPF_LINK_TYPE_PERF_EVENT (pids.bpf.c) and struct bpf_perf_event_value
(profiler.bpf.c).

This set contains patches 1 to 3 from Alexander Lobakin's series, "bpf:
random unpopular userspace fixes (32 bit et al)" (v2) [0], from April 2022.
An additional patch defines a local version of BPF_LINK_TYPE_PERF_EVENT in
bpftool's pids.bpf.c.

[0] https://lore.kernel.org/bpf/20220421003152.339542-1-alobakin@pm.me/

Cc: Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: Michal Suchánek <msuchanek@suse.de>

Alexander Lobakin (3):
  bpftool: use a local copy of perf_event to fix accessing ::bpf_cookie
  bpftool: define a local bpf_perf_link to fix accessing its fields
  bpftool: use a local bpf_perf_event_value to fix accessing its fields

Quentin Monnet (1):
  bpftool: Use a local copy of BPF_LINK_TYPE_PERF_EVENT in
    pid_iter.bpf.c

 tools/bpf/bpftool/skeleton/pid_iter.bpf.c | 26 +++++++++++++++++-----
 tools/bpf/bpftool/skeleton/profiler.bpf.c | 27 ++++++++++++++---------
 2 files changed, 38 insertions(+), 15 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-07-07  9:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-12 10:33 [PATCH bpf-next 0/4] bpftool: Fix skeletons compilation for older kernels Quentin Monnet
2023-05-12 10:33 ` [PATCH bpf-next 1/4] bpftool: use a local copy of perf_event to fix accessing ::bpf_cookie Quentin Monnet
2023-05-12 10:33 ` [PATCH bpf-next 2/4] bpftool: define a local bpf_perf_link to fix accessing its fields Quentin Monnet
2023-05-12 14:47   ` Yonghong Song
2023-05-15 16:43     ` Quentin Monnet
2023-05-12 10:33 ` [PATCH bpf-next 3/4] bpftool: Use a local copy of BPF_LINK_TYPE_PERF_EVENT in pid_iter.bpf.c Quentin Monnet
2023-05-12 10:33 ` [PATCH bpf-next 4/4] bpftool: use a local bpf_perf_event_value to fix accessing its fields Quentin Monnet
2023-05-12 12:59   ` Jiri Olsa
2023-05-15 16:53     ` Quentin Monnet
2023-07-07  9:53     ` Quentin Monnet
2023-05-16 21:30   ` Andrii Nakryiko
2023-05-17 15:02     ` Quentin Monnet
2023-05-17 16:58       ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox