libbpf: stringify error codes in log messages
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest4 patches 1 replyApplied 4/4
- v21 patch 3 repliesSuperseded
- v11 patch 1 replySuperseded
Patches in v3 All 4 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | libbpf: introduce errstr() for stringifying errnotools/ tools/ | +66 | 1 reply | Applied |
| 2/4 | libbpf: stringify errno in log messages in libbpf.ctools/ | +156 | 0 replies | Applied |
| 3/4 | libbpf: stringify errno in log messages in btf*.ctools/ tools/ | +16 | 0 replies | Applied |
| 4/4 | libbpf: stringify errno in log messages in the remaining codetools/ tools/ tools/ +3 more | +56 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH bpf-next v3 0/4] libbpf: stringify error codes in log messages
From: Mykyta Yatsenko <[email protected]>
Libbpf may report error in 2 ways:
1. Numeric errno
2. Errno's text representation, returned by strerror
Both ways may be confusing for users: numeric code requires people to know how to find its meaning and strerror may be too generic and unclear.
These patches modify libbpf error reporting by swapping numeric codes and strerror with the standard short error name, for example:
"failed to attach: -22" becomes "failed to attach: -EINVAL".
Mykyta Yatsenko (4):
libbpf: introduce errstr() for stringifying errno
libbpf: stringify errno in log messages in libbpf.c
libbpf: stringify errno in log messages in btf*.c
libbpf: stringify errno in log messages in the remaining code
tools/lib/bpf/btf.c | 26 +-- tools/lib/bpf/btf_dump.c | 3 +- tools/lib/bpf/elf.c | 4 +- tools/lib/bpf/features.c | 15 +- tools/lib/bpf/gen_loader.c | 3 +- tools/lib/bpf/libbpf.c | 356 ++++++++++++++++--------------------- tools/lib/bpf/linker.c | 21 ++- tools/lib/bpf/ringbuf.c | 34 ++-- tools/lib/bpf/str_error.c | 59 ++++++ tools/lib/bpf/str_error.h | 7 + tools/lib/bpf/usdt.c | 32 ++-- 11 files changed, 294 insertions(+), 266 deletions(-)
Signature · 1 line
2.47.0