diff options
author | Ben Hutchings <benh@debian.org> | 2022-07-16 15:07:32 +0200 |
---|---|---|
committer | Ben Hutchings <benh@debian.org> | 2022-07-16 16:01:38 +0200 |
commit | 04d4869fd16e0c1be9d6c8a9778176a491670227 (patch) | |
tree | 2a1aa3f606d0d31a072136061d8e7842132204d1 | |
parent | 0efe6e5c1f30ddba91b6c6863fd102a55b2aa202 (diff) | |
download | linux-debian-04d4869fd16e0c1be9d6c8a9778176a491670227.tar.gz |
[x86,arm64,armhf] Add rtla package for Real-Time Linux Analysis tools
- Patch the upstream Makefile to allow appending to CFLAGS and LDFLAGS
- Patch the upstream Makefile to fix command symlinks
- Add control file template
- Add the necessary glue in rules.real and rules.d
- Add manual page symlinks mirroring the command symlinks
I'm only adding this for architectures that we build an RT kernel for.
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | debian/patches/bugfix/all/tools-rtla-build-with-extra-c-ld-flags.patch | 24 | ||||
-rw-r--r-- | debian/patches/bugfix/all/tools-rtla-fix-command-symlinks.patch | 26 | ||||
-rw-r--r-- | debian/patches/series | 2 | ||||
-rw-r--r-- | debian/rtla.links | 2 | ||||
-rw-r--r-- | debian/rules.d/tools/tracing/rtla/Makefile | 17 | ||||
-rw-r--r-- | debian/rules.real | 30 | ||||
-rw-r--r-- | debian/templates/control.tools-unversioned.in | 12 |
8 files changed, 113 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index e5ab8e8dd..dfc72176b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ linux (5.19~rc6-1~exp2) UNRELEASED; urgency=medium * [i386] x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit (fixes FTBFS) * [riscv64] Disable COMPAT (fixes FTBFS) + * [x86,arm64,armhf] Add rtla package for Real-Time Linux Analysis tools -- Ben Hutchings <benh@debian.org> Thu, 14 Jul 2022 12:52:40 +0200 diff --git a/debian/patches/bugfix/all/tools-rtla-build-with-extra-c-ld-flags.patch b/debian/patches/bugfix/all/tools-rtla-build-with-extra-c-ld-flags.patch new file mode 100644 index 000000000..f64205079 --- /dev/null +++ b/debian/patches/bugfix/all/tools-rtla-build-with-extra-c-ld-flags.patch @@ -0,0 +1,24 @@ +From: Ben Hutchings <benh@debian.org> +Date: Sat, 16 Jul 2022 15:00:01 +0200 +Subject: tools/rtla: Build with EXTRA_{C,LD}FLAGS +Forwarded: https://lore.kernel.org/linux-trace-devel/YtLBshz0nMQ7530H@decadent.org.uk/T/ + +To allow for distributions and other builders to apply hardening +policy and other customisation, append EXTRA_CFLAGS and EXTRA_LDFLAGS +to the corresponding variables. + +Signed-off-by: Ben Hutchings <benh@debian.org> +--- +--- a/tools/tracing/rtla/Makefile ++++ b/tools/tracing/rtla/Makefile +@@ -30,8 +30,8 @@ WOPTS := -Wall -Werror=format-security + + TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs) + +-CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) +-LDFLAGS := -ggdb ++CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS) ++LDFLAGS := -ggdb $(EXTRA_LDFLAGS) + LIBS := $$($(PKG_CONFIG) --libs libtracefs) + + SRC := $(wildcard src/*.c) diff --git a/debian/patches/bugfix/all/tools-rtla-fix-command-symlinks.patch b/debian/patches/bugfix/all/tools-rtla-fix-command-symlinks.patch new file mode 100644 index 000000000..5a6fdee1a --- /dev/null +++ b/debian/patches/bugfix/all/tools-rtla-fix-command-symlinks.patch @@ -0,0 +1,26 @@ +From: Ben Hutchings <benh@debian.org> +Date: Sat, 16 Jul 2022 15:20:27 +0200 +Subject: tools/rtla: Fix command symlinks +Forwarded: https://lore.kernel.org/linux-trace-devel/YtLBXMI6Ui4HLIF1@decadent.org.uk/T/ + +"ln -s" stores the next argument directly as the symlink target, so +it needs to be a relative path. In this case, just "rtla". + +Fixes: 0605bf009f18 ("rtla: Add osnoise tool") +Fixes: a828cd18bc4a ("rtla: Add timerlat tool and timelart top mode") +Signed-off-by: Ben Hutchings <benh@debian.org> +--- +--- a/tools/tracing/rtla/Makefile ++++ b/tools/tracing/rtla/Makefile +@@ -108,9 +108,9 @@ install: doc_install + $(INSTALL) rtla -m 755 $(DESTDIR)$(BINDIR) + $(STRIP) $(DESTDIR)$(BINDIR)/rtla + @test ! -f $(DESTDIR)$(BINDIR)/osnoise || rm $(DESTDIR)$(BINDIR)/osnoise +- ln -s $(DESTDIR)$(BINDIR)/rtla $(DESTDIR)$(BINDIR)/osnoise ++ ln -s rtla $(DESTDIR)$(BINDIR)/osnoise + @test ! -f $(DESTDIR)$(BINDIR)/timerlat || rm $(DESTDIR)$(BINDIR)/timerlat +- ln -s $(DESTDIR)$(BINDIR)/rtla $(DESTDIR)$(BINDIR)/timerlat ++ ln -s rtla $(DESTDIR)$(BINDIR)/timerlat + + .PHONY: clean tarball + clean: doc_clean diff --git a/debian/patches/series b/debian/patches/series index 2a2f2fb61..a3f73d5d4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -178,5 +178,7 @@ bugfix/all/tools-perf-fix-compilation-error-with-new-binutils.patch bugfix/all/tools-bpf_jit_disasm-fix-compilation-error-with-new-binutils.patch bugfix/all/tools-bpftool-fix-compilation-error-with-new-binutils.patch bugfix/all/tools-perf-fix-build-without-libbfd.patch +bugfix/all/tools-rtla-build-with-extra-c-ld-flags.patch +bugfix/all/tools-rtla-fix-command-symlinks.patch # ABI maintenance diff --git a/debian/rtla.links b/debian/rtla.links new file mode 100644 index 000000000..aca6c89a3 --- /dev/null +++ b/debian/rtla.links @@ -0,0 +1,2 @@ +usr/share/man/man1/rtla-osnoise.1 usr/share/man/man1/osnoise.1 +usr/share/man/man1/rtla-timerlat.1 usr/share/man/man1/timerlat.1 diff --git a/debian/rules.d/tools/tracing/rtla/Makefile b/debian/rules.d/tools/tracing/rtla/Makefile new file mode 100644 index 000000000..c05cb8145 --- /dev/null +++ b/debian/rules.d/tools/tracing/rtla/Makefile @@ -0,0 +1,17 @@ +include $(top_rulesdir)/Makefile.inc + +all: +# Out-of-tree build is not supported, so copy source to the build dir + echo '$(UPSTREAMVERSION)' >VERSION + rsync -a $(top_srcdir)/tools/tracing/rtla/ . + rsync -a $(top_srcdir)/Documentation/tools/rtla/ Documentation/ + $(MAKE) EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' EXTRA_LDFLAGS='$(LDFLAGS)' + +install: + $(MAKE) install +ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + rm -rf $(DESTDIR)/usr/share/man +endif + +clean: + rm -rf * diff --git a/debian/rules.real b/debian/rules.real index 7cb7f666d..7b3cd42d9 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -81,7 +81,8 @@ binary-arch-arch: \ $(call if_package, bpftool, install-bpftool) \ $(call if_package, usbip, install-usbip) \ $(call if_package, linux-cpupower, install-cpupower) \ - $(call if_package, hyperv-daemons, install-hyperv-daemons) + $(call if_package, hyperv-daemons, install-hyperv-daemons) \ + $(call if_package, rtla, install-rtla) build-indep: \ $(call if_package, $(SOURCE_BASENAME)-doc-$(VERSION), $(STAMPS_DIR)/build-doc) @@ -834,6 +835,33 @@ install-bootwrapper: build-bootwrapper dh_md5sums dh_builddeb -- $(BUILDDEB_ARGS) +build-rtla: $(STAMPS_DIR)/build-tools-headers + $(call make-tools,tools/tracing/rtla) + +install-rtla: PACKAGE_NAME = rtla +install-rtla: DH_OPTIONS = -p$(PACKAGE_NAME) +install-rtla: DIR = $(CURDIR)/debian/$(PACKAGE_NAME) +install-rtla: build-rtla + dh_testdir + dh_testroot + dh_prep + $(call make-tools,tools/tracing/rtla) install DESTDIR=$(DIR) + dh_install + dh_link + dh_installchangelogs +ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + dh_installdocs + dh_installman +endif + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb -- $(BUILDDEB_ARGS) + .PHONY: binary-% build-% install-% setup-% source-% # vim: filetype=make diff --git a/debian/templates/control.tools-unversioned.in b/debian/templates/control.tools-unversioned.in index 72d50705a..0bf8a62ca 100644 --- a/debian/templates/control.tools-unversioned.in +++ b/debian/templates/control.tools-unversioned.in @@ -128,3 +128,15 @@ Description: Support daemons for Linux running on Hyper-V . hv_vss_daemon provides the volume shadow copy service (VSS), allowing the host to freeze the guest filesystems while taking a snapshot. + +Package: rtla +Build-Profiles: <!stage1 !pkg.linux.notools> +Architecture: amd64 arm64 armhf i386 x32 +Build-Depends: libtracefs-dev, libtraceevent-dev, python3-docutils +Depends: ${shlibs:Depends} +Section: devel +Description: Real-Time Linux Analysis tools + rtla provides a set of commands for analysing the real-time + properties of Linux. rtla uses kernel tracing capabilities to + provide precise information about the properties and root causes of + unexpected results. |