mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-22 07:53:11 -05:00
selftests: kallsyms: fix and clarify current test boundaries
Provide and clarify the existing ranges and what you should expect.
Fix the gen_test_kallsyms.sh script to accept different ranges.
Fixes: 84b4a51fce
("selftests: add new kallsyms selftests")
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
parent
7ea13556f7
commit
3e1d95b63c
2 changed files with 38 additions and 3 deletions
|
@ -3003,9 +3003,39 @@ config TEST_KALLSYMS_D
|
||||||
tristate
|
tristate
|
||||||
depends on m
|
depends on m
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "Kallsym test range"
|
||||||
|
default TEST_KALLSYMS_LARGE
|
||||||
|
help
|
||||||
|
Selecting something other than "Fast" will enable tests which slow
|
||||||
|
down the build and may crash your build.
|
||||||
|
|
||||||
|
config TEST_KALLSYMS_FAST
|
||||||
|
bool "Fast builds"
|
||||||
|
help
|
||||||
|
You won't really be testing kallsysms, so this just helps fast builds
|
||||||
|
when allmodconfig is used..
|
||||||
|
|
||||||
|
config TEST_KALLSYMS_LARGE
|
||||||
|
bool "Enable testing kallsyms with large exports"
|
||||||
|
help
|
||||||
|
This will enable larger number of symbols. This will slow down
|
||||||
|
your build considerably.
|
||||||
|
|
||||||
|
config TEST_KALLSYMS_MAX
|
||||||
|
bool "Known kallsysms limits"
|
||||||
|
help
|
||||||
|
This will enable exports to the point we know we'll start crashing
|
||||||
|
builds.
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
config TEST_KALLSYMS_NUMSYMS
|
config TEST_KALLSYMS_NUMSYMS
|
||||||
int "test kallsyms number of symbols"
|
int "test kallsyms number of symbols"
|
||||||
default 100
|
range 2 10000
|
||||||
|
default 2 if TEST_KALLSYMS_FAST
|
||||||
|
default 100 if TEST_KALLSYMS_LARGE
|
||||||
|
default 10000 if TEST_KALLSYMS_MAX
|
||||||
help
|
help
|
||||||
The number of symbols to create on TEST_KALLSYMS_A, only one of which
|
The number of symbols to create on TEST_KALLSYMS_A, only one of which
|
||||||
module TEST_KALLSYMS_B will use. This also will be used
|
module TEST_KALLSYMS_B will use. This also will be used
|
||||||
|
|
|
@ -7,6 +7,11 @@ NUM_SYMS=$2
|
||||||
SCALE_FACTOR=$3
|
SCALE_FACTOR=$3
|
||||||
TEST_TYPE=$(echo $TARGET | sed -e 's|lib/tests/module/test_kallsyms_||g')
|
TEST_TYPE=$(echo $TARGET | sed -e 's|lib/tests/module/test_kallsyms_||g')
|
||||||
TEST_TYPE=$(echo $TEST_TYPE | sed -e 's|.c||g')
|
TEST_TYPE=$(echo $TEST_TYPE | sed -e 's|.c||g')
|
||||||
|
FIRST_B_LOOKUP=1
|
||||||
|
|
||||||
|
if [[ $NUM_SYMS -gt 2 ]]; then
|
||||||
|
FIRST_B_LOOKUP=$((NUM_SYMS/2))
|
||||||
|
fi
|
||||||
|
|
||||||
gen_template_module_header()
|
gen_template_module_header()
|
||||||
{
|
{
|
||||||
|
@ -52,10 +57,10 @@ ____END_MODULE
|
||||||
|
|
||||||
gen_template_module_data_b()
|
gen_template_module_data_b()
|
||||||
{
|
{
|
||||||
printf "\nextern int auto_test_a_%010d;\n\n" 28
|
printf "\nextern int auto_test_a_%010d;\n\n" $FIRST_B_LOOKUP
|
||||||
echo "static int auto_runtime_test(void)"
|
echo "static int auto_runtime_test(void)"
|
||||||
echo "{"
|
echo "{"
|
||||||
printf "\nreturn auto_test_a_%010d;\n" 28
|
printf "\nreturn auto_test_a_%010d;\n" $FIRST_B_LOOKUP
|
||||||
echo "}"
|
echo "}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue