]> git.ipfire.org Git - people/ms/linux.git/commit
Merge branch 'bpf: keep track of verifier insn_processed'
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 21 Oct 2021 22:51:48 +0000 (15:51 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 21 Oct 2021 22:51:48 +0000 (15:51 -0700)
commit8082b8561dfd889fe943a6888c3b744793e398f3
treece0fa74e4c7b7ceeeec37b56b627255f64ac1286
parent632f96d2652e0d4188de837f88a977eedb55aee1
parente1b9023fc7ab0dcfeefe9f0a14772ad7a1c37b5b
Merge branch 'bpf: keep track of verifier insn_processed'

Dave Marchevsky says:

====================

This is a followup to discussion around RFC patchset "bpf: keep track of
prog verification stats" [0]. The RFC elaborates on my usecase, but to
summarize: keeping track of verifier stats for programs as they - and
the kernels they run on - change over time can help developers of
individual programs and BPF kernel folks.

The RFC added a verif_stats to the uapi which contained most of the info
which verifier prints currently. Feedback here was to avoid polluting
uapi with stats that might be meaningless after major changes to the
verifier, but that insn_processed or conceptually similar number would
exist in the long term and was safe to expose.

So let's expose just insn_processed via bpf_prog_info and fdinfo for now
and explore good ways of getting more complicated stats in the future.

[0] https://lore.kernel.org/bpf/20210920151112.3770991-1-davemarchevsky@fb.com/

v2->v3:
  * Remove unnecessary check in patch 2's test [Andrii]
  * Go back to adding new u32 in bpf_prog_info (vs using spare bits) [Andrii]
* Rebase + add acks [Andrii, John]

v1->v2:
  * Rename uapi field from insn_processed to verified_insns [Daniel]
  * use 31 bits of existing bitfield space in bpf_prog_info [Daniel]
  * change underlying type from 64-> 32 bits [Daniel]
====================

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>