bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH bpf-next 0/5] bpf: Extend bpf syscall with common attributes support
@ 2025-07-28 14:23 Leon Hwang
  2025-07-28 14:23 ` [RFC PATCH bpf-next 1/5] " Leon Hwang
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Leon Hwang @ 2025-07-28 14:23 UTC (permalink / raw)
  To: bpf; +Cc: ast, andrii, daniel, menglong8.dong, Leon Hwang

This proposal builds upon the discussion in
"[PATCH bpf-next v4 0/4] bpf: Improve error reporting for freplace attachment failure"[1],
and is also relevant to ongoing efforts such as tracing multi-link attach
failures[2].

This patch set introduces support for *common attributes* in the 'bpf()'
syscall, providing a unified mechanism for passing shared metadata across
all BPF commands.

The initial set of common attributes includes:

1. 'log_buf': User-provided buffer for storing log output.
2. 'log_size': Size of the provided log buffer.
3. 'log_level': Verbosity level for logging.

With this extension, the 'bpf()' syscall will be able to return meaningful
error messages (e.g., when a 'freplace' program fails to attach),
improving debuggability and user experience.

Links:
[1] https://lore.kernel.org/bpf/20250224153352.64689-1-leon.hwang@linux.dev/
[2] https://lore.kernel.org/bpf/20250703121521.1874196-1-dongml2@chinatelecom.cn/

Leon Hwang (5):
  bpf: Extend bpf syscall with common attributes support
  libbpf: Add support for extended bpf syscall
  bpf: Report freplace attach failure reason via extended syscall
  libbpf: Capture error message on freplace attach failure
  selftests/bpf: Add case to test freplace attach failure log

 include/uapi/linux/bpf.h                      |  7 +++
 kernel/bpf/syscall.c                          | 58 +++++++++++++++----
 tools/include/uapi/linux/bpf.h                |  7 +++
 tools/lib/bpf/bpf.c                           | 58 ++++++++++++++++++-
 tools/lib/bpf/bpf.h                           |  3 +
 tools/lib/bpf/features.c                      |  8 +++
 tools/lib/bpf/libbpf.c                        | 18 ++++--
 tools/lib/bpf/libbpf.h                        |  4 ++
 tools/lib/bpf/libbpf.map                      |  3 +
 tools/lib/bpf/libbpf_internal.h               |  2 +
 .../bpf/prog_tests/tracing_failure.c          | 43 ++++++++++++++
 11 files changed, 193 insertions(+), 18 deletions(-)

--
2.50.1


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

end of thread, other threads:[~2025-08-01 13:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-28 14:23 [RFC PATCH bpf-next 0/5] bpf: Extend bpf syscall with common attributes support Leon Hwang
2025-07-28 14:23 ` [RFC PATCH bpf-next 1/5] " Leon Hwang
2025-07-28 14:23 ` [RFC PATCH bpf-next 2/5] libbpf: Add support for extended bpf syscall Leon Hwang
2025-07-28 14:23 ` [RFC PATCH bpf-next 3/5] bpf: Report freplace attach failure reason via extended syscall Leon Hwang
2025-07-31 16:32   ` Alexei Starovoitov
2025-08-01 13:45     ` Leon Hwang
2025-07-28 14:23 ` [RFC PATCH bpf-next 4/5] libbpf: Capture error message on freplace attach failure Leon Hwang
2025-07-28 14:23 ` [RFC PATCH bpf-next 5/5] selftests/bpf: Add case to test freplace attach failure log Leon Hwang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).