aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2012-09-28 13:47:07 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-24 17:30:48 -0400
commitaf3df2cf17f5df079189c3cc88870d28e219496b (patch)
treefc0e6ea775be9bc10e16d2aab31f018f4b027c0c
parent814d7a4d2c33657489f7b45bc0b2dcaa0d88edc0 (diff)
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 <borislav.petkov@amd.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/n/tip-ij71ysszkdvz3fy3wr331bke@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/Documentation/Makefile31
-rw-r--r--tools/perf/Makefile5
-rw-r--r--tools/perf/util/parse-events.c2
3 files changed, 34 insertions, 4 deletions
diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile
index 9f2e44f2b17a..ef6d22e879eb 100644
--- a/tools/perf/Documentation/Makefile
+++ b/tools/perf/Documentation/Makefile
@@ -1,3 +1,5 @@
1include ../config/utilities.mak
2
1OUTPUT := ./ 3OUTPUT := ./
2ifeq ("$(origin O)", "command line") 4ifeq ("$(origin O)", "command line")
3 ifneq ($(O),) 5 ifneq ($(O),)
@@ -64,6 +66,7 @@ MAKEINFO=makeinfo
64INSTALL_INFO=install-info 66INSTALL_INFO=install-info
65DOCBOOK2X_TEXI=docbook2x-texi 67DOCBOOK2X_TEXI=docbook2x-texi
66DBLATEX=dblatex 68DBLATEX=dblatex
69XMLTO=xmlto
67ifndef PERL_PATH 70ifndef PERL_PATH
68 PERL_PATH = /usr/bin/perl 71 PERL_PATH = /usr/bin/perl
69endif 72endif
@@ -71,6 +74,16 @@ endif
71-include ../config.mak.autogen 74-include ../config.mak.autogen
72-include ../config.mak 75-include ../config.mak
73 76
77_tmp_tool_path := $(call get-executable,$(ASCIIDOC))
78ifeq ($(_tmp_tool_path),)
79 missing_tools = $(ASCIIDOC)
80endif
81
82_tmp_tool_path := $(call get-executable,$(XMLTO))
83ifeq ($(_tmp_tool_path),)
84 missing_tools += $(XMLTO)
85endif
86
74# 87#
75# For asciidoc ... 88# For asciidoc ...
76# -7.1.2, no extra settings are needed. 89# -7.1.2, no extra settings are needed.
@@ -170,7 +183,12 @@ pdf: $(OUTPUT)user-manual.pdf
170 183
171install: install-man 184install: install-man
172 185
173install-man: man 186check-man-tools:
187ifdef missing_tools
188 $(error "You need to install $(missing_tools) for man pages")
189endif
190
191do-install-man: man
174 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) 192 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
175# $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir) 193# $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
176# $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir) 194# $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
@@ -178,6 +196,15 @@ install-man: man
178# $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir) 196# $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
179# $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir) 197# $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
180 198
199install-man: check-man-tools man
200
201try-install-man:
202ifdef missing_tools
203 $(warning Please install $(missing_tools) to have the man pages installed)
204else
205 $(MAKE) do-install-man
206endif
207
181install-info: info 208install-info: info
182 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir) 209 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
183 $(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir) 210 $(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir)
@@ -246,7 +273,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt
246 273
247$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml 274$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml
248 $(QUIET_XMLTO)$(RM) $@ && \ 275 $(QUIET_XMLTO)$(RM) $@ && \
249 xmlto -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< 276 $(XMLTO) -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
250 277
251$(OUTPUT)%.xml : %.txt 278$(OUTPUT)%.xml : %.txt
252 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ 279 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 78a81eda1272..b14eeb86d8d7 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -1041,7 +1041,7 @@ perfexec_instdir = $(prefix)/$(perfexecdir)
1041endif 1041endif
1042perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir)) 1042perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
1043 1043
1044install: all 1044install: all try-install-man
1045 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' 1045 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
1046 $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)' 1046 $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
1047 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' 1047 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
@@ -1067,6 +1067,9 @@ install-doc:
1067install-man: 1067install-man:
1068 $(MAKE) -C Documentation install-man 1068 $(MAKE) -C Documentation install-man
1069 1069
1070try-install-man:
1071 $(MAKE) -C Documentation try-install-man
1072
1070install-html: 1073install-html:
1071 $(MAKE) -C Documentation install-html 1074 $(MAKE) -C Documentation install-html
1072 1075
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 2fe15874e46e..3a3efcf3e4e9 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1081,7 +1081,7 @@ void print_events(const char *event_glob, bool name_only)
1081 printf(" %-50s [%s]\n", 1081 printf(" %-50s [%s]\n",
1082 "cpu/t1=v1[,t2=v2,t3 ...]/modifier", 1082 "cpu/t1=v1[,t2=v2,t3 ...]/modifier",
1083 event_type_descriptors[PERF_TYPE_RAW]); 1083 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");
1085 printf("\n"); 1085 printf("\n");
1086 1086
1087 printf(" %-50s [%s]\n", 1087 printf(" %-50s [%s]\n",