Re: [PATCH v4 bpf-next 12/19] bpf: add log_true_size output field to return necessary log buffer size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 7, 2023 at 12:43 AM Andrii Nakryiko <andrii@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>

Acked-by: Lorenz Bauer <lmb@xxxxxxxxxxxxx>




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux