All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] perf: make a copy of kernel source to perf workdir
@ 2018-04-23  8:13 Hongxu Jia
  2018-04-23 17:51 ` Bruce Ashfield
  0 siblings, 1 reply; 5+ messages in thread
From: Hongxu Jia @ 2018-04-23  8:13 UTC (permalink / raw)
  To: openembedded-core, bruce.ashfield

Since perf modify kernel source which shared by multiple
recipes, it probably caused kernel-devsrc compile failure
at world build.
...
|0 blocks
|cpio: ./tools/perf/arch/arm/util/sedr7ORqk: Cannot stat:
No such file or directory
|0 blocks
...
cpio tried to find a file at ${S}/tools/perf and failed
if the input list is not valid.

Make a copy of kernel shared source directory into a perf workdir
could fix the issue.

Drop `Fix for rebuilding' which is obsolete

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-kernel/perf/perf.bb | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 872b5f0..8b40806 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -61,7 +61,7 @@ export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version
 
 inherit kernelsrc
 
-B = "${WORKDIR}/${BPN}-${PV}"
+S = "${WORKDIR}/${BP}"
 SPDX_S = "${S}/tools/perf"
 
 # The LDFLAGS is required or some old kernels fails due missing
@@ -119,11 +119,12 @@ do_install() {
 	fi
 }
 
