mbox series

[bpf-next,v3,0/2] selftests/bpf: implement setting global variables in veristat

Message ID 20250219233045.201595-1-mykyta.yatsenko5@gmail.com (mailing list archive)
Headers show
Series selftests/bpf: implement setting global variables in veristat | expand

Message

Mykyta Yatsenko Feb. 19, 2025, 11:30 p.m. UTC
From: Mykyta Yatsenko <yatsenko@meta.com>

To better verify some complex BPF programs by veristat, it would be useful
to preset global variables. This patch set implements this functionality
and introduces tests for veristat.

v2->v3:
  * Reworked parsing of the presets, using sscanf to split into variable and value, but
still use strtoll/strtoull to support range checks when parsing integers
  * Fix test failures for no_alu32 & cpuv4 by checking if veristat binary is in parent folder
  * Introduce __CHECK_STR macro for simplifying checks in test
  * Modify tests into sub-tests

Mykyta Yatsenko (2):
  selftests/bpf: implement setting global variables in veristat
  selftests/bpf: introduce veristat test

 tools/testing/selftests/bpf/Makefile          |   1 +
 .../selftests/bpf/prog_tests/test_veristat.c  | 136 +++++++++
 .../selftests/bpf/progs/set_global_vars.c     |  47 +++
 tools/testing/selftests/bpf/test_progs.h      |   8 +
 tools/testing/selftests/bpf/veristat.c        | 282 ++++++++++++++++++
 5 files changed, 474 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/test_veristat.c
 create mode 100644 tools/testing/selftests/bpf/progs/set_global_vars.c