Skip to content

Commit fe4d0d5

Browse files
Daniel Bristot de Oliveirarostedt
authored andcommitted
rtla/Makefile: Properly handle dependencies
Linus had a problem compiling RTLA, saying: "[...] I wish the tracing tools would do a bit more package checking and helpful error messages too, rather than just fail with: fatal error: tracefs.h: No such file or directory" Which is indeed not a helpful message. Update the Makefile, adding proper checks for the dependencies, with useful information about how to resolve possible problems. For example, the previous error is now reported as: $ make ******************************************** ** NOTICE: libtracefs version 1.3 or higher not found ** ** Consider installing the latest libtracefs from your ** distribution, e.g., 'dnf install libtracefs' on Fedora, ** or from source: ** ** https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ ** ******************************************** These messages are inspired by the ones used on trace-cmd, as suggested by Stevel Rostedt. Link: https://lore.kernel.org/r/CAHk-=whxmA86E=csNv76DuxX_wYsg8mW15oUs3XTabu2Yc80yw@mail.gmail.com/ Changes from V1: - Moved the rst2man check to the install phase (when it is used). - Removed the procps-ng lib check [1] as it is being removed. [1] a0f9f8c1030c66305c9b921057c3d483064d5529.1651220820.git.bristot@kernel.org Link: https://lkml.kernel.org/r/3f1fac776c37e4b67c876a94e5a0e45ed022ff3d.1651238057.git.bristot@kernel.org Cc: Ingo Molnar <mingo@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent ce522ba commit fe4d0d5

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

Documentation/tools/rtla/Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,21 @@ DOC_MAN1 = $(addprefix $(OUTPUT),$(_DOC_MAN1))
1717
RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
1818
RST2MAN_OPTS += --verbose
1919

20+
TEST_RST2MAN = $(shell sh -c "rst2man --version > /dev/null 2>&1 || echo n")
21+
2022
$(OUTPUT)%.1: %.rst
2123
ifndef RST2MAN_DEP
22-
$(error "rst2man not found, but required to generate man pages")
24+
$(info ********************************************)
25+
$(info ** NOTICE: rst2man not found)
26+
$(info **)
27+
$(info ** Consider installing the latest rst2man from your)
28+
$(info ** distribution, e.g., 'dnf install python3-docutils' on Fedora,)
29+
$(info ** or from source:)
30+
$(info **)
31+
$(info ** https://docutils.sourceforge.io/docs/dev/repository.html )
32+
$(info **)
33+
$(info ********************************************)
34+
$(error NOTICE: rst2man required to generate man pages)
2335
endif
2436
rst2man $(RST2MAN_OPTS) $< > $@
2537

tools/tracing/rtla/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,41 @@ else
5757
DOCSRC = $(SRCTREE)/../../../Documentation/tools/rtla/
5858
endif
5959

60+
LIBTRACEEVENT_MIN_VERSION = 1.5
61+
LIBTRACEFS_MIN_VERSION = 1.3
62+
63+
TEST_LIBTRACEEVENT = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_MIN_VERSION) libtraceevent > /dev/null 2>&1 || echo n")
64+
ifeq ("$(TEST_LIBTRACEEVENT)", "n")
65+
.PHONY: warning_traceevent
66+
warning_traceevent:
67+
@echo "********************************************"
68+
@echo "** NOTICE: libtraceevent version $(LIBTRACEEVENT_MIN_VERSION) or higher not found"
69+
@echo "**"
70+
@echo "** Consider installing the latest libtraceevent from your"
71+
@echo "** distribution, e.g., 'dnf install libtraceevent' on Fedora,"
72+
@echo "** or from source:"
73+
@echo "**"
74+
@echo "** https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ "
75+
@echo "**"
76+
@echo "********************************************"
77+
endif
78+
79+
TEST_LIBTRACEFS = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_MIN_VERSION) libtracefs > /dev/null 2>&1 || echo n")
80+
ifeq ("$(TEST_LIBTRACEFS)", "n")
81+
.PHONY: warning_tracefs
82+
warning_tracefs:
83+
@echo "********************************************"
84+
@echo "** NOTICE: libtracefs version $(LIBTRACEFS_MIN_VERSION) or higher not found"
85+
@echo "**"
86+
@echo "** Consider installing the latest libtracefs from your"
87+
@echo "** distribution, e.g., 'dnf install libtracefs' on Fedora,"
88+
@echo "** or from source:"
89+
@echo "**"
90+
@echo "** https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ "
91+
@echo "**"
92+
@echo "********************************************"
93+
endif
94+
6095
.PHONY: all
6196
all: rtla
6297

0 commit comments

Comments
 (0)