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>
This commit is contained in:

committed by
Daniel Borkmann

parent
0d3679e99a
commit
b061017f8b
10
tools/testing/selftests/bpf/progs/strobemeta.c
Normal file
10
tools/testing/selftests/bpf/progs/strobemeta.c
Normal file
@@ -0,0 +1,10 @@
|
||||
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
// Copyright (c) 2019 Facebook
|
||||
|
||||
#define STROBE_MAX_INTS 2
|
||||
#define STROBE_MAX_STRS 25
|
||||
#define STROBE_MAX_MAPS 100
|
||||
#define STROBE_MAX_MAP_ENTRIES 20
|
||||
/* full unroll by llvm #undef NO_UNROLL */
|
||||
#include "strobemeta.h"
|
||||
|
Reference in New Issue
Block a user