selftests/bpf: add realistic loop tests
authorAlexei Starovoitov <ast@kernel.org>
Sat, 15 Jun 2019 19:12:24 +0000 (12:12 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 19 Jun 2019 00:22:52 +0000 (02:22 +0200)
commitb061017f8b4d0e05d4c11486581a702fb2a975b2
tree8c8ba40095dc1d4aeb480c454df2abb683925d80
parent0d3679e99ae4b7868da22e3b8540fd597df501f5
selftests/bpf: add realistic loop tests

Add a bunch of loop tests. Most of them are created by replacing
'#pragma unroll' with '#pragma clang loop unroll(disable)'

Several tests are artificially large:
  /* partial unroll. llvm will unroll loop ~150 times.
   * C loop count -> 600.
   * Asm loop count -> 4.
   * 16k insns in loop body.
   * Total of 5 such loops. Total program size ~82k insns.
   */
  "./pyperf600.o",

  /* no unroll at all.
   * C loop count -> 600.
   * ASM loop count -> 600.
   * ~110 insns in loop body.
   * Total of 5 such loops. Total program size ~1500 insns.
   */
  "./pyperf600_nounroll.o",

  /* partial unroll. 19k insn in a loop.
   * Total program size 20.8k insn.
   * ~350k processed_insns
   */
  "./strobemeta.o",

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
15 files changed:
tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
tools/testing/selftests/bpf/progs/loop1.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/loop2.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/loop3.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/pyperf.h
tools/testing/selftests/bpf/progs/pyperf600.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/pyperf600_nounroll.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/strobemeta.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/strobemeta.h [new file with mode: 0644]
tools/testing/selftests/bpf/progs/strobemeta_nounroll1.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/strobemeta_nounroll2.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_seg6_loop.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_sysctl_loop1.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_sysctl_loop2.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_xdp_loop.c [new file with mode: 0644]