public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2 next] tools build feature detection fixes
@ 2024-12-13 19:50 Arnaldo Carvalho de Melo
  2024-12-13 19:50 ` [PATCH 1/2] tools build feature: Don't set feature-libslang-include-subdir=1 if test-all.c builds Arnaldo Carvalho de Melo
  2024-12-13 19:50 ` [PATCH 2/2] tools build: Test for presence of libtraceevent and libtracefs in test-all.c Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-12-13 19:50 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ingo Molnar, Thomas Gleixner, James Clark, Jiri Olsa, Ian Rogers,
	Adrian Hunter, Kan Liang, Clark Williams, linux-kernel,
	linux-perf-users, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Hi,

	Some more work on auditing the feature detection fast path.

- Arnaldo

Arnaldo Carvalho de Melo (2):
  tools build feature: Don't set feature-libslang-include-subdir=1 if test-all.c builds
  tools build: Test for presence of libtraceevent and libtracefs in test-all.c

 tools/build/Makefile.feature   |  1 -
 tools/build/feature/test-all.c | 10 ++++++++++
 tools/perf/Makefile.config     |  2 --
 3 files changed, 10 insertions(+), 3 deletions(-)

-- 
2.47.0


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

* [PATCH 1/2] tools build feature: Don't set feature-libslang-include-subdir=1 if test-all.c builds
  2024-12-13 19:50 [PATCH 0/2 next] tools build feature detection fixes Arnaldo Carvalho de Melo
@ 2024-12-13 19:50 ` Arnaldo Carvalho de Melo
  2024-12-13 19:50 ` [PATCH 2/2] tools build: Test for presence of libtraceevent and libtracefs in test-all.c Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-12-13 19:50 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ingo Molnar, Thomas Gleixner, James Clark, Jiri Olsa, Ian Rogers,
	Adrian Hunter, Kan Liang, Clark Williams, linux-kernel,
	linux-perf-users, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@redhat.com>

As it is not really included in tools/build/feature/test-all.c, so any
questioning about this feature should really try to build
tools/build/feature/test-libslang-include-subdir.c and not set it as
detected when test-all.c builds.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Makefile.feature | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index e25cdb7db40e3f3d..16c3194c3a5c42c2 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -82,7 +82,6 @@ FEATURE_TESTS_BASIC :=                  \
         libperl                         \
         libpython                       \
         libslang                        \
-        libslang-include-subdir         \
         libtraceevent                   \
         libtracefs                      \
         libcpupower                     \
-- 
2.47.0


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

* [PATCH 2/2] tools build: Test for presence of libtraceevent and libtracefs in test-all.c
  2024-12-13 19:50 [PATCH 0/2 next] tools build feature detection fixes Arnaldo Carvalho de Melo
  2024-12-13 19:50 ` [PATCH 1/2] tools build feature: Don't set feature-libslang-include-subdir=1 if test-all.c builds Arnaldo Carvalho de Melo
@ 2024-12-13 19:50 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-12-13 19:50 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ingo Molnar, Thomas Gleixner, James Clark, Jiri Olsa, Ian Rogers,
	Adrian Hunter, Kan Liang, Clark Williams, linux-kernel,
	linux-perf-users, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Since these are so far considered part of the basic set of libraries to
be present when building perf, have then in
tools/build/features/test-all.c.

They were already in the FEATURE_TESTS_BASIC variable of
tools/build/Makefile.feature, meaning if test-all.c builds, those
features would be set as present, but then we were calling "again"
(well, they were not in test-all.c, so were not really being tested) for
it to be detected, fix this all up by not calling feature_check for
those features but instead have them in test-all.c to be tested together
with the the set of basic expected libraries.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/feature/test-all.c | 10 ++++++++++
 tools/perf/Makefile.config     |  2 --
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index 80ac297f81967171..691829bc32eb0655 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -166,6 +166,14 @@
 # include "test-libzstd.c"
 #undef main
 
+#define main main_test_libtraceevent
+# include "test-libtraceevent.c"
+#undef main
+
+#define main main_test_libtracefs
+# include "test-libtracefs.c"
+#undef main
+
 int main(int argc, char *argv[])
 {
 	main_test_libpython();
@@ -203,6 +211,8 @@ int main(int argc, char *argv[])
 	main_test_reallocarray();
 	main_test_disassembler_four_args();
 	main_test_libzstd();
+	main_test_liblibtraceevent();
+	main_test_liblibtracefs();
 
 	return 0;
 }
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 0e4f6a860ae25339..37b793b299faae42 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -1187,7 +1187,6 @@ endif
 
 # libtraceevent is a recommended dependency picked up from the system.
 ifneq ($(NO_LIBTRACEEVENT),1)
-  $(call feature_check,libtraceevent)
   ifeq ($(feature-libtraceevent), 1)
     CFLAGS += -DHAVE_LIBTRACEEVENT $(shell $(PKG_CONFIG) --cflags libtraceevent)
     LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libtraceevent)
@@ -1203,7 +1202,6 @@ ifneq ($(NO_LIBTRACEEVENT),1)
     $(error ERROR: libtraceevent is missing. Please install libtraceevent-dev/libtraceevent-devel and/or set LIBTRACEEVENT_DIR or build with NO_LIBTRACEEVENT=1)
   endif
 
-  $(call feature_check,libtracefs)
   ifeq ($(feature-libtracefs), 1)
     CFLAGS +=  $(shell $(PKG_CONFIG) --cflags libtracefs)
     LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libtracefs)
-- 
2.47.0


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

end of thread, other threads:[~2024-12-13 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-13 19:50 [PATCH 0/2 next] tools build feature detection fixes Arnaldo Carvalho de Melo
2024-12-13 19:50 ` [PATCH 1/2] tools build feature: Don't set feature-libslang-include-subdir=1 if test-all.c builds Arnaldo Carvalho de Melo
2024-12-13 19:50 ` [PATCH 2/2] tools build: Test for presence of libtraceevent and libtracefs in test-all.c Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox