All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Nicolas Pitre <nico@fluxnic.net>,
	Daniel Walker <dwalker@codeaurora.org>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Kevin Hilman <khilman@deeprootsystems.com>,
	linux-arm-msm@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-omap@vger.kernel.org, Eric Miao <eric.miao@canonical.com>,
	linux-arm-kernel@lists.infradead.org,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Olof Johansson <olof@lixom.net>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: optimized script [Was: ARM defconfig files]
Date: Tue, 13 Jul 2010 10:07:05 +0200	[thread overview]
Message-ID: <20100713080705.GA20978@pengutronix.de> (raw)
In-Reply-To: <20100713070741.GB26442@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

Hello,

On Tue, Jul 13, 2010 at 09:07:41AM +0200, Uwe Kleine-König wrote:
> Hi
> 
> On Mon, Jul 12, 2010 at 01:50:47PM -0600, Grant Likely wrote:
> > On Mon, Jul 12, 2010 at 1:34 PM, Linus Torvalds
> > <torvalds@linux-foundation.org> wrote:
> > > On Mon, Jul 12, 2010 at 12:17 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
> > >> I think Uwe could provide his script and add it to the kernel tree.
> > >> Then all architectures could benefit from it.  Having the defconfig
> > >> files contain only those options which are different from the defaults
> > >> is certainly more readable, even on x86.
> > >
> > > Quite possible. But maintainers would need to be on the lookout of
> > > people actually using the script, and refusing to apply patches that
> > > re-introduce the whole big thing.
> > 
> > I can (partially) speak for powerpc.  If ARM uses this approach, then
> > I think we can do the same.  After the defconfigs are trimmed, I
> > certainly won't pick up any more full defconfigs.
> I just restarted my script on the powerpc defconfigs basing on rc5, I
> assume they complete in a few days time.
So Stephen was faster than me.  I don't know yet how he optimised my
script, meanwhile I put some efforts into it, too by just checking lines
that match "^(# )?CONFIG_".

Find it attached.

I will start to reduce the remaining configs (i.e. all but arm and
powerpc).

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: reduce_defconfig --]
[-- Type: text/plain, Size: 1899 bytes --]

#! /usr/bin/env python
# vim: set fileencoding=utf-8 :
# Copyright (C) 2010 by Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

import getopt
import re
import os
import subprocess
import sys

# This prevents including a timestamp in the .config which makes comparing a
# bit easier.
os.environ['KCONFIG_NOTIMESTAMP'] = 'Yes, please'

re_interesting = re.compile(r'^(# )?CONFIG_')

opts, args = getopt.getopt(sys.argv[1:], '', ['arch=', 'src='])

src = ''
arch = 'arm'

for o, a in opts:
    if o == '--arch':
        arch = a
    elif o == '--src':
        src = a

configdir = os.path.join(src, 'arch', arch, 'configs')

def all_defconfigs():
    lc = len(configdir)
    for root, dirs, files in os.walk(configdir):
        root = root[lc + 1:]
        for f in filter(lambda s: s.endswith('_defconfig'), files):
            yield os.path.join(root, f)

if not args:
    args = all_defconfigs()

for target in args:
    defconfig_src = os.path.join(configdir, target)

    subprocess.check_call(['make', '-s', 'ARCH=%s' % arch, target])
    origconfig = list(open('.config'))
    config = list(origconfig)
    config_size = os.stat('.config').st_size

    i = 0

    while i < len(config):
        mo = re_interesting.match(config[i])
        if mo:
            defconfig = open(defconfig_src, 'w')
            defconfig.writelines(config[:i])
            defconfig.writelines(config[i + 1:])
            defconfig.close()
            subprocess.check_call(['make', '-s', 'ARCH=%s' % arch, target])
            if os.stat('.config').st_size == config_size and list(open('.config')) == origconfig:
                print '-%s' % config[i][:-1]
                del config[i]
            else:
                print ' %s' % config[i][:-1]
                i += 1
        else:
            del config[i]

    defconfig = open(defconfig_src, 'w')
    defconfig.writelines(config)
    defconfig.close()

WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Daniel Walker <dwalker@codeaurora.org>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Nicolas Pitre <nico@fluxnic.net>,
	Kevin Hilman <khilman@deeprootsystems.com>,
	linux-arm-msm@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Eric Miao <eric.miao@canonical.com>,
	Olof Johansson <olof@lixom.net>,
	linux-omap@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
Subject: optimized script [Was: ARM defconfig files]
Date: Tue, 13 Jul 2010 10:07:05 +0200	[thread overview]
Message-ID: <20100713080705.GA20978@pengutronix.de> (raw)
In-Reply-To: <20100713070741.GB26442@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

Hello,

On Tue, Jul 13, 2010 at 09:07:41AM +0200, Uwe Kleine-König wrote:
> Hi
> 
> On Mon, Jul 12, 2010 at 01:50:47PM -0600, Grant Likely wrote:
> > On Mon, Jul 12, 2010 at 1:34 PM, Linus Torvalds
> > <torvalds@linux-foundation.org> wrote:
> > > On Mon, Jul 12, 2010 at 12:17 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
> > >> I think Uwe could provide his script and add it to the kernel tree.
> > >> Then all architectures could benefit from it.  Having the defconfig
> > >> files contain only those options which are different from the defaults
> > >> is certainly more readable, even on x86.
> > >
> > > Quite possible. But maintainers would need to be on the lookout of
> > > people actually using the script, and refusing to apply patches that
> > > re-introduce the whole big thing.
> > 
> > I can (partially) speak for powerpc.  If ARM uses this approach, then
> > I think we can do the same.  After the defconfigs are trimmed, I
> > certainly won't pick up any more full defconfigs.
> I just restarted my script on the powerpc defconfigs basing on rc5, I
> assume they complete in a few days time.
So Stephen was faster than me.  I don't know yet how he optimised my
script, meanwhile I put some efforts into it, too by just checking lines
that match "^(# )?CONFIG_".

Find it attached.

I will start to reduce the remaining configs (i.e. all but arm and
powerpc).

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: reduce_defconfig --]
[-- Type: text/plain, Size: 1899 bytes --]

#! /usr/bin/env python
# vim: set fileencoding=utf-8 :
# Copyright (C) 2010 by Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

import getopt
import re
import os
import subprocess
import sys

# This prevents including a timestamp in the .config which makes comparing a
# bit easier.
os.environ['KCONFIG_NOTIMESTAMP'] = 'Yes, please'

re_interesting = re.compile(r'^(# )?CONFIG_')

opts, args = getopt.getopt(sys.argv[1:], '', ['arch=', 'src='])

src = ''
arch = 'arm'

for o, a in opts:
    if o == '--arch':
        arch = a
    elif o == '--src':
        src = a

configdir = os.path.join(src, 'arch', arch, 'configs')

def all_defconfigs():
    lc = len(configdir)
    for root, dirs, files in os.walk(configdir):
        root = root[lc + 1:]
        for f in filter(lambda s: s.endswith('_defconfig'), files):
            yield os.path.join(root, f)

if not args:
    args = all_defconfigs()

for target in args:
    defconfig_src = os.path.join(configdir, target)

    subprocess.check_call(['make', '-s', 'ARCH=%s' % arch, target])
    origconfig = list(open('.config'))
    config = list(origconfig)
    config_size = os.stat('.config').st_size

    i = 0

    while i < len(config):
        mo = re_interesting.match(config[i])
        if mo:
            defconfig = open(defconfig_src, 'w')
            defconfig.writelines(config[:i])
            defconfig.writelines(config[i + 1:])
            defconfig.close()
            subprocess.check_call(['make', '-s', 'ARCH=%s' % arch, target])
            if os.stat('.config').st_size == config_size and list(open('.config')) == origconfig:
                print '-%s' % config[i][:-1]
                del config[i]
            else:
                print ' %s' % config[i][:-1]
                i += 1
        else:
            del config[i]

    defconfig = open(defconfig_src, 'w')
    defconfig.writelines(config)
    defconfig.close()

WARNING: multiple messages have this Message-ID (diff)
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: optimized script [Was: ARM defconfig files]
Date: Tue, 13 Jul 2010 10:07:05 +0200	[thread overview]
Message-ID: <20100713080705.GA20978@pengutronix.de> (raw)
In-Reply-To: <20100713070741.GB26442@pengutronix.de>

Hello,

On Tue, Jul 13, 2010 at 09:07:41AM +0200, Uwe Kleine-K?nig wrote:
> Hi
> 
> On Mon, Jul 12, 2010 at 01:50:47PM -0600, Grant Likely wrote:
> > On Mon, Jul 12, 2010 at 1:34 PM, Linus Torvalds
> > <torvalds@linux-foundation.org> wrote:
> > > On Mon, Jul 12, 2010 at 12:17 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
> > >> I think Uwe could provide his script and add it to the kernel tree.
> > >> Then all architectures could benefit from it. ?Having the defconfig
> > >> files contain only those options which are different from the defaults
> > >> is certainly more readable, even on x86.
> > >
> > > Quite possible. But maintainers would need to be on the lookout of
> > > people actually using the script, and refusing to apply patches that
> > > re-introduce the whole big thing.
> > 
> > I can (partially) speak for powerpc.  If ARM uses this approach, then
> > I think we can do the same.  After the defconfigs are trimmed, I
> > certainly won't pick up any more full defconfigs.
> I just restarted my script on the powerpc defconfigs basing on rc5, I
> assume they complete in a few days time.
So Stephen was faster than me.  I don't know yet how he optimised my
script, meanwhile I put some efforts into it, too by just checking lines
that match "^(# )?CONFIG_".

Find it attached.

I will start to reduce the remaining configs (i.e. all but arm and
powerpc).

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
#! /usr/bin/env python
# vim: set fileencoding=utf-8 :
# Copyright (C) 2010 by Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

import getopt
import re
import os
import subprocess
import sys

# This prevents including a timestamp in the .config which makes comparing a
# bit easier.
os.environ['KCONFIG_NOTIMESTAMP'] = 'Yes, please'

re_interesting = re.compile(r'^(# )?CONFIG_')

opts, args = getopt.getopt(sys.argv[1:], '', ['arch=', 'src='])

src = ''
arch = 'arm'

for o, a in opts:
    if o == '--arch':
        arch = a
    elif o == '--src':
        src = a

configdir = os.path.join(src, 'arch', arch, 'configs')

def all_defconfigs():
    lc = len(configdir)
    for root, dirs, files in os.walk(configdir):
        root = root[lc + 1:]
        for f in filter(lambda s: s.endswith('_defconfig'), files):
            yield os.path.join(root, f)

if not args:
    args = all_defconfigs()

for target in args:
    defconfig_src = os.path.join(configdir, target)

    subprocess.check_call(['make', '-s', 'ARCH=%s' % arch, target])
    origconfig = list(open('.config'))
    config = list(origconfig)
    config_size = os.stat('.config').st_size

    i = 0

    while i < len(config):
        mo = re_interesting.match(config[i])
        if mo:
            defconfig = open(defconfig_src, 'w')
            defconfig.writelines(config[:i])
            defconfig.writelines(config[i + 1:])
            defconfig.close()
            subprocess.check_call(['make', '-s', 'ARCH=%s' % arch, target])
            if os.stat('.config').st_size == config_size and list(open('.config')) == origconfig:
                print '-%s' % config[i][:-1]
                del config[i]
            else:
                print ' %s' % config[i][:-1]
                i += 1
        else:
            del config[i]

    defconfig = open(defconfig_src, 'w')
    defconfig.writelines(config)
    defconfig.close()

  reply	other threads:[~2010-07-13  8:07 UTC|newest]

Thread overview: 133+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100603074548.GA12104@flint.arm.linux.org.uk>
2010-06-03 14:48 ` ARM defconfig files Linus Torvalds
2010-06-03 16:46   ` Tony Lindgren
2010-06-03 18:13     ` Russell King
2010-06-03 21:33       ` Tony Lindgren
2010-06-03 22:45         ` Nicolas Pitre
2010-06-04  4:59           ` Tony Lindgren
2010-06-04  0:23       ` Kevin Hilman
2010-06-04  4:53         ` Tony Lindgren
2010-06-04  1:02       ` Benjamin Herrenschmidt
2010-06-04  5:29         ` Tony Lindgren
2010-06-04  6:30         ` Geert Uytterhoeven
2010-06-04  6:53           ` Geert Uytterhoeven
2010-06-04  8:52           ` Benjamin Herrenschmidt
2010-06-03 16:53   ` Daniel Walker
2010-06-08 15:30     ` Catalin Marinas
2010-06-08 16:37       ` Daniel Walker
2010-06-03 18:10   ` Russell King
2010-06-03 18:18     ` Linus Torvalds
2010-06-03 18:53       ` Russell King
2010-06-03 18:56         ` Linus Torvalds
2010-06-03 19:20           ` Russell King
2010-06-03 19:35           ` Daniel Walker
2010-06-03 19:45             ` Russell King
2010-06-03 19:49               ` Daniel Walker
2010-06-03 19:57                 ` Russell King
2010-06-03 20:06                   ` Daniel Walker
2010-06-03 20:18                     ` Russell King
2010-06-03 20:20                   ` Nicolas Pitre
2010-06-04  1:06                   ` Benjamin Herrenschmidt
2010-06-03 20:09               ` Linus Torvalds
2010-06-03 20:31                 ` Linus Torvalds
2010-06-03 21:17                   ` Tony Lindgren
2010-06-03 22:15                     ` Grant Likely
2010-06-04  5:18                       ` Felipe Balbi
2010-06-04 11:31                       ` Catalin Marinas
2010-06-03 22:24                     ` Daniel Walker
2010-06-05 14:12                     ` Felipe Contreras
2010-06-05 14:39                       ` Linus Torvalds
2010-06-05 16:39                         ` Felipe Contreras
2010-06-03 21:48                   ` Daniel Walker
2010-06-04  0:36                   ` Paul Mackerras
2010-06-04 12:39                     ` Grant Likely
2010-06-05 13:47                   ` Felipe Contreras
2010-06-03 20:34                 ` Nicolas Pitre
2010-06-03 20:05             ` Linus Torvalds
2010-06-06  3:28         ` david
2010-06-03 18:20     ` Daniel Walker
2010-06-03 18:21       ` Linus Torvalds
2010-06-03 18:30         ` Al Viro
2010-06-03 19:26         ` Paul Mundt
2010-06-14  8:32         ` Uwe Kleine-König
2010-06-14  8:32           ` Uwe Kleine-König
2010-06-30 10:40           ` Uwe Kleine-König
2010-06-30 10:40             ` Uwe Kleine-König
2010-07-12 15:55             ` Uwe Kleine-König
2010-07-12 15:55               ` Uwe Kleine-König
2010-07-12 16:51               ` Linus Torvalds
2010-07-12 16:51                 ` Linus Torvalds
2010-07-12 16:51                 ` Linus Torvalds
2010-07-12 17:32                 ` Russell King - ARM Linux
2010-07-12 17:32                   ` Russell King - ARM Linux
2010-07-12 17:40                   ` Linus Torvalds
2010-07-12 17:40                     ` Linus Torvalds
2010-07-12 17:40                     ` Linus Torvalds
2010-07-12 18:50                     ` Uwe Kleine-König
2010-07-12 18:50                       ` Uwe Kleine-König
2010-07-12 18:50                       ` Uwe Kleine-König
2010-07-12 19:04                       ` Linus Torvalds
2010-07-12 19:04                         ` Linus Torvalds
2010-07-12 19:17                         ` Nicolas Pitre
2010-07-12 19:17                           ` Nicolas Pitre
2010-07-12 19:34                           ` Linus Torvalds
2010-07-12 19:34                             ` Linus Torvalds
2010-07-12 19:34                             ` Linus Torvalds
2010-07-12 19:50                             ` Grant Likely
2010-07-12 19:50                               ` Grant Likely
2010-07-13  7:07                               ` Uwe Kleine-König
2010-07-13  7:07                                 ` Uwe Kleine-König
2010-07-13  8:07                                 ` Uwe Kleine-König [this message]
2010-07-13  8:07                                   ` optimized script [Was: ARM defconfig files] Uwe Kleine-König
2010-07-13  8:07                                   ` Uwe Kleine-König
2010-07-13 18:04                                   ` Olof Johansson
2010-07-13 18:04                                     ` Olof Johansson
2010-07-13 18:04                                     ` Olof Johansson
2010-07-13 18:04                                     ` Olof Johansson
2010-07-13 23:39                                     ` Nicolas Pitre
2010-07-13 23:39                                       ` Nicolas Pitre
2010-07-13 23:39                                       ` Nicolas Pitre
2010-07-13 18:32                                 ` ARM defconfig files Grant Likely
2010-07-13 18:32                                   ` Grant Likely
2010-07-13 18:32                                   ` Grant Likely
2010-07-12 19:59                             ` Uwe Kleine-König
2010-07-12 19:59                               ` Uwe Kleine-König
2010-07-12 20:14                             ` Nicolas Pitre
2010-07-12 20:14                               ` Nicolas Pitre
2010-07-12 19:09                       ` Nicolas Pitre
2010-07-12 19:09                         ` Nicolas Pitre
2010-07-12 20:31                       ` Arnd Bergmann
2010-07-12 20:31                         ` Arnd Bergmann
2010-07-12 20:50                         ` Nicolas Pitre
2010-07-12 20:50                           ` Nicolas Pitre
2010-07-12 20:50                           ` Nicolas Pitre
2010-07-12 23:05                       ` David Brown
2010-07-12 23:05                         ` David Brown
2010-07-12 23:18                         ` Linus Torvalds
2010-07-12 23:18                           ` Linus Torvalds
2010-07-12 23:18                           ` Linus Torvalds
2010-07-12 23:34                           ` David Brown
2010-07-12 23:34                             ` David Brown
2010-07-13  0:55                             ` Nicolas Pitre
2010-07-13  0:55                               ` Nicolas Pitre
2010-07-14  9:13                             ` Felipe Contreras
2010-07-14  9:13                               ` Felipe Contreras
2010-07-14 13:20                             ` Uwe Kleine-König
2010-07-14 13:20                               ` Uwe Kleine-König
2010-07-14 13:20                               ` Uwe Kleine-König
2010-07-14 17:37                               ` Tony Luck
2010-07-14 17:37                                 ` Tony Luck
2010-07-14 17:37                                 ` Tony Luck
2010-07-13 18:32                           ` Rob Landley
2010-07-13 18:32                             ` Rob Landley
2010-07-12 20:06                     ` Russell King - ARM Linux
2010-07-12 20:06                       ` Russell King - ARM Linux
2010-07-12 20:29                       ` Nicolas Pitre
2010-07-12 20:29                         ` Nicolas Pitre
2010-07-12 21:54                         ` Linus Torvalds
2010-07-12 21:54                           ` Linus Torvalds
2010-07-14  9:21                       ` Felipe Contreras
2010-07-14  9:21                         ` Felipe Contreras
2010-07-14  9:21                         ` Felipe Contreras
2010-06-03 18:41       ` Russell King
2010-06-03 18:53         ` Linus Torvalds
2010-06-06  3:53         ` david

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=20100713080705.GA20978@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=benh@kernel.crashing.org \
    --cc=dwalker@codeaurora.org \
    --cc=eric.miao@canonical.com \
    --cc=grant.likely@secretlab.ca \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nico@fluxnic.net \
    --cc=olof@lixom.net \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.