-do_configure_prepend () {
-    # Fix for rebuilding
-    rm -rf ${B}/
-    mkdir -p ${B}/
+do_configure[prefuncs] += "git_clone_kernel_source"
+git_clone_kernel_source () {
+    git clone --single-branch ${STAGING_KERNEL_DIR} ${S}
+}
 
+do_configure_prepend () {
     # If building a multlib based perf, the incorrect library path will be
     # detected by perf, since it triggers via: ifeq ($(ARCH),x86_64). In a 32 bit
     # build, with a 64 bit multilib, the arch won't match and the detection of a 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] perf: make a copy of kernel source to perf workdir
  2018-04-23  8:13 [PATCH V2] perf: make a copy of kernel source to perf workdir Hongxu Jia
@ 2018-04-23 17:51 ` Bruce Ashfield
  2018-04-23 22:05   ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Bruce Ashfield @ 2018-04-23 17:51 UTC (permalink / raw)
  To: Hongxu Jia, openembedded-core

On 2018-04-23 4:13 AM, Hongxu Jia wrote:
> Since perf modify kernel source which shared by multiple
> recipes, it probably caused kernel-devsrc compile failure
> at world build.
> ...
> |0 blocks
> |cpio: ./tools/perf/arch/arm/util/sedr7ORqk: Cannot stat:
> No such file or directory
> |0 blocks
> ...
> cpio tried to find a file at ${S}/tools/perf and failed
> if the input list is not valid.
> 
> Make a copy of kernel shared source directory into a perf workdir
> could fix the issue.
> 
> Drop `Fix for rebuilding' which is obsolete
> 
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>   meta/recipes-kernel/perf/perf.bb | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
> index 872b5f0..8b40806 100644
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -61,7 +61,7 @@ export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version
>   
>   inherit kernelsrc
>   
> -B = "${WORKDIR}/${BPN}-${PV}"
> +S = "${WORKDIR}/${BP}"
>   SPDX_S = "${S}/tools/perf"
>   
>   # The LDFLAGS is required or some old kernels fails due missing
> @@ -119,11 +119,12 @@ do_install() {
>   	fi
>   }
>   
> -do_configure_prepend () {
> -    # Fix for rebuilding
> -    rm -rf ${B}/
> -    mkdir -p ${B}/
> +do_configure[prefuncs] += "git_clone_kernel_source"
> +git_clone_kernel_source () {
> +    git clone --single-branch ${STAGING_KERNEL_DIR} ${S}

I probably would have used "cp -a -r", or similar. Since it
is possible that a kernel may not actually be a git repo (linux-yocto
always is, but that is just one data point).

Also, did you try just copying the tools SRC dir + whatever
infrastructure is needed to build ? That will save us a LOT
of i/o when moving the source around for perf to build.

But outside of those details/mechanics, the approach is sound.

Bruce


> +}
>   
> +do_configure_prepend () {
>       # If building a multlib based perf, the incorrect library path will be
>       # detected by perf, since it triggers via: ifeq ($(ARCH),x86_64). In a 32 bit
>       # build, with a 64 bit multilib, the arch won't match and the detection of a
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] perf: make a copy of kernel source to perf workdir
  2018-04-23 17:51 ` Bruce Ashfield
@ 2018-04-23 22:05   ` Richard Purdie
  2018-04-24  0:45     ` Bruce Ashfield
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2018-04-23 22:05 UTC (permalink / raw)
  To: Bruce Ashfield, Hongxu Jia, openembedded-core

On Mon, 2018-04-23 at 13:51 -0400, Bruce Ashfield wrote:
> On 2018-04-23 4:13 AM, Hongxu Jia wrote:
> > 
> > Since perf modify kernel source which shared by multiple
> > recipes, it probably caused kernel-devsrc compile failure
> > at world build.
> > ...
> > > 
> > > 0 blocks
> > > cpio: ./tools/perf/arch/arm/util/sedr7ORqk: Cannot stat:
> > No such file or directory
> > > 
> > > 0 blocks
> > ...
> > cpio tried to find a file at ${S}/tools/perf and failed
> > if the input list is not valid.
> > 
> > Make a copy of kernel shared source directory into a perf workdir
> > could fix the issue.
> > 
> > Drop `Fix for rebuilding' which is obsolete
> > 
> > Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> > ---
> >   meta/recipes-kernel/perf/perf.bb | 11 ++++++-----
> >   1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-
> > kernel/perf/perf.bb
> > index 872b5f0..8b40806 100644
> > --- a/meta/recipes-kernel/perf/perf.bb
> > +++ b/meta/recipes-kernel/perf/perf.bb
> > @@ -61,7 +61,7 @@ export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OW
> > N_DIR}/perl/${@get_perl_version
> >   
> >   inherit kernelsrc
> >   
> > -B = "${WORKDIR}/${BPN}-${PV}"
> > +S = "${WORKDIR}/${BP}"
> >   SPDX_S = "${S}/tools/perf"
> >   
> >   # The LDFLAGS is required or some old kernels fails due missing
> > @@ -119,11 +119,12 @@ do_install() {
> >   	fi
> >   }
> >   
> > -do_configure_prepend () {
> > -    # Fix for rebuilding
> > -    rm -rf ${B}/
> > -    mkdir -p ${B}/
> > +do_configure[prefuncs] += "git_clone_kernel_source"
> > +git_clone_kernel_source () {
> > +    git clone --single-branch ${STAGING_KERNEL_DIR} ${S}
> I probably would have used "cp -a -r", or similar. Since it
> is possible that a kernel may not actually be a git repo (linux-yocto
> always is, but that is just one data point).
> 
> Also, did you try just copying the tools SRC dir + whatever
> infrastructure is needed to build ? That will save us a LOT
> of i/o when moving the source around for perf to build.
> 
> But outside of those details/mechanics, the approach is sound.

Our "copy hardlink tree" function, whatever its called is sometimes of
use in these cases...

I think I'm the current owner of a bug in this area which I've sadly
not gotten to yet :(.

Also, have we considered the alternative - not copying tools/perf for
the kernel devsrc?

Cheers,

Richard


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] perf: make a copy of kernel source to perf workdir
  2018-04-23 22:05   ` Richard Purdie
@ 2018-04-24  0:45     ` Bruce Ashfield
  2018-04-24  1:44       ` Hongxu Jia
  0 siblings, 1 reply; 5+ messages in thread
From: Bruce Ashfield @ 2018-04-24  0:45 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

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

On Mon, Apr 23, 2018 at 6:05 PM, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Mon, 2018-04-23 at 13:51 -0400, Bruce Ashfield wrote:
> > On 2018-04-23 4:13 AM, Hongxu Jia wrote:
> > >
> > > Since perf modify kernel source which shared by multiple
> > > recipes, it probably caused kernel-devsrc compile failure
> > > at world build.
> > > ...
> > > >
> > > > 0 blocks
> > > > cpio: ./tools/perf/arch/arm/util/sedr7ORqk: Cannot stat:
> > > No such file or directory
> > > >
> > > > 0 blocks
> > > ...
> > > cpio tried to find a file at ${S}/tools/perf and failed
> > > if the input list is not valid.
> > >
> > > Make a copy of kernel shared source directory into a perf workdir
> > > could fix the issue.
> > >
> > > Drop `Fix for rebuilding' which is obsolete
> > >
> > > Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> > > ---
> > >   meta/recipes-kernel/perf/perf.bb | 11 ++++++-----
> > >   1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-
> > > kernel/perf/perf.bb
> > > index 872b5f0..8b40806 100644
> > > --- a/meta/recipes-kernel/perf/perf.bb
> > > +++ b/meta/recipes-kernel/perf/perf.bb
> > > @@ -61,7 +61,7 @@ export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OW
> > > N_DIR}/perl/${@get_perl_version
> > >
> > >   inherit kernelsrc
> > >
> > > -B = "${WORKDIR}/${BPN}-${PV}"
> > > +S = "${WORKDIR}/${BP}"
> > >   SPDX_S = "${S}/tools/perf"
> > >
> > >   # The LDFLAGS is required or some old kernels fails due missing
> > > @@ -119,11 +119,12 @@ do_install() {
> > >     fi
> > >   }
> > >
> > > -do_configure_prepend () {
> > > -    # Fix for rebuilding
> > > -    rm -rf ${B}/
> > > -    mkdir -p ${B}/
> > > +do_configure[prefuncs] += "git_clone_kernel_source"
> > > +git_clone_kernel_source () {
> > > +    git clone --single-branch ${STAGING_KERNEL_DIR} ${S}
> > I probably would have used "cp -a -r", or similar. Since it
> > is possible that a kernel may not actually be a git repo (linux-yocto
> > always is, but that is just one data point).
> >
> > Also, did you try just copying the tools SRC dir + whatever
> > infrastructure is needed to build ? That will save us a LOT
> > of i/o when moving the source around for perf to build.
> >
> > But outside of those details/mechanics, the approach is sound.
>
> Our "copy hardlink tree" function, whatever its called is sometimes of
> use in these cases...
>
> I think I'm the current owner of a bug in this area which I've sadly
> not gotten to yet :(.
>
> Also, have we considered the alternative - not copying tools/perf for
> the kernel devsrc?
>

We could, but sometimes the devsrc is actually used to build the tools.
I know that I have used it to build perf in the past.

It is mostly skipped in my rewritten version (which I'll resubmit after 2.5
releases). So for now, I'm thinking the smallest footprint change makes
the most sense (as to which that is, that is probably not black and white).

Bruce


>
> Cheers,
>
> Richard
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"

[-- Attachment #2: Type: text/html, Size: 5359 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] perf: make a copy of kernel source to perf workdir
  2018-04-24  0:45     ` Bruce Ashfield
@ 2018-04-24  1:44       ` Hongxu Jia
  0 siblings, 0 replies; 5+ messages in thread
From: Hongxu Jia @ 2018-04-24  1:44 UTC (permalink / raw)
  To: Bruce Ashfield, Richard Purdie
  Cc: Patches and discussions about the oe-core layer

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

On 2018年04月24日 08:45, Bruce Ashfield wrote:
>
>
> On Mon, Apr 23, 2018 at 6:05 PM, Richard Purdie 
> <richard.purdie@linuxfoundation.org 
> <mailto:richard.purdie@linuxfoundation.org>> wrote:
>
>     On Mon, 2018-04-23 at 13:51 -0400, Bruce Ashfield wrote:
>     > On 2018-04-23 4:13 AM, Hongxu Jia wrote:
>     > >
>     > > Since perf modify kernel source which shared by multiple
>     > > recipes, it probably caused kernel-devsrc compile failure
>     > > at world build.
>     > > ...
>     > > >
>     > > > 0 blocks
>     > > > cpio: ./tools/perf/arch/arm/util/sedr7ORqk: Cannot stat:
>     > > No such file or directory
>     > > >
>     > > > 0 blocks
>     > > ...
>     > > cpio tried to find a file at ${S}/tools/perf and failed
>     > > if the input list is not valid.
>     > >
>     > > Make a copy of kernel shared source directory into a perf workdir
>     > > could fix the issue.
>     > >
>     > > Drop `Fix for rebuilding' which is obsolete
>     > >
>     > > Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com
>     <mailto:hongxu.jia@windriver.com>>
>     > > ---
>     > >   meta/recipes-kernel/perf/perf.bb <http://perf.bb> | 11
>     ++++++-----
>     > >   1 file changed, 6 insertions(+), 5 deletions(-)
>     > >
>     > > diff --git a/meta/recipes-kernel/perf/perf.bb <http://perf.bb>
>     b/meta/recipes-
>     > > kernel/perf/perf.bb <http://perf.bb>
>     > > index 872b5f0..8b40806 100644
>     > > --- a/meta/recipes-kernel/perf/perf.bb <http://perf.bb>
>     > > +++ b/meta/recipes-kernel/perf/perf.bb <http://perf.bb>
>     > > @@ -61,7 +61,7 @@ export PERL_ARCHLIB =
>     "${STAGING_LIBDIR}${PERL_OW
>     > > N_DIR}/perl/${@get_perl_version
>     > >
>     > >   inherit kernelsrc
>     > >
>     > > -B = "${WORKDIR}/${BPN}-${PV}"
>     > > +S = "${WORKDIR}/${BP}"
>     > >   SPDX_S = "${S}/tools/perf"
>     > >
>     > >   # The LDFLAGS is required or some old kernels fails due missing
>     > > @@ -119,11 +119,12 @@ do_install() {
>     > >     fi
>     > >   }
>     > >
>     > > -do_configure_prepend () {
>     > > -    # Fix for rebuilding
>     > > -    rm -rf ${B}/
>     > > -    mkdir -p ${B}/
>     > > +do_configure[prefuncs] += "git_clone_kernel_source"
>     > > +git_clone_kernel_source () {
>     > > +    git clone --single-branch ${STAGING_KERNEL_DIR} ${S}
>     > I probably would have used "cp -a -r", or similar. Since it
>     > is possible that a kernel may not actually be a git repo
>     (linux-yocto
>     > always is, but that is just one data point).
>     >
>     > Also, did you try just copying the tools SRC dir + whatever
>     > infrastructure is needed to build ? That will save us a LOT
>     > of i/o when moving the source around for perf to build.
>     >
>

OK, I will copy the perf used src dir rather than the entire project source.

>     > But outside of those details/mechanics, the approach is sound.
>
>     Our "copy hardlink tree" function, whatever its called is sometimes of
>     use in these cases...
>

Got it, I will use oe.path.copyhardlinktree

//Hongxu

>     I think I'm the current owner of a bug in this area which I've sadly
>     not gotten to yet :(.
>
>     Also, have we considered the alternative - not copying tools/perf for
>     the kernel devsrc?
>
>
> We could, but sometimes the devsrc is actually used to build the tools.
> I know that I have used it to build perf in the past.
>
> It is mostly skipped in my rewritten version (which I'll resubmit 
> after 2.5
> releases). So for now, I'm thinking the smallest footprint change makes
> the most sense (as to which that is, that is probably not black and 
> white).
>
> Bruce
>
>
>     Cheers,
>
>     Richard
>     -- 
>     _______________________________________________
>     Openembedded-core mailing list
>     Openembedded-core@lists.openembedded.org
>     <mailto:Openembedded-core@lists.openembedded.org>
>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>     <http://lists.openembedded.org/mailman/listinfo/openembedded-core>
>
>
>
>
> -- 
> "Thou shalt not follow the NULL pointer, for chaos and madness await 
> thee at its end"



[-- Attachment #2: Type: text/html, Size: 9948 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-24  1:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23  8:13 [PATCH V2] perf: make a copy of kernel source to perf workdir Hongxu Jia
2018-04-23 17:51 ` Bruce Ashfield
2018-04-23 22:05   ` Richard Purdie
2018-04-24  0:45     ` Bruce Ashfield
2018-04-24  1:44       ` Hongxu Jia

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.