linux/scripts
Ingo Molnar b0fe551000 kconfig: improve seed in randconfig
'make randconfig' uses glibc's rand function, and the seed of
that PRNG is set via:

			srand(time(NULL));

But 'time()' only increases once every second - freezing the
randconfig result within a single second.

My Nehalem testbox does randconfig much faster than 1 second
 and i have a few scripts that do 'randconfig until condition X'
loops.

Those scripts currently waste a lot of CPU time due to randconfig
changing its seed only once per second currently.

Change the seed to be micrseconds based. (I checked the statistical
spread of the seed - the now.tv_sec*now.tv_usec multiplication
there further improves it.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Roman Zippel <zippel@linux-m68k.org>
[sam: fix for systems where usec is zero - noticed by Geert Uytterhoeven]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-03-15 23:02:07 +01:00
..
basic
genksyms
kconfig kconfig: improve seed in randconfig 2009-03-15 23:02:07 +01:00
ksymoops
mod
package
rt-tester
selinux
trace
tracing
.gitignore
Kbuild.include
Lindent
Makefile
Makefile.build
Makefile.clean
Makefile.fwinst
Makefile.headersinst
Makefile.host
Makefile.lib
Makefile.modinst
Makefile.modpost
bin2c.c
binoffset.c
bloat-o-meter
bootgraph.pl
checkincludes.pl
checkkconfigsymbols.sh
checkpatch.pl
checkstack.pl
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
config
conmakehash.c
decodecode
diffconfig
export_report.pl
extract-ikconfig
gcc-version.sh
gcc-x86_64-has-stack-protector.sh
gen_initramfs_list.sh
headerdep.pl
headers.sh
headers_check.pl
headers_install.pl
ihex2fw.c
kallsyms.c
kernel-doc
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap
mkuboot.sh
mkversion
namespace.pl
patch-kernel
pnmtologo.c
profile2linkerlist.pl
recordmcount.pl
setlocalversion
show_delta
tags.sh
unifdef.c
ver_linux