Re: [PATCH] perf build: Suppress warning about missing libbabeltrace
From: Jiri Olsa
Date: Fri Mar 27 2015 - 09:30:28 EST
On Fri, Mar 27, 2015 at 12:18:55PM +0100, Ingo Molnar wrote:
>
> * Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
>
> > Be silent about missing babeltrace library until the needed
> > version (1.3) is pushed into most common distros.
> >
> > Requested-by: Ingo Molnar <mingo@xxxxxxxxxx>
> > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> > Link: http://lkml.kernel.org/n/tip-95mcd8hoxyt43jighilggjej@xxxxxxxxxxxxxx
> > ---
> > tools/perf/config/Makefile | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> > index cd121dfc4de9..2d9142b10cd3 100644
> > --- a/tools/perf/config/Makefile
> > +++ b/tools/perf/config/Makefile
> > @@ -606,7 +606,12 @@ ifndef NO_LIBBABELTRACE
> > EXTLIBS += -lbabeltrace-ctf
> > $(call detected,CONFIG_LIBBABELTRACE)
> > else
> > - msg := $(warning No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev);
> > +#
> > +# Be silent about missing babeltrace library
> > +# until the needed version (1.3) is pushed
> > +# into most common distros.
> > +#
> > +# msg := $(warning No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev);
> > NO_LIBBABELTRACE := 1
> > endif
> > endif
>
> But, but ... the feature detection is still executed, and it slows
> down the regular build on 99.9999% of the systems, right?
>
right, so currently all features are being checked by default and the
only way to disable the check is via NO_* make variables
> I don't mind carrying the code, but could we make it such that it
> needs some special option to build or so?
I thought about this as of generic feature for all checks, but given
that this is the only case so far, how about attached patch?
it's changing the NO_LIBBABELTRACE to LIBBABELTRACE so the libbabeltrace
check is disabled unless you do:
$ make LIBBABELTRACE=1
and we'd switch it back once the babeltrace 1.3 is in generic use
jirka
---
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index e9925e6ad1d0..c43a20517591 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -69,7 +69,7 @@ include config/utilities.mak
#
# Define NO_ZLIB if you do not want to support compressed kernel modules
#
-# Define NO_LIBBABELTRACE if you do not want libbabeltrace support
+# Define LIBBABELTRACE if you DO want libbabeltrace support
# for CTF data format.
#
# Define NO_LZMA if you do not want to support compressed (xz) kernel modules
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index cd121dfc4de9..59a98c643240 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -95,7 +95,7 @@ ifndef NO_LIBELF
FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) -ldw
endif
-ifndef NO_LIBBABELTRACE
+ifdef LIBBABELTRACE
# for linking with debug library, run like:
# make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
ifdef LIBBABELTRACE_DIR
@@ -598,7 +598,7 @@ else
NO_PERF_READ_VDSOX32 := 1
endif
-ifndef NO_LIBBABELTRACE
+ifdef LIBBABELTRACE
$(call feature_check,libbabeltrace)
ifeq ($(feature-libbabeltrace), 1)
CFLAGS += -DHAVE_LIBBABELTRACE_SUPPORT $(LIBBABELTRACE_CFLAGS)
@@ -607,7 +607,6 @@ ifndef NO_LIBBABELTRACE
$(call detected,CONFIG_LIBBABELTRACE)
else
msg := $(warning No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev);
- NO_LIBBABELTRACE := 1
endif
endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/