Commit af3df2cf authored by Borislav Petkov's avatar Borislav Petkov Committed by Arnaldo Carvalho de Melo

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: default avatarBorislav Petkov <borislav.petkov@amd.com>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-ij71ysszkdvz3fy3wr331bke@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 814d7a4d
include ../config/utilities.mak
OUTPUT := ./ OUTPUT := ./
ifeq ("$(origin O)", "command line") ifeq ("$(origin O)", "command line")
ifneq ($(O),) ifneq ($(O),)
...@@ -64,6 +66,7 @@ MAKEINFO=makeinfo ...@@ -64,6 +66,7 @@ MAKEINFO=makeinfo
INSTALL_INFO=install-info INSTALL_INFO=install-info
DOCBOOK2X_TEXI=docbook2x-texi DOCBOOK2X_TEXI=docbook2x-texi
DBLATEX=dblatex DBLATEX=dblatex
XMLTO=xmlto
ifndef PERL_PATH ifndef PERL_PATH
PERL_PATH = /usr/bin/perl PERL_PATH = /usr/bin/perl
endif endif
...@@ -71,6 +74,16 @@ endif ...@@ -71,6 +74,16 @@ endif
-include ../config.mak.autogen -include ../config.mak.autogen
-include ../config.mak -include ../config.mak
_tmp_tool_path := $(call get-executable,$(ASCIIDOC))
ifeq ($(_tmp_tool_path),)
missing_tools = $(ASCIIDOC)
endif
_tmp_tool_path := $(call get-executable,$(XMLTO))
ifeq ($(_tmp_tool_path),)
missing_tools += $(XMLTO)
endif
# #
# For asciidoc ... # For asciidoc ...
# -7.1.2, no extra settings are needed. # -7.1.2, no extra settings are needed.
...@@ -170,7 +183,12 @@ pdf: $(OUTPUT)user-manual.pdf ...@@ -170,7 +183,12 @@ pdf: $(OUTPUT)user-manual.pdf
install: install-man install: install-man
install-man: man check-man-tools:
ifdef missing_tools
$(error "You need to install $(missing_tools) for man pages")
endif
do-install-man: man
$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
# $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir) # $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
# $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir) # $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
...@@ -178,6 +196,15 @@ install-man: man ...@@ -178,6 +196,15 @@ install-man: man
# $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir) # $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
# $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir) # $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
install-man: check-man-tools man
try-install-man:
ifdef missing_tools
$(warning Please install $(missing_tools) to have the man pages installed)
else
$(MAKE) do-install-man
endif
install-info: info install-info: info
$(INSTALL) -d -m 755 $(DESTDIR)$(infodir) $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
$(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir) $(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir)
...@@ -246,7 +273,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt ...@@ -246,7 +273,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt
$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml
$(QUIET_XMLTO)$(RM) $@ && \ $(QUIET_XMLTO)$(RM) $@ && \
xmlto -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< $(XMLTO) -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
$(OUTPUT)%.xml : %.txt $(OUTPUT)%.xml : %.txt
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
......
...@@ -1041,7 +1041,7 @@ perfexec_instdir = $(prefix)/$(perfexecdir) ...@@ -1041,7 +1041,7 @@ perfexec_instdir = $(prefix)/$(perfexecdir)
endif endif
perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir)) perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
install: all install: all try-install-man
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)' $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
...@@ -1067,6 +1067,9 @@ install-doc: ...@@ -1067,6 +1067,9 @@ install-doc:
install-man: install-man:
$(MAKE) -C Documentation install-man $(MAKE) -C Documentation install-man
try-install-man:
$(MAKE) -C Documentation try-install-man
install-html: install-html:
$(MAKE) -C Documentation install-html $(MAKE) -C Documentation install-html
......
...@@ -1081,7 +1081,7 @@ void print_events(const char *event_glob, bool name_only) ...@@ -1081,7 +1081,7 @@ void print_events(const char *event_glob, bool name_only)
printf(" %-50s [%s]\n", printf(" %-50s [%s]\n",
"cpu/t1=v1[,t2=v2,t3 ...]/modifier", "cpu/t1=v1[,t2=v2,t3 ...]/modifier",
event_type_descriptors[PERF_TYPE_RAW]); event_type_descriptors[PERF_TYPE_RAW]);
printf(" (see 'perf list --help' on how to encode it)\n"); printf(" (see 'man perf-list' on how to encode it)\n");
printf("\n"); printf("\n");
printf(" %-50s [%s]\n", printf(" %-50s [%s]\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment