No description
Find a file
Andrii Nakryiko 47a71c1f9a bpf: Add log_true_size output field to return necessary log buffer size
Add output-only log_true_size and btf_log_true_size field to
BPF_PROG_LOAD and BPF_BTF_LOAD commands, respectively. It will return
the size of log buffer necessary to fit in all the log contents at
specified log_level. This is very useful for BPF loader libraries like
libbpf to be able to size log buffer correctly, but could be used by
users directly, if necessary, as well.

This patch plumbs all this through the code, taking into account actual
bpf_attr size provided by user to determine if these new fields are
expected by users. And if they are, set them from kernel on return.

We refactory btf_parse() function to accommodate this, moving attr and
uattr handling inside it. The rest is very straightforward code, which
is split from the logging accounting changes in the previous patch to
make it simpler to review logic vs UAPI changes.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Lorenz Bauer <lmb@isovalent.com>
Link: https://lore.kernel.org/bpf/20230406234205.323208-13-andrii@kernel.org
2023-04-11 18:05:43 +02:00
arch
block
certs
crypto
Documentation bpf, docs: Add docs on extended 64-bit immediate instructions 2023-04-02 17:02:54 -07:00
drivers bpf: Remove now-unnecessary NULL checks for KF_RELEASE kfuncs 2023-03-25 16:56:22 -07:00
fs
include bpf: Add log_true_size output field to return necessary log buffer size 2023-04-11 18:05:43 +02:00
init
io_uring net: reclaim skb->scm_io_uring bit 2023-03-08 13:21:47 +00:00
ipc
kernel bpf: Add log_true_size output field to return necessary log buffer size 2023-04-11 18:05:43 +02:00
lib
LICENSES
mm
net xsk: Fix unaligned descriptor validation 2023-04-06 09:53:05 -07:00
rust
samples bpf: use canonical ftrace path 2023-03-13 21:51:30 -07:00
scripts bpf: Remove extra whitespace in SPDX tag for syscall/helpers man pages 2023-04-11 17:45:57 +02:00
security
sound
tools bpf: Add log_true_size output field to return necessary log buffer size 2023-04-11 18:05:43 +02:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.