netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: keep track of verifier insn_processed
@ 2021-10-07  8:09 Dave Marchevsky
  2021-10-07  8:09 ` [PATCH bpf-next 1/2] bpf: add insn_processed to bpf_prog_info and fdinfo Dave Marchevsky
  2021-10-07  8:09 ` [PATCH bpf-next 2/2] selftests/bpf: add verif_stats test Dave Marchevsky
  0 siblings, 2 replies; 5+ messages in thread
From: Dave Marchevsky @ 2021-10-07  8:09 UTC (permalink / raw)
  To: bpf
  Cc: netdev, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	John Fastabend, Dave Marchevsky

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/

Dave Marchevsky (2):
  bpf: add insn_processed to bpf_prog_info and fdinfo
  selftests/bpf: add verif_stats test

 include/linux/bpf.h                           |  1 +
 include/uapi/linux/bpf.h                      |  1 +
 kernel/bpf/syscall.c                          |  8 +++--
 kernel/bpf/verifier.c                         |  1 +
 tools/include/uapi/linux/bpf.h                |  1 +
 .../selftests/bpf/prog_tests/verif_stats.c    | 31 +++++++++++++++++++
 6 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/verif_stats.c

-- 
2.30.2


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

end of thread, other threads:[~2021-10-08  0:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-07  8:09 [PATCH bpf-next 0/2] bpf: keep track of verifier insn_processed Dave Marchevsky
2021-10-07  8:09 ` [PATCH bpf-next 1/2] bpf: add insn_processed to bpf_prog_info and fdinfo Dave Marchevsky
2021-10-07 21:46   ` Daniel Borkmann
2021-10-08  0:28     ` Dave Marchevsky
2021-10-07  8:09 ` [PATCH bpf-next 2/2] selftests/bpf: add verif_stats test Dave Marchevsky

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).