On Fri, Jun 14, 2019 at 12:26 AM Alexei Starovoitov <ast@xxxxxxxxxx> wrote: > > 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@xxxxxxxxxx> > Acked-by: Andrii Nakryiko <andriin@xxxxxx> > --- <snip> > diff --git a/tools/testing/selftests/bpf/progs/strobemeta.c b/tools/testing/selftests/bpf/progs/strobemeta.c > new file mode 100644 > index 000000000000..d3df3d86f092 > --- /dev/null > +++ b/tools/testing/selftests/bpf/progs/strobemeta.c > @@ -0,0 +1,10 @@ > +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) given strobemeta.h is GPL-2, this should probably be same > +// 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" > + > diff --git a/tools/testing/selftests/bpf/progs/strobemeta.h b/tools/testing/selftests/bpf/progs/strobemeta.h > new file mode 100644 > index 000000000000..1ff73f60a3e4 > --- /dev/null > +++ b/tools/testing/selftests/bpf/progs/strobemeta.h > @@ -0,0 +1,528 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (c) 2019 Facebook > + <snip> > +char _license[] SEC("license") = "GPL"; > diff --git a/tools/testing/selftests/bpf/progs/strobemeta_nounroll1.c b/tools/testing/selftests/bpf/progs/strobemeta_nounroll1.c > new file mode 100644 > index 000000000000..f0a1669e11d6 > --- /dev/null > +++ b/tools/testing/selftests/bpf/progs/strobemeta_nounroll1.c > @@ -0,0 +1,9 @@ > +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) ... and here > +// Copyright (c) 2019 Facebook > + > +#define STROBE_MAX_INTS 2 > +#define STROBE_MAX_STRS 25 > +#define STROBE_MAX_MAPS 13 > +#define STROBE_MAX_MAP_ENTRIES 20 > +#define NO_UNROLL > +#include "strobemeta.h" > diff --git a/tools/testing/selftests/bpf/progs/strobemeta_nounroll2.c b/tools/testing/selftests/bpf/progs/strobemeta_nounroll2.c > new file mode 100644 > index 000000000000..4291a7d642e7 > --- /dev/null > +++ b/tools/testing/selftests/bpf/progs/strobemeta_nounroll2.c > @@ -0,0 +1,9 @@ > +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) ... and here > +// Copyright (c) 2019 Facebook > + > +#define STROBE_MAX_INTS 2 > +#define STROBE_MAX_STRS 25 > +#define STROBE_MAX_MAPS 30 > +#define STROBE_MAX_MAP_ENTRIES 20 > +#define NO_UNROLL > +#include "strobemeta.h" <snip>