Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

radix tree test suite: Add config option for map shift

Add config option "SHIFT=<value>" to Makefile for building test suite
with any value of RADIX_TREE_MAP_SHIFT between 3 and 7 inclusive.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
[mawilcox@microsoft.com: .gitignore, quieten grep, remove on clean]
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>

authored by

Rehas Sachdeva and committed by
Matthew Wilcox
c6ce3e2f 7e73eb0b

+16 -11
+1
tools/testing/radix-tree/.gitignore
··· 1 + generated/map-shift.h 1 2 idr.c 2 3 idr-test 3 4 main
+13 -5
tools/testing/radix-tree/Makefile
··· 6 6 OFILES = main.o $(CORE_OFILES) regression1.o regression2.o regression3.o \ 7 7 tag_check.o multiorder.o idr-test.o iteration_check.o benchmark.o 8 8 9 - ifdef BENCHMARK 10 - CFLAGS += -DBENCHMARK=1 9 + ifndef SHIFT 10 + SHIFT=3 11 11 endif 12 12 13 - targets: $(TARGETS) 13 + targets: mapshift $(TARGETS) 14 14 15 15 main: $(OFILES) 16 16 $(CC) $(CFLAGS) $(LDFLAGS) $^ -o main ··· 22 22 $(CC) $(CFLAGS) $(LDFLAGS) $^ -o multiorder 23 23 24 24 clean: 25 - $(RM) $(TARGETS) *.o radix-tree.c idr.c 25 + $(RM) $(TARGETS) *.o radix-tree.c idr.c generated/map-shift.h 26 26 27 27 vpath %.c ../../lib 28 28 29 - $(OFILES): *.h */*.h \ 29 + $(OFILES): *.h */*.h generated/map-shift.h \ 30 30 ../../include/linux/*.h \ 31 31 ../../include/asm/*.h \ 32 32 ../../../include/linux/radix-tree.h \ ··· 37 37 38 38 idr.c: ../../../lib/idr.c 39 39 sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@ 40 + 41 + .PHONY: mapshift 42 + 43 + mapshift: 44 + @if ! grep -qw $(SHIFT) generated/map-shift.h; then \ 45 + echo "#define RADIX_TREE_MAP_SHIFT $(SHIFT)" > \ 46 + generated/map-shift.h; \ 47 + fi
-6
tools/testing/radix-tree/linux/kernel.h
··· 12 12 #include <linux/log2.h> 13 13 #include "../../../include/linux/kconfig.h" 14 14 15 - #ifdef BENCHMARK 16 - #define RADIX_TREE_MAP_SHIFT 6 17 - #else 18 - #define RADIX_TREE_MAP_SHIFT 3 19 - #endif 20 - 21 15 #define printk printf 22 16 #define pr_debug printk 23 17 #define pr_cont printk
+2
tools/testing/radix-tree/linux/radix-tree.h
··· 1 1 #ifndef _TEST_RADIX_TREE_H 2 2 #define _TEST_RADIX_TREE_H 3 + 4 + #include "generated/map-shift.h" 3 5 #include "../../../../include/linux/radix-tree.h" 4 6 5 7 extern int kmalloc_verbose;