Skip to content

Commit af3df2c

Browse files
Borislav Petkovacmel
authored andcommitted
perf tools: Try to build Documentation when installing
There's a portion in the "perf list" output refering to the exact specification of raw hardware events. Since this description is in the perf-list manpage, try to build and install the man pages, warning the user when that is not possible due to missing packages (xmlto and asciidoc). Signed-off-by: Borislav Petkov <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Namhyung Kim <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 814d7a4 commit af3df2c

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

tools/perf/Documentation/Makefile

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include ../config/utilities.mak
2+
13
OUTPUT := ./
24
ifeq ("$(origin O)", "command line")
35
ifneq ($(O),)
@@ -64,13 +66,24 @@ MAKEINFO=makeinfo
6466
INSTALL_INFO=install-info
6567
DOCBOOK2X_TEXI=docbook2x-texi
6668
DBLATEX=dblatex
69+
XMLTO=xmlto
6770
ifndef PERL_PATH
6871
PERL_PATH = /usr/bin/perl
6972
endif
7073

7174
-include ../config.mak.autogen
7275
-include ../config.mak
7376

77+
_tmp_tool_path := $(call get-executable,$(ASCIIDOC))
78+
ifeq ($(_tmp_tool_path),)
79+
missing_tools = $(ASCIIDOC)
80+
endif
81+
82+
_tmp_tool_path := $(call get-executable,$(XMLTO))
83+
ifeq ($(_tmp_tool_path),)
84+
missing_tools += $(XMLTO)
85+
endif
86+
7487
#
7588
# For asciidoc ...
7689
# -7.1.2, no extra settings are needed.
@@ -170,14 +183,28 @@ pdf: $(OUTPUT)user-manual.pdf
170183

171184
install: install-man
172185

173-
install-man: man
186+
check-man-tools:
187+
ifdef missing_tools
188+
$(error "You need to install $(missing_tools) for man pages")
189+
endif
190+
191+
do-install-man: man
174192
$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
175193
# $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
176194
# $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
177195
$(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
178196
# $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
179197
# $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
180198

199+
install-man: check-man-tools man
200+
201+
try-install-man:
202+
ifdef missing_tools
203+
$(warning Please install $(missing_tools) to have the man pages installed)
204+
else
205+
$(MAKE) do-install-man
206+
endif
207+
181208
install-info: info
182209
$(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
183210
$(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir)
@@ -246,7 +273,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt
246273

247274
$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml
248275
$(QUIET_XMLTO)$(RM) $@ && \
249-
xmlto -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
276+
$(XMLTO) -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
250277

251278
$(OUTPUT)%.xml : %.txt
252279
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \

tools/perf/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ perfexec_instdir = $(prefix)/$(perfexecdir)
10411041
endif
10421042
perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
10431043

1044-
install: all
1044+
install: all try-install-man
10451045
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
10461046
$(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
10471047
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
@@ -1067,6 +1067,9 @@ install-doc:
10671067
install-man:
10681068
$(MAKE) -C Documentation install-man
10691069

1070+
try-install-man:
1071+
$(MAKE) -C Documentation try-install-man
1072+
10701073
install-html:
10711074
$(MAKE) -C Documentation install-html
10721075

tools/perf/util/parse-events.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ void print_events(const char *event_glob, bool name_only)
10811081
printf(" %-50s [%s]\n",
10821082
"cpu/t1=v1[,t2=v2,t3 ...]/modifier",
10831083
event_type_descriptors[PERF_TYPE_RAW]);
1084-
printf(" (see 'perf list --help' on how to encode it)\n");
1084+
printf(" (see 'man perf-list' on how to encode it)\n");
10851085
printf("\n");
10861086

10871087
printf(" %-50s [%s]\n",

0 commit comments

Comments
 (0)