mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: "Giacomo A. Catenazzi" <cate@cateee.net>
Cc: Takashi Iwai <tiwai@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: diet-kconfig: a script to trim unneeded kconfigs
Date: Thu, 18 Sep 2008 12:27:29 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0809181154020.12224@bombadil.infradead.org> (raw)
In-Reply-To: <48D27734.3040600@cateee.net>

On Thu, 18 Sep 2008, Giacomo A. Catenazzi wrote:

> Mauro Carvalho Chehab wrote:
>> Hi Takashi,
>> 
>> On Wed, 17 Sep 2008 01:55:26 +0200
>> Takashi Iwai <tiwai@suse.de> wrote:
>
>>> The script is VERY hackish.  I should have begun with perl or whatever
>>> better script language, but I chose bash and co.  So, don't expect
>>> much code quality.  I'm no script guy after all :)
>> 
>> Using just a shellscript and binutils seems to be better than using other
>> tools, since it allows the usage on minimal configured systems where the 
>> user
>> might not have perl or other scripting languages.
>
> But very slow,

I don't think that performance is a big issue here. I tested Takashi 
scripts on this old 1.5 GHz centrino one core notebook, and it runned in a 
few seconds. Kernel compilation with diet config took 30-40 mins. The 
additional time for the script didn't significantly increased the total 
time.

> complex and not enough powerful:

For sure a scripting language like perl is more appropriate.

> The tools should have extensive knowledge about Kconfig,
> and the CONFIG_ dependencies

Since CONFIG_ and their dependencies are constantly 
changing/adding/removing at kernel, the better would be to have a good 
Kconfig parsing, avoiding to have lots of "local knowledge" about symbols. 
The better model seems to be the one where subsystem maintainers don't 
need to take extra care for not breaking the tool when touching at 
Kconfig/Makefiles.

Also, it occured me that some drivers have "implicit" Kconfig dependencies 
inside that may limit its work. Looking on a random driver, just as an 
example, you have things like:

$ grep ifdef cpufreq_stats.c
cpufreq_stats.c:#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
cpufreq_stats.c:#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
cpufreq_stats.c:#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
cpufreq_stats.c:#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
cpufreq_stats.c:#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
cpufreq_stats.c:#ifdef CONFIG_CPU_FREQ_STAT_DETAILS

So, I suspect that the script might also need to parse the selected files 
to seek for additional rules.

I'm not sure what to do after discovering such things: Assume the option 
that generates smaller code? Assume the option that generates the most 
complete code? Maybe the better would be to use the selected config 
profile as a hint for such symbols. If not found there, then ask user.

> it should handle a lot of
> structures (text/binary; line/record oriented; etc.), which
> it is not easy in shell (awk, od, sed with extended regexp are
> not core utilities).

True.

> So my suggestion is: do it in a high level language, to find and
> stabilize the design, and then integrate it in kconfig later (using
> C).

Seems a good approach to me.

-- 
Cheers,
Mauro

  reply	other threads:[~2008-09-18 16:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16 23:55 Takashi Iwai
2008-09-18 14:01 ` Giacomo A. Catenazzi
2008-09-18 20:09   ` Takashi Iwai
2008-09-18 15:25 ` Mauro Carvalho Chehab
2008-09-18 15:43   ` Giacomo A. Catenazzi
2008-09-18 16:27     ` Mauro Carvalho Chehab [this message]
2008-09-19  9:12       ` Giacomo A. Catenazzi
2008-09-19 16:01         ` Takashi Iwai
2008-09-19 23:55           ` Chris Li
2008-09-19 23:57             ` Chris Li
2008-09-22 10:01             ` Takashi Iwai
2008-09-22 13:39               ` Giacomo A. Catenazzi
2008-09-22 15:41                 ` Steven Rostedt
2008-09-22 15:50                   ` Takashi Iwai
2008-09-22 19:25               ` Chris Li
2008-09-23 11:31                 ` Takashi Iwai
2008-09-23 18:15                   ` Chris Li
2008-09-23 18:50                     ` Takashi Iwai
2008-09-23 19:40                       ` Chris Li
2008-09-18 20:20     ` Takashi Iwai
2008-09-18 20:17   ` Takashi Iwai
2008-09-18 21:09     ` Valdis.Kletnieks
2008-09-18 22:14       ` Takashi Iwai

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=alpine.LFD.1.10.0809181154020.12224@bombadil.infradead.org \
    --to=mchehab@infradead.org \
    --cc=cate@cateee.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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

all inboxes | Powered by JetHome®