linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: namhyung@kernel.org, linux-perf-users@vger.kernel.org,
	"Yann E. MORIN" <yann.morin.1998@free.fr>,
	"buildroot@buildroot.org" <buildroot@buildroot.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v9 1/4] Create source symlink in perf object dir
Date: Tue, 26 Nov 2024 08:34:23 +0100	[thread overview]
Message-ID: <20241126083423.63591cbf@booty> (raw)
In-Reply-To: <Z0TMMouXlvhyk6j3@tassilo>

Hello Andi,

thanks for the feedback.

On Mon, 25 Nov 2024 11:12:50 -0800
Andi Kleen <ak@linux.intel.com> wrote:

> On Mon, Nov 25, 2024 at 06:25:06PM +0100, Luca Ceresoli wrote:
> > Hello Andi,
> > 
> > +cc Yann and the Buildroot mailing list (see the end of this report).
> > 
> > On Wed,  7 Aug 2024 16:18:20 -0700
> > Andi Kleen <ak@linux.intel.com> wrote:
> >   
> > > Create a source symlink to the original source in the objdir.
> > > This is similar to what the main kernel build script does.
> > > 
> > > Signed-off-by: Andi Kleen <ak@linux.intel.com>
> > > ---
> > >  tools/perf/Makefile.perf | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> > > index 175e4c7898f0..d46892d8223b 100644
> > > --- a/tools/perf/Makefile.perf
> > > +++ b/tools/perf/Makefile.perf
> > > @@ -163,6 +163,8 @@ ifneq ($(OUTPUT),)
> > >  # for flex/bison parsers.
> > >  VPATH += $(OUTPUT)
> > >  export VPATH
> > > +# create symlink to the original source
> > > +SOURCE := $(shell ln -sf $(srctree)/tools/perf $(OUTPUT)/source)  
> > 
> > I found that since this patch got applied in 890a1961c812 (v6.12-rc1)
> > building perf fails silently in some cases.
> > 
> > The cases I have tested:
> >  - make <FLAGS> -C tools/perf                       -> OK
> >  - make <FLAGS> -C tools/perf O=/my/out/of/tree/dir -> OK
> >  - make <FLAGS> -C tools/perf O=tools/perf          -> fails
> > 
> > The failure in the third case is silent: make exits with a return value
> > of 0, but there is no perf executable created.  
> 
> The failing case is incorrect arguments because the O= is relative to -C 
> and there is no tools/perf/tools/perf

OK. However I get the same result even with O=$(pwd)/tools/perf, which
is precisely what Buildroot does:
https://git.buildroot.net/buildroot/tree/package/linux-tools/linux-tool-perf.mk.in#n170

> But yes a error message would be good.

Sure, as well as a non-zero return value.

> Could just ignore the linking error, so that you hopefully get a better
> error message later.
> 
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 9dd2e8d3f3c9..18f639ec853b 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -164,7 +164,7 @@ ifneq ($(OUTPUT),)
>  VPATH += $(OUTPUT)
>  export VPATH
>  # create symlink to the original source
> -SOURCE := $(shell ln -sf $(srctree)/tools/perf $(OUTPUT)/source)
> +SOURCE := $(shell ln -sf $(srctree)/tools/perf $(OUTPUT)/source || true)

I tried this but I don't see any difference. What is the change you
would have expected in the build output?

I'm afraid I don't understand what the SOURCE variable is supposed to
do so I can hardly follow the logic.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2024-11-26  7:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07 23:18 [PATCH v9 1/4] Create source symlink in perf object dir Andi Kleen
2024-08-07 23:18 ` [PATCH v9 2/4] perf test: Support external tests for separate objdir Andi Kleen
2024-08-07 23:18 ` [PATCH v9 3/4] perf script: Fix perf script -F +metric Andi Kleen
2024-08-08  5:18   ` Namhyung Kim
2024-08-08 18:09     ` Ian Rogers
2024-08-08 20:18       ` Andi Kleen
2024-08-09 15:00         ` Ian Rogers
2024-08-07 23:18 ` [PATCH v9 4/4] Add a test case for " Andi Kleen
2024-11-25 17:25 ` [PATCH v9 1/4] Create source symlink in perf object dir Luca Ceresoli
2024-11-25 19:12   ` Andi Kleen
2024-11-26  7:34     ` Luca Ceresoli [this message]
2025-04-09 17:43 ` Florian Fainelli
2025-04-09 17:59   ` Florian Fainelli

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=20241126083423.63591cbf@booty \
    --to=luca.ceresoli@bootlin.com \
    --cc=ak@linux.intel.com \
    --cc=buildroot@buildroot.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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;
as well as URLs for NNTP newsgroup(s).