From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Bruce Ashfield <bruce.ashfield@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/2] kernel: stop using -exec rm for deleting files
Date: Sun, 09 Feb 2014 12:06:32 +0000 [thread overview]
Message-ID: <1391947592.7120.0.camel@ted> (raw)
In-Reply-To: <8a4a98cc53998f6bbf08763359e1b560b2da3e54.1391534980.git.bruce.ashfield@windriver.com>
On Tue, 2014-02-04 at 12:34 -0500, Bruce Ashfield wrote:
> Removing files from the source tree via find, exec and rm is not the
> most efficient operation, due to (among other things) the many forked
> processes.
>
> If we use -delete, it saves a significant amount of time. But -delete
> does not work with -prune (since it forces -depth). To maintain the
> lib, tools and scripts source files, we can hide them temporarily,
> skip their hidden directories and then finally restore them.
>
> Time for install before this change:
>
> real 2m48.563s
> user 0m35.220s
> sys 0m33.036s
>
> Time for install after this change:
>
> real 1m21.301s
> user 0m33.160s
> sys 0m28.388s
>
> We could further speed this up by using inline perl to delete the files,
> but that complexity is avoided for now.
>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
> meta/classes/kernel.bbclass | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 51626b03f824..b76a65699755 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -260,9 +260,21 @@ kernel_do_install() {
> # we clean the scripts dir while leaving the generated config
> # and include files.
> #
> - oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
> - make -C $kerneldir _mrproper_scripts
> - find $kerneldir -path $kerneldir/lib -prune -o -path $kerneldir/tools -prune -o -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
> + oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
> +
> + # hide directories that shouldn't have their .c, s and S files deleted
> + for d in tools scripts lib; do
> + mv $kerneldir/$d $kerneldir/.$d
> + done
> +
> + # delete .c, .s and .S files, unless we hid a directory as .<dir>. This technique is
> + # much faster than find -prune and -exec
> + find . -not -path '*/\.*' -type f -name "*.[csS]" -delete
> +
> + # put the hidden dirs back
> + for d in tools scripts lib; do
> + mv $kerneldir/.$d $kerneldir/$d
> + done
>
> # As of Linux kernel version 3.0.1, the clean target removes
> # arch/powerpc/lib/crtsavres.o which is present in
I think this patch is resulting in:
http://autobuilder.yoctoproject.org/main/builders/nightly-fsl-ppc-lsb/builds/22/steps/BuildImages/logs/stdio
Cheers,
Richard
next prev parent reply other threads:[~2014-02-09 12:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 17:34 [PATCH 0/2] kernel: consolidated pull request Bruce Ashfield
2014-02-04 17:34 ` [PATCH 1/2] kernel: stop using -exec rm for deleting files Bruce Ashfield
2014-02-04 23:26 ` Richard Purdie
2014-02-05 0:35 ` Bruce Ashfield
2014-02-05 1:36 ` Paul Barker
2014-02-05 3:10 ` Bruce Ashfield
2014-02-09 12:06 ` Richard Purdie [this message]
2014-02-09 14:36 ` Bruce Ashfield
2014-02-10 13:32 ` Bruce Ashfield
2014-02-10 17:17 ` Bruce Ashfield
2014-02-10 17:23 ` Richard Purdie
2014-02-04 17:34 ` [PATCH 2/2] linux-yocto/3.10: integrate LTSI Bruce Ashfield
2014-02-07 16:42 ` Saul Wold
2014-02-07 16:44 ` Bruce Ashfield
2014-02-07 16:46 ` Darren Hart
2014-02-07 16:47 ` Darren Hart
2014-02-07 16:48 ` Bruce Ashfield
2014-02-07 16:55 ` Darren Hart
2014-02-07 16:57 ` Bruce Ashfield
2014-02-07 17:24 ` Bruce Ashfield
2014-02-07 17:32 ` Darren Hart
2014-02-07 19:22 ` Bruce Ashfield
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=1391947592.7120.0.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=bruce.ashfield@windriver.com \
--cc=openembedded-core@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox