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

Merge tag 'modules-6.13-rc1-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux

Pull modules fixes from Luis Chamberlain:
"Three fixes, the main one build that we build the kallsyms test
modules all over again if we just run make twice"

* tag 'modules-6.13-rc1-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux:
selftests: find_symbol: Actually use load_mod() parameter
selftests: kallsyms: fix and clarify current test boundaries
selftests: kallsyms: fix double build stupidity

+48 -14
+31 -1
lib/Kconfig.debug
··· 3003 3003 tristate 3004 3004 depends on m 3005 3005 3006 + choice 3007 + prompt "Kallsym test range" 3008 + default TEST_KALLSYMS_LARGE 3009 + help 3010 + Selecting something other than "Fast" will enable tests which slow 3011 + down the build and may crash your build. 3012 + 3013 + config TEST_KALLSYMS_FAST 3014 + bool "Fast builds" 3015 + help 3016 + You won't really be testing kallsysms, so this just helps fast builds 3017 + when allmodconfig is used.. 3018 + 3019 + config TEST_KALLSYMS_LARGE 3020 + bool "Enable testing kallsyms with large exports" 3021 + help 3022 + This will enable larger number of symbols. This will slow down 3023 + your build considerably. 3024 + 3025 + config TEST_KALLSYMS_MAX 3026 + bool "Known kallsysms limits" 3027 + help 3028 + This will enable exports to the point we know we'll start crashing 3029 + builds. 3030 + 3031 + endchoice 3032 + 3006 3033 config TEST_KALLSYMS_NUMSYMS 3007 3034 int "test kallsyms number of symbols" 3008 - default 100 3035 + range 2 10000 3036 + default 2 if TEST_KALLSYMS_FAST 3037 + default 100 if TEST_KALLSYMS_LARGE 3038 + default 10000 if TEST_KALLSYMS_MAX 3009 3039 help 3010 3040 The number of symbols to create on TEST_KALLSYMS_A, only one of which 3011 3041 module TEST_KALLSYMS_B will use. This also will be used
+8 -9
lib/tests/module/Makefile
··· 3 3 obj-$(CONFIG_TEST_KALLSYMS_C) += test_kallsyms_c.o 4 4 obj-$(CONFIG_TEST_KALLSYMS_D) += test_kallsyms_d.o 5 5 6 - $(obj)/%.c: FORCE 7 - @$(kecho) " GEN $@" 8 - $(Q)$(srctree)/lib/tests/module/gen_test_kallsyms.sh $@\ 9 - $(CONFIG_TEST_KALLSYMS_NUMSYMS) \ 10 - $(CONFIG_TEST_KALLSYMS_SCALE_FACTOR) 6 + quiet_cmd_gen_test_kallsyms = GEN $@ 7 + cmd_gen_test_kallsyms = $< $@ \ 8 + $(CONFIG_TEST_KALLSYMS_NUMSYMS) \ 9 + $(CONFIG_TEST_KALLSYMS_SCALE_FACTOR) 11 10 12 - clean-files += test_kallsyms_a.c 13 - clean-files += test_kallsyms_b.c 14 - clean-files += test_kallsyms_c.c 15 - clean-files += test_kallsyms_d.c 11 + $(obj)/%.c: $(src)/gen_test_kallsyms.sh FORCE 12 + $(call if_changed,gen_test_kallsyms) 13 + 14 + targets += $(foreach x, a b c d, test_kallsyms_$(x).c)
+7 -2
lib/tests/module/gen_test_kallsyms.sh
··· 7 7 SCALE_FACTOR=$3 8 8 TEST_TYPE=$(echo $TARGET | sed -e 's|lib/tests/module/test_kallsyms_||g') 9 9 TEST_TYPE=$(echo $TEST_TYPE | sed -e 's|.c||g') 10 + FIRST_B_LOOKUP=1 11 + 12 + if [[ $NUM_SYMS -gt 2 ]]; then 13 + FIRST_B_LOOKUP=$((NUM_SYMS/2)) 14 + fi 10 15 11 16 gen_template_module_header() 12 17 { ··· 57 52 58 53 gen_template_module_data_b() 59 54 { 60 - printf "\nextern int auto_test_a_%010d;\n\n" 28 55 + printf "\nextern int auto_test_a_%010d;\n\n" $FIRST_B_LOOKUP 61 56 echo "static int auto_runtime_test(void)" 62 57 echo "{" 63 - printf "\nreturn auto_test_a_%010d;\n" 28 58 + printf "\nreturn auto_test_a_%010d;\n" $FIRST_B_LOOKUP 64 59 echo "}" 65 60 } 66 61
+2 -2
tools/testing/selftests/module/find_symbol.sh
··· 44 44 local ARCH="$(uname -m)" 45 45 case "${ARCH}" in 46 46 x86_64) 47 - perf stat $STATS $MODPROBE test_kallsyms_b 47 + perf stat $STATS $MODPROBE $MOD 48 48 ;; 49 49 *) 50 - time $MODPROBE test_kallsyms_b 50 + time $MODPROBE $MOD 51 51 exit 1 52 52 ;; 53 53 esac