public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: linux-kbuild@vger.kernel.org, Peter Korsgaard <jacmet@uclibc.org>
Subject: Re: [PATCH 5/6] kconfig: implement KCONFIG_PROBABILITY for randconfig
Date: Tue, 23 Apr 2013 10:44:58 +0200	[thread overview]
Message-ID: <51764A0A.9000506@suse.cz> (raw)
In-Reply-To: <e5fafd7ae13357e3d5cc604c89022982022a8909.1366665922.git.yann.morin.1998@free.fr>

On 22.4.2013 23:31, Yann E. MORIN wrote:
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index 13ddf11..8d8d853 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -1106,7 +1106,16 @@ static void set_all_choice_values(struct symbol *csym)
>  void conf_set_all_new_symbols(enum conf_def_mode mode)
>  {
>  	struct symbol *sym, *csym;
> -	int i, cnt;
> +	int i, cnt, prob = 50;
> +
[...]
>  			case def_random:
> -				cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2;
> -				sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt);
> +				cnt = (rand() % 100) - (100 - prob);
> +				if (cnt < 0)
> +					sym->def[S_DEF_USER].tri = no;
> +				else
> +					if ((sym_get_type(sym) == S_TRISTATE)
> +					    && (cnt > prob/2))
> +						sym->def[S_DEF_USER].tri = mod;
> +					else
> +						sym->def[S_DEF_USER].tri = yes;

Previously, the distribution was 50%-50% for boolean options and
33%-33%-33% for tristate options. Now the default for tristate options
changed to 50%-25%-25% (no-mod-yes). Wouldn't it make more sense to have
a special case for KCONFIG_PROBABILITY not set, that would use the same
distribution as before. I.e.

if (prob == -1) {
	cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2;
	sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt);
} else {
	/* new math */
}

Not building half of all drivers is rather boring :)

Thanks,
Michal

  reply	other threads:[~2013-04-23  8:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22 21:31 [pull request] Pull request for branch yem-kconfig-for-next Yann E. MORIN
2013-04-22 21:31 ` [PATCH 1/6] menuconfig: Fix memory leak introduced by jump keys feature Yann E. MORIN
2013-04-22 21:31 ` [PATCH 2/6] menuconfig: Add "breadcrumbs" navigation aid Yann E. MORIN
2013-04-22 21:31 ` [PATCH 3/6] kconfig/lxdialog: rationalise the include paths where to find {.n}curses{,w}.h Yann E. MORIN
2013-04-22 21:31 ` [PATCH 4/6] kconfig: allow specifying the seed for randconfig Yann E. MORIN
2013-04-22 21:31 ` [PATCH 5/6] kconfig: implement KCONFIG_PROBABILITY " Yann E. MORIN
2013-04-23  8:44   ` Michal Marek [this message]
2013-04-23 16:34     ` Yann E. MORIN
2013-04-23 20:05       ` Michal Marek
2013-04-23 21:50   ` Yann E. MORIN
2013-04-24 17:56     ` Yann E. MORIN
2013-04-24 22:28       ` Michal Marek
2013-04-22 21:31 ` [PATCH 6/6] kconfig: do randomise choice entries in presence of KCONFIG_ALLCONFIG Yann E. MORIN
2013-04-23  7:07 ` [pull request] Pull request for branch yem-kconfig-for-next Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51764A0A.9000506@suse.cz \
    --to=mmarek@suse.cz \
    --cc=jacmet@uclibc.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox