[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080608111833.GC10545@uranus.ravnborg.org>
Date: Sun, 8 Jun 2008 13:18:33 +0200
From: Sam Ravnborg <sam@...nborg.org>
To: WANG Cong <xiyou.wangcong@...il.com>
Cc: Vegard Nossum <vegard.nossum@...il.com>,
linux-kbuild <linux-kbuild@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
David Woodhouse <dwmw2@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jan Engelhardt <jengelh@...putergmbh.de>
Subject: Re: [PATCH] Speed up "make headers_*"
Hi WANG.
> >No error handling and I like to avid the extra tmp file.
>
>
> I think you can open a pipe in Perl, e.g. open FILE, "|scripts/unifdef";.
>
>
> >
> > Sam
> >
> >#!/usr/bin/perl
> >#
> ># headers_install prepare the listed header files for use in
> ># user space and copy the files to their destination.
> >#
> ># Usage: headers_install.pl odir installdir [files...]
> ># odir: dir to open files
> ># install: dir to install the files
> ># files: list of files to check
> >#
> ># Step in preparation for users space:
> ># 1) Drop all use of compiler.h definitions
> ># 2) Drop include of compiler.h
> ># 3) Drop all sections defined out by __KERNEL__
> >
> >use strict;
> >use warnings;
> >
> >my ($odir, $installdir, @files) = @ARGV;
> >
> >my $ret = 0;
>
>
> This is only used by last exit, thus can be removed.
>
> >
> >foreach my $file (@files) {
> > open(my $infile, '<', "$odir/$file") or die "$odir/$file: $!\n";
> > open(my $outfile, '>', "$installdir/$file.tmp") or
> > die "$installdir/$file.tmp: $!\n";
> > while (my $line = <$infile>) {
> > $line =~ s/([\s(])__user\s/$1/g;
> > $line =~ s/([\s(])__force\s/$1/g;
> > $line =~ s/([\s(])__iomem\s/$1/g;
> > $line =~ s/\s__attribute_const__\s/ /g;
> > $line =~ s/\s__attribute_const__$//g;
> > $line =~ s/^#include <linux\/compiler.h>//;
> > printf $outfile "%s", $line;
> > }
> > close($outfile);
> > close($outfile);
>
>
> 'close' doesn't need parenthesises neither.
>
> > system "scripts/unifdef -U__KERNEL__ $installdir/$file.tmp > $installdir/$file"
>
>
> Will scripts/unifdef clean the tmp file? If not, you should do it, right?
Will fix - it was left as I hope to fix the unifdef thing
and then it may error out too.
Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists