From: Namhyung Kim <namhyung@kernel.org>
To: Guilherme Amadio <amadio@gentoo.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>,
Thorsten Leemhuis <linux@leemhuis.info>,
Leo Yan <leo.yan@arm.com>,
linux-perf-users@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/6] perf build: Conditionally add feature check flags for libtrace{event,fs}
Date: Thu, 11 Jul 2024 15:08:30 -0700 [thread overview]
Message-ID: <ZpBX3gE1wJ89gUlt@google.com> (raw)
In-Reply-To: <ZoVFqiZdTXy1glLc@gentoo.org>
Hello,
On Wed, Jul 03, 2024 at 02:35:54PM +0200, Guilherme Amadio wrote:
> Hello,
>
> On Tue, Jul 02, 2024 at 04:33:27PM -0700, Namhyung Kim wrote:
> > Hello,
> >
> > On Fri, Jun 28, 2024 at 10:34:27PM +0200, Guilherme Amadio wrote:
> > > This avoids reported warnings when the packages are not installed.
> > >
> > > Fixes: 0f0e1f44569061e3dc590cd0b8cb74d8fd53706b
> > > Signed-off-by: Guilherme Amadio <amadio@gentoo.org>
> >
> > Thanks for working on this.
> >
> > > ---
> > > tools/perf/Makefile.config | 28 +++++++++++++++-------------
> > > 1 file changed, 15 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> > > index 5271a4c1d2b3..5387babb8f04 100644
> > > --- a/tools/perf/Makefile.config
> > > +++ b/tools/perf/Makefile.config
> > > @@ -182,13 +182,21 @@ endif
> > > FEATURE_CHECK_CFLAGS-libzstd := $(LIBZSTD_CFLAGS)
> > > FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
> > >
> > > -# for linking with debug library, run like:
> > > -# make DEBUG=1 PKG_CONFIG_PATH=/opt/libtraceevent/(lib|lib64)/pkgconfig
> > > -FEATURE_CHECK_CFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --cflags libtraceevent)
> > > -FEATURE_CHECK_LDFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --libs libtraceevent)
> > > -
> > > -FEATURE_CHECK_CFLAGS-libtracefs := $(shell $(PKG_CONFIG) --cflags libtracefs)
> > > -FEATURE_CHECK_LDFLAGS-libtracefs := $(shell $(PKG_CONFIG) --libs libtracefs)
> > > +ifneq ($(NO_LIBTRACEEVENT),1)
> > > + ifeq ($(call get-executable,$(PKG_CONFIG)),)
> > > + dummy := $(error Error: $(PKG_CONFIG) needed by libtraceevent is missing on this system, please install it)
> >
> > I know you just copied the code, but IIRC we wanted to remove this dummy
> > assignment before.
>
> Sure, I will change this. I think we can also remove the "dummy :=" part and
> just do $(error Error: ...), like it's done in other places.
>
> > > + endif
> > > +endif
> > > +ifeq ($(shell $(PKG_CONFIG) --exists libtraceevent 2>&1 1>/dev/null; echo $$?),0)
> > > + # for linking with debug library, run like:
> > > + # make DEBUG=1 PKG_CONFIG_PATH=/opt/libtraceevent/(lib|lib64)/pkgconfig
> > > + FEATURE_CHECK_CFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --cflags libtraceevent)
> > > + FEATURE_CHECK_LDFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --libs libtraceevent)
> > > +endif
> > > +ifeq ($(shell $(PKG_CONFIG) --exists libtracefs 2>&1 1>/dev/null; echo $$?),0)
> > > + FEATURE_CHECK_CFLAGS-libtracefs := $(shell $(PKG_CONFIG) --cflags libtracefs)
> > > + FEATURE_CHECK_LDFLAGS-libtracefs := $(shell $(PKG_CONFIG) --libs libtracefs)
> >
> > I'm curious if we can redirect stderr to /dev/null to surpress the
> > output when pkg-config is not installed. Then we don't need to check
> > the `ifeq`.
>
> I was wondering that myself when I added the check, if you prefer to redirect
> stderr to /dev/null, I will do it that way then when I submit v3.
Due to the timing of the merge window, I'll apply this patch (1/6 only)
with the following modification. Please take a look and update v3.
Thanks,
Namhyung
---
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 5387babb8f04..a4829b6532d8 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -184,19 +184,17 @@ FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
ifneq ($(NO_LIBTRACEEVENT),1)
ifeq ($(call get-executable,$(PKG_CONFIG)),)
- dummy := $(error Error: $(PKG_CONFIG) needed by libtraceevent is missing on this system, please install it)
+ $(error Error: $(PKG_CONFIG) needed by libtraceevent is missing on this system, please install it)
endif
endif
-ifeq ($(shell $(PKG_CONFIG) --exists libtraceevent 2>&1 1>/dev/null; echo $$?),0)
- # for linking with debug library, run like:
- # make DEBUG=1 PKG_CONFIG_PATH=/opt/libtraceevent/(lib|lib64)/pkgconfig
- FEATURE_CHECK_CFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --cflags libtraceevent)
- FEATURE_CHECK_LDFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --libs libtraceevent)
-endif
-ifeq ($(shell $(PKG_CONFIG) --exists libtracefs 2>&1 1>/dev/null; echo $$?),0)
- FEATURE_CHECK_CFLAGS-libtracefs := $(shell $(PKG_CONFIG) --cflags libtracefs)
- FEATURE_CHECK_LDFLAGS-libtracefs := $(shell $(PKG_CONFIG) --libs libtracefs)
-endif
+
+# for linking with debug library, run like:
+# make DEBUG=1 PKG_CONFIG_PATH=/opt/libtraceevent/(lib|lib64)/pkgconfig
+FEATURE_CHECK_CFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --cflags libtraceevent 2>/dev/null)
+FEATURE_CHECK_LDFLAGS-libtraceevent := $(shell $(PKG_CONFIG) --libs libtraceevent 2>/dev/null)
+
+FEATURE_CHECK_CFLAGS-libtracefs := $(shell $(PKG_CONFIG) --cflags libtracefs 2>/dev/null)
+FEATURE_CHECK_LDFLAGS-libtracefs := $(shell $(PKG_CONFIG) --libs libtracefs 2>/dev/null)
FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
# include ARCH specific config
next prev parent reply other threads:[~2024-07-11 22:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240628202608.3273329-1-amadio@gentoo.org>
2024-06-28 20:34 ` [PATCH v2 1/6] perf build: Conditionally add feature check flags for libtrace{event,fs} Guilherme Amadio
2024-06-28 20:34 ` [PATCH v2 2/6] perf build: Warn if libtracefs is not found Guilherme Amadio
2024-06-28 20:34 ` [PATCH v2 3/6] tools: Make pkg-config dependency checks usable by other tools Guilherme Amadio
2024-07-02 23:40 ` Namhyung Kim
2024-07-03 19:36 ` Steven Rostedt
2024-07-03 21:33 ` Namhyung Kim
2024-07-03 23:05 ` Steven Rostedt
2024-07-04 1:45 ` Namhyung Kim
2024-06-28 20:34 ` [PATCH v2 4/6] tools/verification: Use pkg-config in lib_setup of Makefile.config Guilherme Amadio
2024-06-28 20:34 ` [PATCH v2 5/6] tools/rtla: " Guilherme Amadio
2024-06-28 20:34 ` [PATCH v2 6/6] tools/latency: " Guilherme Amadio
2024-07-02 23:33 ` [PATCH v2 1/6] perf build: Conditionally add feature check flags for libtrace{event,fs} Namhyung Kim
2024-07-03 12:35 ` Guilherme Amadio
2024-07-03 21:29 ` Namhyung Kim
2024-07-11 22:08 ` Namhyung Kim [this message]
2024-07-08 12:32 ` Leo Yan
2024-07-16 10:19 ` Thorsten Leemhuis
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=ZpBX3gE1wJ89gUlt@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=amadio@gentoo.org \
--cc=irogers@google.com \
--cc=leo.yan@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux@leemhuis.info \
/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).