Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtla: Add Documentation

Adds the basis for rtla documentation. This patch also
includes the rtla(1) man page.

As suggested by Jonathan Corbet, we are placing these man
pages at Documentation/tools/rtla, using rst format. It
is not linked to the official documentation, though.

The Makefile is based on bpftool's Documentation one.

Link: https://lkml.kernel.org/r/5f510f3e962fc0cd531c43f5a815544dd720c3f2.1639158831.git.bristot@kernel.org

Cc: Tao Zhou <tao.zhou@linux.dev>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: linux-rt-users@vger.kernel.org
Cc: linux-trace-devel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

authored by

Daniel Bristot de Oliveira and committed by
Steven Rostedt
d40d48e1 1eeb6328

+127 -4
+41
Documentation/tools/rtla/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + # Based on bpftool's Documentation Makefile 3 + 4 + INSTALL ?= install 5 + RM ?= rm -f 6 + RMDIR ?= rmdir --ignore-fail-on-non-empty 7 + 8 + PREFIX ?= /usr/share 9 + MANDIR ?= $(PREFIX)/man 10 + MAN1DIR = $(MANDIR)/man1 11 + 12 + MAN1_RST = $(wildcard rtla*.rst) 13 + 14 + _DOC_MAN1 = $(patsubst %.rst,%.1,$(MAN1_RST)) 15 + DOC_MAN1 = $(addprefix $(OUTPUT),$(_DOC_MAN1)) 16 + 17 + RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null) 18 + RST2MAN_OPTS += --verbose 19 + 20 + $(OUTPUT)%.1: %.rst 21 + ifndef RST2MAN_DEP 22 + $(error "rst2man not found, but required to generate man pages") 23 + endif 24 + rst2man $(RST2MAN_OPTS) $< > $@ 25 + 26 + man1: $(DOC_MAN1) 27 + man: man1 28 + 29 + clean: 30 + $(RM) $(DOC_MAN1) 31 + 32 + install: man 33 + $(INSTALL) -d -m 755 $(DESTDIR)$(MAN1DIR) 34 + $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(MAN1DIR) 35 + 36 + uninstall: 37 + $(RM) $(addprefix $(DESTDIR)$(MAN1DIR)/,$(_DOC_MAN1)) 38 + $(RMDIR) $(DESTDIR)$(MAN1DIR) 39 + 40 + .PHONY: man man1 clean install uninstall 41 + .DEFAULT_GOAL := man
+12
Documentation/tools/rtla/common_appendix.rst
··· 1 + REPORTING BUGS 2 + ============== 3 + Report bugs to <lkml@vger.kernel.org> 4 + 5 + LICENSE 6 + ======= 7 + **rtla** is Free Software licensed under the GNU GPLv2 8 + 9 + COPYING 10 + ======= 11 + Copyright \(C) 2021 Red Hat, Inc. Free use of this software is granted under 12 + the terms of the GNU Public License (GPL).
+48
Documentation/tools/rtla/rtla.rst
··· 1 + ========= 2 + rtla 3 + ========= 4 + -------------------------------- 5 + Real-time Linux Analysis tool 6 + -------------------------------- 7 + 8 + :Manual section: 1 9 + 10 + SYNOPSIS 11 + ======== 12 + **rtla** *COMMAND* [*OPTIONS*] 13 + 14 + DESCRIPTION 15 + =========== 16 + The **rtla** is a meta-tool that includes a set of commands that aims to 17 + analyze the real-time properties of Linux. But instead of testing Linux 18 + as a black box, **rtla** leverages kernel tracing capabilities to provide 19 + precise information about the properties and root causes of unexpected 20 + results. 21 + 22 + COMMANDS 23 + ======== 24 + **osnoise** 25 + 26 + Gives information about the operating system noise (osnoise). 27 + 28 + **timerlat** 29 + 30 + Measures the IRQ and thread timer latency. 31 + 32 + OPTIONS 33 + ======= 34 + **-h**, **--help** 35 + 36 + Display the help text. 37 + 38 + For other options, see the man page for the corresponding command. 39 + 40 + SEE ALSO 41 + ======== 42 + **rtla-osnoise**\(1), **rtla-timerlat**\(1) 43 + 44 + AUTHOR 45 + ====== 46 + Daniel Bristot de Oliveira <bristot@kernel.org> 47 + 48 + .. include:: common_appendix.rst
+26 -4
tools/tracing/rtla/Makefile
··· 45 45 DOCDIR := $(DATADIR)/doc 46 46 MANDIR := $(DATADIR)/man 47 47 LICDIR := $(DATADIR)/licenses 48 + SRCTREE := $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)) 49 + 50 + # If running from the tarball, man pages are stored in the Documentation 51 + # dir. If running from the kernel source, man pages are stored in 52 + # Documentation/tools/rtla/. 53 + ifneq ($(wildcard Documentation/.*),) 54 + DOCSRC = Documentation/ 55 + else 56 + DOCSRC = $(SRCTREE)/../../../Documentation/tools/rtla/ 57 + endif 48 58 49 59 .PHONY: all 50 60 all: rtla 51 61 52 - rtla: $(OBJ) 62 + rtla: $(OBJ) doc 53 63 $(CC) -o rtla $(LDFLAGS) $(OBJ) $(LIBS) 54 64 55 65 static: $(OBJ) 56 66 $(CC) -o rtla-static $(LDFLAGS) --static $(OBJ) $(LIBS) -lpthread -ldl 57 67 58 68 .PHONY: install 59 - install: 69 + install: doc_install 60 70 $(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR) 61 71 $(INSTALL) rtla -m 755 $(DESTDIR)$(BINDIR) 62 72 $(STRIP) $(DESTDIR)$(BINDIR)/rtla ··· 76 66 ln -s $(DESTDIR)$(BINDIR)/rtla $(DESTDIR)$(BINDIR)/timerlat 77 67 78 68 .PHONY: clean tarball 79 - clean: 69 + clean: doc_clean 80 70 @test ! -f rtla || rm rtla 81 71 @test ! -f rtla-static || rm rtla-static 82 72 @test ! -f src/rtla.o || rm src/rtla.o 83 73 @test ! -f $(TARBALL) || rm -f $(TARBALL) 84 74 @rm -rf *~ $(OBJ) *.tar.$(CEXT) 85 75 86 - tarball: clean 76 + tarball: clean 87 77 rm -rf $(NAME)-$(VERSION) && mkdir $(NAME)-$(VERSION) 88 78 cp -r $(DIRS) $(FILES) $(NAME)-$(VERSION) 79 + mkdir $(NAME)-$(VERSION)/Documentation/ 80 + cp -rp $(SRCTREE)/../../../Documentation/tools/rtla/* $(NAME)-$(VERSION)/Documentation/ 89 81 tar $(TAROPTS) --exclude='*~' $(NAME)-$(VERSION) 90 82 rm -rf $(NAME)-$(VERSION) 83 + 84 + .PHONY: doc doc_clean doc_install 85 + doc: 86 + $(MAKE) -C $(DOCSRC) 87 + 88 + doc_clean: 89 + $(MAKE) -C $(DOCSRC) clean 90 + 91 + doc_install: 92 + $(MAKE) -C $(DOCSRC) install