@@ -90,25 +90,7 @@ $(MAN1_INSTALL): %.1.install : %.1 force
$(MAN5_INSTALL): %.5.install : %.5 force
$(Q)$(call do_install_data,$<,$(man_dir_SQ)/man5)
-html_dir = $(src)/HTML
-image_dir = $(html_dir)/images
-
-HTML = $(wildcard $(html_dir)/*.html)
-IMGS = $(wildcard $(image_dir)/*.png)
-
-HTML_INSTALL = $(subst .html,.html.install,$(HTML))
-IMGS_INSTALL = $(subst .png,.png.install,$(IMGS))
-
-$(HTML_INSTALL): %.html.install : %.html force
- $(Q)$(call do_install_data,$<,'$(html_install_SQ)')
-
-$(IMGS_INSTALL): %.png.install : %.png force
- $(Q)$(call do_install_data,$<,'$(img_install_SQ)')
-
-
-GUI_INSTALL = $(HTML_INSTALL) $(IMGS_INSTALL)
-
-install: $(MAN1_INSTALL) $(MAN5_INSTALL) $(GUI_INSTALL)
+install: $(MAN1_INSTALL) $(MAN5_INSTALL)
clean:
(cd $(obj); \
@@ -174,7 +174,7 @@ obj := $(objtree)
kshark-dir = $(src)/kernel-shark
-export prefix bindir src obj
+export prefix bindir src obj kshark-dir
LIBS = -ldl
@@ -356,12 +356,19 @@ install_libs: libs
doc:
$(MAKE) -C $(src)/Documentation all
+doc_gui:
+ $(MAKE) -C $(kshark-dir)/doc all
+
doc_clean:
$(MAKE) -C $(src)/Documentation clean
+doc_gui_clean:
+ $(MAKE) -C $(kshark-dir)/doc clean
install_doc:
$(MAKE) -C $(src)/Documentation install
+install_doc_gui:
+ $(MAKE) -C $(kshark-dir)/doc install
clean:
$(RM) *.o *~ *.a *.so .*.d
similarity index 100%
rename from Documentation/HTML/images/kernelshark-logo.svg
rename to kernel-shark/doc/HTML/images/kernelshark-logo.svg
similarity index 100%
rename from Documentation/HTML/images/kernelshark.jpg
rename to kernel-shark/doc/HTML/images/kernelshark.jpg
similarity index 100%
rename from Documentation/HTML/images/kshark-advance-filter-01.png
rename to kernel-shark/doc/HTML/images/kshark-advance-filter-01.png
similarity index 100%
rename from Documentation/HTML/images/kshark-advance-filter-02.png
rename to kernel-shark/doc/HTML/images/kshark-advance-filter-02.png
similarity index 100%
rename from Documentation/HTML/images/kshark-advance-filter-delete.png
rename to kernel-shark/doc/HTML/images/kshark-advance-filter-delete.png
similarity index 100%
rename from Documentation/HTML/images/kshark-advance-filter-ext4-events.png
rename to kernel-shark/doc/HTML/images/kshark-advance-filter-ext4-events.png
similarity index 100%
rename from Documentation/HTML/images/kshark-advance-filter-ext4.png
rename to kernel-shark/doc/HTML/images/kshark-advance-filter-ext4.png
similarity index 100%
rename from Documentation/HTML/images/kshark-event-filter-dialog.png
rename to kernel-shark/doc/HTML/images/kshark-event-filter-dialog.png
similarity index 100%
rename from Documentation/HTML/images/kshark-event-filter.png
rename to kernel-shark/doc/HTML/images/kshark-event-filter.png
similarity index 100%
rename from Documentation/HTML/images/kshark-filter-menu.png
rename to kernel-shark/doc/HTML/images/kshark-filter-menu.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-control-left.png
rename to kernel-shark/doc/HTML/images/kshark-graph-control-left.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-control-line.png
rename to kernel-shark/doc/HTML/images/kshark-graph-control-line.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-control-minus.png
rename to kernel-shark/doc/HTML/images/kshark-graph-control-minus.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-control-minusminus.png
rename to kernel-shark/doc/HTML/images/kshark-graph-control-minusminus.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-control-plus.png
rename to kernel-shark/doc/HTML/images/kshark-graph-control-plus.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-control-plusplus.png
rename to kernel-shark/doc/HTML/images/kshark-graph-control-plusplus.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-control-right.png
rename to kernel-shark/doc/HTML/images/kshark-graph-control-right.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-info-line.png
rename to kernel-shark/doc/HTML/images/kshark-graph-info-line.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-plot-area.png
rename to kernel-shark/doc/HTML/images/kshark-graph-plot-area.png
similarity index 100%
rename from Documentation/HTML/images/kshark-graph-plot-title.png
rename to kernel-shark/doc/HTML/images/kshark-graph-plot-title.png
similarity index 100%
rename from Documentation/HTML/images/kshark-list-adjust.png
rename to kernel-shark/doc/HTML/images/kshark-list-adjust.png
similarity index 100%
rename from Documentation/HTML/images/kshark-list-graph-follow.png
rename to kernel-shark/doc/HTML/images/kshark-list-graph-follow.png
similarity index 100%
rename from Documentation/HTML/images/kshark-list-info-area.png
rename to kernel-shark/doc/HTML/images/kshark-list-info-area.png
similarity index 100%
rename from Documentation/HTML/images/kshark-open.png
rename to kernel-shark/doc/HTML/images/kshark-open.png
similarity index 100%
rename from Documentation/HTML/images/kshark-plot-cpu-1.png
rename to kernel-shark/doc/HTML/images/kshark-plot-cpu-1.png
similarity index 100%
rename from Documentation/HTML/images/kshark-plot-cpu-2.png
rename to kernel-shark/doc/HTML/images/kshark-plot-cpu-2.png
similarity index 100%
rename from Documentation/HTML/images/kshark-plot-cpu-result.png
rename to kernel-shark/doc/HTML/images/kshark-plot-cpu-result.png
similarity index 100%
rename from Documentation/HTML/images/kshark-plot-menu.png
rename to kernel-shark/doc/HTML/images/kshark-plot-menu.png
similarity index 100%
rename from Documentation/HTML/images/kshark-plot-task-measure-preempt.png
rename to kernel-shark/doc/HTML/images/kshark-plot-task-measure-preempt.png
similarity index 100%
rename from Documentation/HTML/images/kshark-plot-task-measure.png
rename to kernel-shark/doc/HTML/images/kshark-plot-task-measure.png
similarity index 100%
rename from Documentation/HTML/images/kshark-plot-task-result.png
rename to kernel-shark/doc/HTML/images/kshark-plot-task-result.png
similarity index 100%
rename from Documentation/HTML/images/kshark-plot-task-select.png
rename to kernel-shark/doc/HTML/images/kshark-plot-task-select.png
similarity index 100%
rename from Documentation/HTML/images/kshark-plot-task-zoom-1.png
rename to kernel-shark/doc/HTML/images/kshark-plot-task-zoom-1.png
similarity index 100%
rename from Documentation/HTML/images/kshark-select-a-1.png
rename to kernel-shark/doc/HTML/images/kshark-select-a-1.png
similarity index 100%
rename from Documentation/HTML/images/kshark-select-b-1.png
rename to kernel-shark/doc/HTML/images/kshark-select-b-1.png
similarity index 100%
rename from Documentation/HTML/images/kshark-task-filter-dialog.png
rename to kernel-shark/doc/HTML/images/kshark-task-filter-dialog.png
similarity index 100%
rename from Documentation/HTML/images/kshark-task-filter.png
rename to kernel-shark/doc/HTML/images/kshark-task-filter.png
similarity index 100%
rename from Documentation/HTML/images/kshark-zoom-in-3.png
rename to kernel-shark/doc/HTML/images/kshark-zoom-in-3.png
similarity index 100%
rename from Documentation/HTML/images/kshark-zoom-in-select.png
rename to kernel-shark/doc/HTML/images/kshark-zoom-in-select.png
similarity index 100%
rename from Documentation/HTML/index.html
rename to kernel-shark/doc/HTML/index.html
new file mode 100644
@@ -0,0 +1,108 @@
+
+obj := $(kshark-dir)/doc
+src := $(kshark-dir)/doc
+
+ifeq ($(VERBOSE),1)
+ Q =
+ print_asciidoc =
+ print_xsltproc =
+ print_install =
+ hide_xsltproc_output =
+else
+ Q = @
+ print_asciidoc = echo ' ASCIIDOC '`basename $@`;
+ print_xsltproc = echo ' XSLTPROC '`basename $@`;
+ print_install = echo ' INSTALL '`basename $1`' to $(DESTDIR_SQ)'$2;
+ hide_xsltproc_output = 2> /dev/null
+endif
+
+define manpage.xsl
+ if [ -z ${MANPAGE_DOCBOOK_XSL} ]; then \
+ echo "*********************************"; \
+ echo "** No docbook.xsl is installed **"; \
+ echo "** Can't make man pages **"; \
+ echo "*********************************"; \
+ exit 1; \
+ fi
+endef
+
+do_asciidoc_build = \
+ ($(print_asciidoc) \
+ asciidoc -d manpage -b docbook -o $@ $<)
+
+do_xsltproc_build = \
+ ($(print_xsltproc) \
+ xsltproc --nonet -o $@ ${MANPAGE_DOCBOOK_XSL} $< $(hide_xsltproc_output))
+
+#
+# asciidoc requires a synopsis, but file format man pages (5) do
+# not require them. This removes it from the file in the final step.
+define remove_synopsis
+ (sed -e '/^\.SH "SYNOPSIS"/,/ignore/d' $1 > $1.tmp;\
+ mv $1.tmp $1)
+endef
+
+#
+# Most likely a docbook.xsl is already installed on the users system
+# instead of creating a new wheel, lets reuse what's already there.
+#
+FIND_MANPAGE_DOCBOOK_XSL := $(shell find /usr -name docbook.xsl 2>/dev/null | grep manpages | head -1)
+
+MANPAGE_DOCBOOK_XSL ?= ${FIND_MANPAGE_DOCBOOK_XSL}
+
+$(obj)/%.xsl: $(src)/%.txt
+ $(Q)mkdir -p $(obj)
+ $(Q)$(do_asciidoc_build)
+
+
+$(obj)/%.1: $(obj)/%.1.xsl
+ @$(call manpage.xsl)
+ $(Q)$(do_xsltproc_build)
+
+TEXT1 = $(wildcard *.1.txt)
+MAN1 = $(patsubst %.1.txt,$(obj)/%.1, ${TEXT1})
+
+all: $(MAN1)
+
+# Need to find out how to export a macro instead of
+# copying this from the main Makefile.
+define do_install_data
+ $(print_install) \
+ if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
+ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
+ fi; \
+ $(INSTALL) -m 644 $1 '$(DESTDIR_SQ)$2'
+endef
+
+
+MAN1_INSTALL = $(MAN1:%.1=%.1.install)
+
+$(MAN1_INSTALL): %.1.install : %.1 force
+ $(Q)$(call do_install_data,$<,$(man_dir_SQ)/man1)
+
+html_dir = $(src)/HTML
+image_dir = $(html_dir)/images
+
+HTML = $(wildcard $(html_dir)/*.html)
+IMGS = $(wildcard $(image_dir)/*.png)
+
+HTML_INSTALL = $(subst .html,.html.install,$(HTML))
+IMGS_INSTALL = $(subst .png,.png.install,$(IMGS))
+
+$(HTML_INSTALL): %.html.install : %.html force
+ $(Q)$(call do_install_data,$<,'$(html_install_SQ)')
+
+$(IMGS_INSTALL): %.png.install : %.png force
+ $(Q)$(call do_install_data,$<,'$(img_install_SQ)')
+
+
+GUI_INSTALL = $(HTML_INSTALL) $(IMGS_INSTALL)
+
+install: $(MAN1_INSTALL) $(GUI_INSTALL)
+
+clean:
+ (cd $(obj); \
+ $(RM) *.xml *.xsl *.1)
+
+.PHONE: force
+force:
similarity index 100%
rename from Documentation/kernelshark.1.txt
rename to kernel-shark/doc/kernelshark.1.txt
KernelShark is going to be a stand alone package, separate from trace-cmd. The code is already in its own directory, but HTML and man page documents are still not separated. All KernelShark related documentation (HTML and the man page) is moved from Documentation/ to kernel-shark/doc/ directory. New targets are added to trace-cmd Makefile: doc_gui - build KernelShrak documentation doc_gui_clean - clean KernelShrak documentation install_doc_gui - install KernelShrak documentation The existing Makefile targets: doc, doc_clean, install_doc are modified to work only with trace-cmd documentation. The new Makefile targets must be used to build and install KernelShark docs. This change was requested by Bas van Dijk <v.dijk.bas@gmail.com>, to simplify packaging trace-cmd and kernelshark for nixpkgs, as two different packages. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- Documentation/Makefile | 20 +--- Makefile | 9 +- .../doc}/HTML/images/kernelshark-logo.svg | 0 .../doc}/HTML/images/kernelshark.jpg | Bin .../HTML/images/kshark-advance-filter-01.png | Bin .../HTML/images/kshark-advance-filter-02.png | Bin .../images/kshark-advance-filter-delete.png | Bin .../kshark-advance-filter-ext4-events.png | Bin .../images/kshark-advance-filter-ext4.png | Bin .../images/kshark-event-filter-dialog.png | Bin .../doc}/HTML/images/kshark-event-filter.png | Bin .../doc}/HTML/images/kshark-filter-menu.png | Bin .../HTML/images/kshark-graph-control-left.png | Bin .../HTML/images/kshark-graph-control-line.png | Bin .../images/kshark-graph-control-minus.png | Bin .../kshark-graph-control-minusminus.png | Bin .../HTML/images/kshark-graph-control-plus.png | Bin .../images/kshark-graph-control-plusplus.png | Bin .../images/kshark-graph-control-right.png | Bin .../HTML/images/kshark-graph-info-line.png | Bin .../HTML/images/kshark-graph-plot-area.png | Bin .../HTML/images/kshark-graph-plot-title.png | Bin .../doc}/HTML/images/kshark-list-adjust.png | Bin .../HTML/images/kshark-list-graph-follow.png | Bin .../HTML/images/kshark-list-info-area.png | Bin .../doc}/HTML/images/kshark-open.png | Bin .../doc}/HTML/images/kshark-plot-cpu-1.png | Bin .../doc}/HTML/images/kshark-plot-cpu-2.png | Bin .../HTML/images/kshark-plot-cpu-result.png | Bin .../doc}/HTML/images/kshark-plot-menu.png | Bin .../kshark-plot-task-measure-preempt.png | Bin .../HTML/images/kshark-plot-task-measure.png | Bin .../HTML/images/kshark-plot-task-result.png | Bin .../HTML/images/kshark-plot-task-select.png | Bin .../HTML/images/kshark-plot-task-zoom-1.png | Bin .../doc}/HTML/images/kshark-select-a-1.png | Bin .../doc}/HTML/images/kshark-select-b-1.png | Bin .../HTML/images/kshark-task-filter-dialog.png | Bin .../doc}/HTML/images/kshark-task-filter.png | Bin .../doc}/HTML/images/kshark-zoom-in-3.png | Bin .../HTML/images/kshark-zoom-in-select.png | Bin .../doc}/HTML/index.html | 0 kernel-shark/doc/Makefile | 108 ++++++++++++++++++ .../doc}/kernelshark.1.txt | 0 44 files changed, 117 insertions(+), 20 deletions(-) rename {Documentation => kernel-shark/doc}/HTML/images/kernelshark-logo.svg (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kernelshark.jpg (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-advance-filter-01.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-advance-filter-02.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-advance-filter-delete.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-advance-filter-ext4-events.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-advance-filter-ext4.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-event-filter-dialog.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-event-filter.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-filter-menu.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-control-left.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-control-line.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-control-minus.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-control-minusminus.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-control-plus.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-control-plusplus.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-control-right.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-info-line.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-plot-area.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-graph-plot-title.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-list-adjust.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-list-graph-follow.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-list-info-area.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-open.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-plot-cpu-1.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-plot-cpu-2.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-plot-cpu-result.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-plot-menu.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-plot-task-measure-preempt.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-plot-task-measure.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-plot-task-result.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-plot-task-select.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-plot-task-zoom-1.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-select-a-1.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-select-b-1.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-task-filter-dialog.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-task-filter.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-zoom-in-3.png (100%) rename {Documentation => kernel-shark/doc}/HTML/images/kshark-zoom-in-select.png (100%) rename {Documentation => kernel-shark/doc}/HTML/index.html (100%) create mode 100644 kernel-shark/doc/Makefile rename {Documentation => kernel-shark/doc}/kernelshark.1.txt (100%)