Skip to content

Commit d40d48e

Browse files
Daniel Bristot de Oliveirarostedt
authored andcommitted
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 <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Tom Zanussi <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Clark Williams <[email protected]> Cc: John Kacur <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Cc: Daniel Bristot de Oliveira <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Suggested-by: Steven Rostedt <[email protected]> Suggested-by: Jonathan Corbet <[email protected]> Signed-off-by: Daniel Bristot de Oliveira <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 1eeb632 commit d40d48e

File tree

4 files changed

+127
-4
lines changed

4 files changed

+127
-4
lines changed

Documentation/tools/rtla/Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
REPORTING BUGS
2+
==============
3+
Report bugs to <[email protected]>
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).

Documentation/tools/rtla/rtla.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 <[email protected]>
47+
48+
.. include:: common_appendix.rst

tools/tracing/rtla/Makefile

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,28 @@ DATADIR := /usr/share
4545
DOCDIR := $(DATADIR)/doc
4646
MANDIR := $(DATADIR)/man
4747
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
4858

4959
.PHONY: all
5060
all: rtla
5161

52-
rtla: $(OBJ)
62+
rtla: $(OBJ) doc
5363
$(CC) -o rtla $(LDFLAGS) $(OBJ) $(LIBS)
5464

5565
static: $(OBJ)
5666
$(CC) -o rtla-static $(LDFLAGS) --static $(OBJ) $(LIBS) -lpthread -ldl
5767

5868
.PHONY: install
59-
install:
69+
install: doc_install
6070
$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)
6171
$(INSTALL) rtla -m 755 $(DESTDIR)$(BINDIR)
6272
$(STRIP) $(DESTDIR)$(BINDIR)/rtla
@@ -66,15 +76,27 @@ install:
6676
ln -s $(DESTDIR)$(BINDIR)/rtla $(DESTDIR)$(BINDIR)/timerlat
6777

6878
.PHONY: clean tarball
69-
clean:
79+
clean: doc_clean
7080
@test ! -f rtla || rm rtla
7181
@test ! -f rtla-static || rm rtla-static
7282
@test ! -f src/rtla.o || rm src/rtla.o
7383
@test ! -f $(TARBALL) || rm -f $(TARBALL)
7484
@rm -rf *~ $(OBJ) *.tar.$(CEXT)
7585

76-
tarball: clean
86+
tarball: clean
7787
rm -rf $(NAME)-$(VERSION) && mkdir $(NAME)-$(VERSION)
7888
cp -r $(DIRS) $(FILES) $(NAME)-$(VERSION)
89+
mkdir $(NAME)-$(VERSION)/Documentation/
90+
cp -rp $(SRCTREE)/../../../Documentation/tools/rtla/* $(NAME)-$(VERSION)/Documentation/
7991
tar $(TAROPTS) --exclude='*~' $(NAME)-$(VERSION)
8092
rm -rf $(NAME)-$(VERSION)
93+
94+
.PHONY: doc doc_clean doc_install
95+
doc:
96+
$(MAKE) -C $(DOCSRC)
97+
98+
doc_clean:
99+
$(MAKE) -C $(DOCSRC) clean
100+
101+
doc_install:
102+
$(MAKE) -C $(DOCSRC) install

0 commit comments

Comments
 (0)