From 0d8024c6ebadb68f1154377c2e1996b4e649e4c8 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sat, 13 Apr 2013 22:49:13 +0200 Subject: kconfig: allow specifying the seed for randconfig For reproducibility, it can be useful to be able to specify the seed to use to seed the RNG. Add a new KCONFIG_SEED environment variable which can be set to the seed to use: $ make KCONFIG_SEED=42 randconfig $ sha1sum .config 70a128c8dcc61303069e1be352cce64114dfcbca .config $ make KCONFIG_SEED=42 randconfig $ sha1sum .config 70a128c8dcc61303069e1be352cce64114dfcbca .config It's very usefull for eg. debugging the kconfig parser. Signed-off-by: "Yann E. MORIN" --- Documentation/kbuild/kconfig.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Documentation/kbuild') diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt index b8b77bbc784f..dbf746b70553 100644 --- a/Documentation/kbuild/kconfig.txt +++ b/Documentation/kbuild/kconfig.txt @@ -89,6 +89,15 @@ These examples will disable most options (allnoconfig) but enable or disable the options that are explicitly listed in the specified mini-config files. +______________________________________________________________________ +Environment variables for 'randconfig' + +KCONFIG_SEED +-------------------------------------------------- +You can set this to the integer value used to seed the RNG, if you want +to somehow debug the behaviour of the kconfig parser/frontends. +If not set, the current time will be used. + ______________________________________________________________________ Environment variables for 'silentoldconfig' -- cgit From e43956e607692f9b1c710311e4a6591ffba1edf0 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sat, 13 Apr 2013 17:18:36 +0200 Subject: kconfig: implement KCONFIG_PROBABILITY for randconfig Currently the odds to set each symbol is (rounded): booleans: y: 50% n: 50% tristates: y: 33% m: 33% n: 33% Introduce a KCONFIG_PROBABILITY environment variable to tweak the probabilities (in percentage), as such: KCONFIG_PROBABILITY y:n split y:m:n split ----------------------------------------------------------------- [1] unset or empty 50 : 50 33 : 33 : 34 [2] N N : 100-N N/2 : N/2 : 100-N N:M N+M : 100-(N+M) N : M : 100-(N+M) N:M:L N : 100-N M : L : 100-(M+L) [1] The current behaviour is kept as default, for backward compatibility [2] The solution initially implemented by Peter for Buildroot, see: http://git.buildroot.org/buildroot/commit/?id=3435c1afb5 Signed-off-by: Peter Korsgaard [yann.morin.1998@free.fr: add to Documentation/] Signed-off-by: "Yann E. MORIN" --- Documentation/kbuild/kconfig.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Documentation/kbuild') diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt index dbf746b70553..3f429ed8b3b8 100644 --- a/Documentation/kbuild/kconfig.txt +++ b/Documentation/kbuild/kconfig.txt @@ -98,6 +98,33 @@ You can set this to the integer value used to seed the RNG, if you want to somehow debug the behaviour of the kconfig parser/frontends. If not set, the current time will be used. +KCONFIG_PROBABILITY +-------------------------------------------------- +This variable can be used to skew the probabilities. This variable can +be unset or empty, or set to three different formats: + KCONFIG_PROBABILITY y:n split y:m:n split + ----------------------------------------------------------------- + unset or empty 50 : 50 33 : 33 : 34 + N N : 100-N N/2 : N/2 : 100-N + [1] N:M N+M : 100-(N+M) N : M : 100-(N+M) + [2] N:M:L N : 100-N M : L : 100-(M+L) + +where N, M and L are integers (in base 10) in the range [0,100], and so +that: + [1] N+M is in the range [0,100] + [2] M+L is in the range [0,100] + +Examples: + KCONFIG_PROBABILITY=10 + 10% of booleans will be set to 'y', 90% to 'n' + 5% of tristates will be set to 'y', 5% to 'm', 90% to 'n' + KCONFIG_PROBABILITY=15:25 + 40% of booleans will be set to 'y', 60% to 'n' + 15% of tristates will be set to 'y', 25% to 'm', 60% to 'n' + KCONFIG_PROBABILITY=10:15:15 + 10% of booleans will be set to 'y', 90% to 'n' + 15% of tristates will be set to 'y', 15% to 'm', 70% to 'n' + ______________________________________________________________________ Environment variables for 'silentoldconfig' -- cgit