Skip to contentSkip to conversation

tools build: Don't assume libtracefs-devel is always available

PATCH Superseded Arnaldo Carvalho de Melo 3 participants 4 messages Oct 2, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools build: Don't assume libtracefs-devel is always available

perf doesn't use libtracefs and so it doesn't make sense to assume it is always available when building test-all.bin, defeating the feature check speedup it provides.

The other tools/build/ users such as rtla, rv, etc call $(feature_check libtracefs) to check its availability instead of using the test-all.bin mechanism, stopping the build and asking for libtracefs-devel to be installed.

Noticed after applying Ian Roger's removal unused libtracefs configuration in tools/perf/.

Cc Adrian Hunter <[email protected]>
Cc Gabriele Monaco <[email protected]>
Cc Ian Rogers <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kan Liang <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Tomas Glozar <[email protected]>
---
 tools/build/feature/test-all.c | 5 -----
 1 file changed, 5 deletions(-)
tools/build/feature/test-all.c +0 -5
index e1847db6f8e63750..2df593593b6ec15e 100644
@@ -150,10 +150,6 @@
 # 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();
@@ -187,7 +183,6 @@ int main(int argc, char *argv[])
 	main_test_reallocarray();
 	main_test_libzstd();
 	main_test_libtraceevent();
-	main_test_libtracefs();
 
 	return 0;
 }
Signature · 1 line
2.49.0
Acked-by on v1 1/1
#1 lore raw

čt 2. 10. 2025 v 15:05 odesílatel Arnaldo Carvalho de Melo <[email protected]> napsal:

Quoted 13 lines

perf doesn't use libtracefs and so it doesn't make sense to assume it is always available when building test-all.bin, defeating the feature check speedup it provides.

The other tools/build/ users such as rtla, rv, etc call $(feature_check libtracefs) to check its availability instead of using the test-all.bin mechanism, stopping the build and asking for libtracefs-devel to be installed.

Noticed after applying Ian Roger's removal unused libtracefs configuration in tools/perf/.

Quoted 10 lines
Cc Adrian Hunter <[email protected]>
Cc Gabriele Monaco <[email protected]>
Cc Ian Rogers <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kan Liang <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Tomas Glozar <[email protected]>

Perhaps it would also make sense to clarify in a comment that test-all.c is to speed up perf build rather than rv, rtla etc. (which don't use most of the dependencies listed there)?

Tomas

#2 lore raw
Quoted 27 lines · Tomas Glozar

čt 2. 10. 2025 v 15:05 odesílatel Arnaldo Carvalho de Melo <[email protected]> napsal:

Quoted 13 lines

perf doesn't use libtracefs and so it doesn't make sense to assume it is always available when building test-all.bin, defeating the feature check speedup it provides.

The other tools/build/ users such as rtla, rv, etc call $(feature_check libtracefs) to check its availability instead of using the test-all.bin mechanism, stopping the build and asking for libtracefs-devel to be installed.

Noticed after applying Ian Roger's removal unused libtracefs configuration in tools/perf/.

Quoted 10 lines
Cc Adrian Hunter <[email protected]>
Cc Gabriele Monaco <[email protected]>
Cc Ian Rogers <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kan Liang <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Tomas Glozar <[email protected]>
Quoted 5 lines

Perhaps it would also make sense to clarify in a comment that test-all.c is to speed up perf build rather than rv, rtla etc. (which don't use most of the dependencies listed there)?

There's a big comment in Makefile.feature:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/build/Makefile.feature#n24
I think that FEATURE_TESTS_BASIC tests are covered by test-all.c so I think this change needs to remove libtracefs from FEATURE_TESTS_BASIC otherwise $(feature-libtracefs) will evaluate to 1 even though no libtracefs testing has been performed. We can't just remove the tracefs feature test as there are dependencies in rv, rtla, etc.

Thanks,
Ian

#3 lore raw
Quoted 34 lines · Ian Rogers
Quoted 27 lines · Tomas Glozar

čt 2. 10. 2025 v 15:05 odesílatel Arnaldo Carvalho de Melo <[email protected]> napsal:

Quoted 13 lines

perf doesn't use libtracefs and so it doesn't make sense to assume it is always available when building test-all.bin, defeating the feature check speedup it provides.

The other tools/build/ users such as rtla, rv, etc call $(feature_check libtracefs) to check its availability instead of using the test-all.bin mechanism, stopping the build and asking for libtracefs-devel to be installed.

Noticed after applying Ian Roger's removal unused libtracefs configuration in tools/perf/.

Quoted 10 lines
Cc Adrian Hunter <[email protected]>
Cc Gabriele Monaco <[email protected]>
Cc Ian Rogers <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Kan Liang <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Tomas Glozar <[email protected]>
Quoted 5 lines

Perhaps it would also make sense to clarify in a comment that test-all.c is to speed up perf build rather than rv, rtla etc. (which don't use most of the dependencies listed there)?

Quoted 6 lines

There's a big comment in Makefile.feature:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/build/Makefile.feature#n24
I think that FEATURE_TESTS_BASIC tests are covered by test-all.c so I think this change needs to remove libtracefs from FEATURE_TESTS_BASIC otherwise $(feature-libtracefs) will evaluate to 1 even though no libtracefs testing has been performed.

Done, thanks for catching this.

Quoted 2 lines

We can't just remove the tracefs feature test as there are dependencies in rv, rtla, etc.

And those, as noted, don't rely on test-all.bin to detect the presence of libtracefs:

⬢ [acme@toolbx perf-tools-next]$ git grep feature.*libtracefs tools/ tools/tracing/latency/Makefile.config:$(call feature_check,libtracefs) tools/tracing/latency/Makefile.config:ifeq ($(feature-libtracefs), 1) tools/tracing/rtla/Makefile.config:$(call feature_check,libtracefs) tools/tracing/rtla/Makefile.config:ifeq ($(feature-libtracefs), 1) tools/verification/rv/Makefile.config:$(call feature_check,libtracefs) tools/verification/rv/Makefile.config:ifeq ($(feature-libtracefs), 1) ⬢ [acme@toolbx perf-tools-next]$

Can I have your Reviewed-by or Acked-by?

Thanks,

- Arnaldo