All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 bpf-next 0/3] libbpf: support custom SEC() handlers
@ 2022-02-11 21:14 Andrii Nakryiko
  2022-02-11 21:14 ` [PATCH v3 bpf-next 1/3] libbpf: allow BPF program auto-attach handlers to bail out Andrii Nakryiko
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Andrii Nakryiko @ 2022-02-11 21:14 UTC (permalink / raw)
  To: bpf, ast, daniel; +Cc: andrii, kernel-team, Alan Maguire

Add ability for user applications and libraries to register custom BPF program
SEC() handlers. See patch #2 for examples where this is useful.

Patch #1 does some preliminary refactoring to allow exponsing program
init, preload, and attach callbacks as public API. It also establishes
a protocol to allow optional auto-attach behavior. This will also help the
case of sometimes auto-attachable uprobes.

v1->v2:
  - moved callbacks and cookie into OPTS struct (Alan);
  - added more test scenarios (Alan);
  - address most of Alan's feedback, but kept API name.

Cc: Alan Maguire <alan.maguire@oracle.com>

Andrii Nakryiko (3):
  libbpf: allow BPF program auto-attach handlers to bail out
  libbpf: support custom SEC() handlers
  selftests/bpf: add custom SEC() handling selftest

 tools/lib/bpf/libbpf.c                        | 308 +++++++++++++-----
 tools/lib/bpf/libbpf.h                        |  87 +++++
 tools/lib/bpf/libbpf.map                      |   6 +
 tools/lib/bpf/libbpf_version.h                |   2 +-
 .../bpf/prog_tests/custom_sec_handlers.c      | 176 ++++++++++
 .../bpf/progs/test_custom_sec_handlers.c      |  63 ++++
 6 files changed, 552 insertions(+), 90 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/custom_sec_handlers.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_custom_sec_handlers.c

-- 
2.30.2


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

end of thread, other threads:[~2022-02-15  5:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-11 21:14 [PATCH v3 bpf-next 0/3] libbpf: support custom SEC() handlers Andrii Nakryiko
2022-02-11 21:14 ` [PATCH v3 bpf-next 1/3] libbpf: allow BPF program auto-attach handlers to bail out Andrii Nakryiko
2022-02-11 21:14 ` [PATCH v3 bpf-next 2/3] libbpf: support custom SEC() handlers Andrii Nakryiko
2022-02-14 10:34   ` Alan Maguire
2022-02-11 21:14 ` [PATCH v3 bpf-next 3/3] selftests/bpf: add custom SEC() handling selftest Andrii Nakryiko
2022-02-11 23:13   ` Alexei Starovoitov
2022-02-11 23:31     ` Andrii Nakryiko
2022-02-12  0:18       ` Alexei Starovoitov
2022-02-12  1:16         ` Andrii Nakryiko
2022-02-14 11:13           ` Alan Maguire
2022-02-14 17:27           ` Alexei Starovoitov
2022-02-14 19:55             ` Andrii Nakryiko
2022-02-14 23:13             ` Alan Maguire
2022-02-15  0:29               ` Alexei Starovoitov
2022-02-15  5:22                 ` Andrii Nakryiko
2022-02-14 10:36   ` Alan Maguire

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.