Skip to content

Commit 0de277d

Browse files
committed
Merge tag 'trace-rtla-v6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull rtla tool fixes from Steven Rostedt: "Fixes for the Real-Time Linux Analysis tooling: - Fix tracer name in comments and prints - Fix setting up symlinks - Allow extra flags to be set in build - Consolidate and show all necessary libraries not found in build error" * tag 'trace-rtla-v6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: rtla: Consolidate and show all necessary libraries that failed for building tools/rtla: Build with EXTRA_{C,LD}FLAGS tools/rtla: Fix command symlinks rtla: Fix tracer name
2 parents 573ae4f + 20aec89 commit 0de277d

File tree

4 files changed

+43
-33
lines changed

4 files changed

+43
-33
lines changed

Documentation/tools/rtla/rtla-timerlat-hist.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ EXAMPLE
3333
=======
3434
In the example below, **rtla timerlat hist** is set to run for *10* minutes,
3535
in the cpus *0-4*, *skipping zero* only lines. Moreover, **rtla timerlat
36-
hist** will change the priority of the *timelat* threads to run under
36+
hist** will change the priority of the *timerlat* threads to run under
3737
*SCHED_DEADLINE* priority, with a *10us* runtime every *1ms* period. The
3838
*1ms* period is also passed to the *timerlat* tracer::
3939

tools/tracing/rtla/Makefile

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ WOPTS := -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_A
3030

3131
TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs)
3232

33-
CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS)
34-
LDFLAGS := -ggdb
33+
CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS)
34+
LDFLAGS := -ggdb $(EXTRA_LDFLAGS)
3535
LIBS := $$($(PKG_CONFIG) --libs libtracefs)
3636

3737
SRC := $(wildcard src/*.c)
@@ -61,40 +61,50 @@ endif
6161
LIBTRACEEVENT_MIN_VERSION = 1.5
6262
LIBTRACEFS_MIN_VERSION = 1.3
6363

64+
.PHONY: all warnings show_warnings
65+
all: warnings rtla
66+
6467
TEST_LIBTRACEEVENT = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_MIN_VERSION) libtraceevent > /dev/null 2>&1 || echo n")
6568
ifeq ("$(TEST_LIBTRACEEVENT)", "n")
66-
.PHONY: warning_traceevent
67-
warning_traceevent:
68-
@echo "********************************************"
69-
@echo "** NOTICE: libtraceevent version $(LIBTRACEEVENT_MIN_VERSION) or higher not found"
70-
@echo "**"
71-
@echo "** Consider installing the latest libtraceevent from your"
72-
@echo "** distribution, e.g., 'dnf install libtraceevent' on Fedora,"
73-
@echo "** or from source:"
74-
@echo "**"
75-
@echo "** https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ "
76-
@echo "**"
77-
@echo "********************************************"
69+
WARNINGS = show_warnings
70+
MISSING_LIBS += echo "** libtraceevent version $(LIBTRACEEVENT_MIN_VERSION) or higher";
71+
MISSING_PACKAGES += "libtraceevent-devel"
72+
MISSING_SOURCE += echo "** https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ ";
7873
endif
7974

8075
TEST_LIBTRACEFS = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_MIN_VERSION) libtracefs > /dev/null 2>&1 || echo n")
8176
ifeq ("$(TEST_LIBTRACEFS)", "n")
82-
.PHONY: warning_tracefs
83-
warning_tracefs:
84-
@echo "********************************************"
85-
@echo "** NOTICE: libtracefs version $(LIBTRACEFS_MIN_VERSION) or higher not found"
86-
@echo "**"
87-
@echo "** Consider installing the latest libtracefs from your"
88-
@echo "** distribution, e.g., 'dnf install libtracefs' on Fedora,"
89-
@echo "** or from source:"
90-
@echo "**"
91-
@echo "** https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ "
92-
@echo "**"
93-
@echo "********************************************"
77+
WARNINGS = show_warnings
78+
MISSING_LIBS += echo "** libtracefs version $(LIBTRACEFS_MIN_VERSION) or higher";
79+
MISSING_PACKAGES += "libtracefs-devel"
80+
MISSING_SOURCE += echo "** https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ ";
9481
endif
9582

96-
.PHONY: all
97-
all: rtla
83+
define show_dependencies
84+
@echo "********************************************"; \
85+
echo "** NOTICE: Failed build dependencies"; \
86+
echo "**"; \
87+
echo "** Required Libraries:"; \
88+
$(MISSING_LIBS) \
89+
echo "**"; \
90+
echo "** Consider installing the latest libtracefs from your"; \
91+
echo "** distribution, e.g., 'dnf install $(MISSING_PACKAGES)' on Fedora,"; \
92+
echo "** or from source:"; \
93+
echo "**"; \
94+
$(MISSING_SOURCE) \
95+
echo "**"; \
96+
echo "********************************************"
97+
endef
98+
99+
show_warnings:
100+
$(call show_dependencies);
101+
102+
ifneq ("$(WARNINGS)", "")
103+
ERROR_OUT = $(error Please add the necessary dependencies)
104+
105+
warnings: $(WARNINGS)
106+
$(ERROR_OUT)
107+
endif
98108

99109
rtla: $(OBJ)
100110
$(CC) -o rtla $(LDFLAGS) $(OBJ) $(LIBS)
@@ -108,9 +118,9 @@ install: doc_install
108118
$(INSTALL) rtla -m 755 $(DESTDIR)$(BINDIR)
109119
$(STRIP) $(DESTDIR)$(BINDIR)/rtla
110120
@test ! -f $(DESTDIR)$(BINDIR)/osnoise || rm $(DESTDIR)$(BINDIR)/osnoise
111-
ln -s $(DESTDIR)$(BINDIR)/rtla $(DESTDIR)$(BINDIR)/osnoise
121+
ln -s rtla $(DESTDIR)$(BINDIR)/osnoise
112122
@test ! -f $(DESTDIR)$(BINDIR)/timerlat || rm $(DESTDIR)$(BINDIR)/timerlat
113-
ln -s $(DESTDIR)$(BINDIR)/rtla $(DESTDIR)$(BINDIR)/timerlat
123+
ln -s rtla $(DESTDIR)$(BINDIR)/timerlat
114124

115125
.PHONY: clean tarball
116126
clean: doc_clean

tools/tracing/rtla/src/timerlat_hist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ int timerlat_hist_main(int argc, char *argv[])
892892
return_value = 0;
893893

894894
if (trace_is_off(&tool->trace, &record->trace)) {
895-
printf("rtla timelat hit stop tracing\n");
895+
printf("rtla timerlat hit stop tracing\n");
896896
if (params->trace_output) {
897897
printf(" Saving trace to %s\n", params->trace_output);
898898
save_trace_to_file(record->trace.inst, params->trace_output);

tools/tracing/rtla/src/timerlat_top.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ int timerlat_top_main(int argc, char *argv[])
687687
return_value = 0;
688688

689689
if (trace_is_off(&top->trace, &record->trace)) {
690-
printf("rtla timelat hit stop tracing\n");
690+
printf("rtla timerlat hit stop tracing\n");
691691
if (params->trace_output) {
692692
printf(" Saving trace to %s\n", params->trace_output);
693693
save_trace_to_file(record->trace.inst, params->trace_output);

0 commit comments

Comments
 (0)