diff options
Diffstat (limited to 'meta/recipes-kernel/lttng')
25 files changed, 2079 insertions, 292 deletions
diff --git a/meta/recipes-kernel/lttng/babeltrace2/run-ptest b/meta/recipes-kernel/lttng/babeltrace2/run-ptest index 72fe223436..71a9c81bfb 100755 --- a/meta/recipes-kernel/lttng/babeltrace2/run-ptest +++ b/meta/recipes-kernel/lttng/babeltrace2/run-ptest | |||
@@ -6,4 +6,14 @@ | |||
6 | # test plan to raise ERRORs; this is just noise. | 6 | # test plan to raise ERRORs; this is just noise. |
7 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit abs_top_srcdir=$PWD abs_top_builddir=$PWD GREP=grep SED=sed PYTHON=python3" | 7 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit abs_top_srcdir=$PWD abs_top_builddir=$PWD GREP=grep SED=sed PYTHON=python3" |
8 | 8 | ||
9 | exec make -C tests -k -s $makeargs $target 2>/dev/null | 9 | exec 2> error.log |
10 | make -C tests -k -s $makeargs $target | ||
11 | exitcode=$? | ||
12 | if [ -e error.log ]; then | ||
13 | cat error.log | ||
14 | fi | ||
15 | if [ -e tests/test-suite.log ]; then | ||
16 | cat tests/test-suite.log | ||
17 | fi | ||
18 | |||
19 | exit $exitcode \ No newline at end of file | ||
diff --git a/meta/recipes-kernel/lttng/babeltrace2_2.0.3.bb b/meta/recipes-kernel/lttng/babeltrace2_2.0.6.bb index 32ba75bf36..d6c75d7580 100644 --- a/meta/recipes-kernel/lttng/babeltrace2_2.0.3.bb +++ b/meta/recipes-kernel/lttng/babeltrace2_2.0.6.bb | |||
@@ -2,34 +2,36 @@ SUMMARY = "Babeltrace2 - Trace Format Babel Tower" | |||
2 | DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log." | 2 | DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log." |
3 | HOMEPAGE = "http://babeltrace.org/" | 3 | HOMEPAGE = "http://babeltrace.org/" |
4 | BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace" | 4 | BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace" |
5 | LICENSE = "MIT & GPLv2 & LGPLv2.1 & BSD-2-Clause" | 5 | LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-only & BSD-2-Clause" |
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=a6a458c13f18385b7bc5069a6d7b176e" | 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=a6a458c13f18385b7bc5069a6d7b176e" |
7 | 7 | ||
8 | DEPENDS = "glib-2.0 util-linux popt bison-native flex-native" | 8 | DEPENDS = "glib-2.0 util-linux popt bison-native flex-native" |
9 | 9 | ||
10 | SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.0 \ | 10 | SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.0;protocol=https \ |
11 | file://run-ptest \ | 11 | file://run-ptest \ |
12 | file://0001-tests-do-not-run-test-applications-from-.libs.patch \ | 12 | file://0001-tests-do-not-run-test-applications-from-.libs.patch \ |
13 | file://0001-Make-manpages-multilib-identical.patch \ | 13 | file://0001-Make-manpages-multilib-identical.patch \ |
14 | " | 14 | " |
15 | SRCREV = "91d154476e66735d705adda9ca5cbf5b5eea5940" | 15 | SRCREV = "0a6632f77801f3218a288604c646f8a39cb0d2c4" |
16 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$" | 16 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$" |
17 | 17 | ||
18 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
19 | 19 | ||
20 | inherit autotools pkgconfig ptest python3targetconfig | 20 | inherit autotools pkgconfig ptest python3targetconfig |
21 | 21 | ||
22 | EXTRA_OECONF = "--disable-debug-info" | 22 | EXTRA_OECONF = "--disable-debug-info --disable-Werror" |
23 | 23 | ||
24 | PACKAGECONFIG ??= "manpages" | 24 | PACKAGECONFIG ??= "manpages" |
25 | PACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native" | 25 | PACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native" |
26 | 26 | ||
27 | FILES_${PN}-staticdev += "${libdir}/babeltrace2/plugins/*.a" | 27 | FILES:${PN}-staticdev += "${libdir}/babeltrace2/plugins/*.a" |
28 | FILES_${PN} += "${libdir}/babeltrace2/plugins/*.so" | 28 | FILES:${PN} += "${libdir}/babeltrace2/plugins/*.so" |
29 | 29 | ||
30 | ASNEEDED = "" | 30 | ASNEEDED = "" |
31 | LDFLAGS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', ' -fuse-ld=bfd ', '', d)}" | ||
31 | 32 | ||
32 | RDEPENDS_${PN}-ptest += "bash gawk python3" | 33 | # coreutils since we need full mktemp |
34 | RDEPENDS:${PN}-ptest += "bash gawk python3 make grep coreutils findutils" | ||
33 | 35 | ||
34 | do_compile_ptest () { | 36 | do_compile_ptest () { |
35 | make -C tests all | 37 | make -C tests all |
diff --git a/meta/recipes-kernel/lttng/babeltrace_1.5.8.bb b/meta/recipes-kernel/lttng/babeltrace_1.5.11.bb index 9e5d3a7a97..f4d9b5e42a 100644 --- a/meta/recipes-kernel/lttng/babeltrace_1.5.8.bb +++ b/meta/recipes-kernel/lttng/babeltrace_1.5.11.bb | |||
@@ -2,15 +2,15 @@ SUMMARY = "Babeltrace - Trace Format Babel Tower" | |||
2 | DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log." | 2 | DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log." |
3 | HOMEPAGE = "http://babeltrace.org/" | 3 | HOMEPAGE = "http://babeltrace.org/" |
4 | BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace" | 4 | BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace" |
5 | LICENSE = "MIT & GPLv2 & LGPLv2.1" | 5 | LICENSE = "MIT & GPL-2.0-only & LGPL-2.1-only" |
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa" | 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa" |
7 | 7 | ||
8 | DEPENDS = "glib-2.0 util-linux popt bison-native flex-native" | 8 | DEPENDS = "glib-2.0 util-linux popt bison-native flex-native" |
9 | 9 | ||
10 | SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.5 \ | 10 | SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.5;protocol=https \ |
11 | file://run-ptest \ | 11 | file://run-ptest \ |
12 | " | 12 | " |
13 | SRCREV = "054a54ae10b01a271afc4f19496c041b10fb414c" | 13 | SRCREV = "91c00f70884887ff5c4849a8e3d47e311a22ba9d" |
14 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>1(\.\d+)+)$" | 14 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>1(\.\d+)+)$" |
15 | 15 | ||
16 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
@@ -21,7 +21,7 @@ EXTRA_OECONF = "--disable-debug-info" | |||
21 | 21 | ||
22 | ASNEEDED = "" | 22 | ASNEEDED = "" |
23 | 23 | ||
24 | RDEPENDS_${PN}-ptest += "bash gawk" | 24 | RDEPENDS:${PN}-ptest += "bash gawk make" |
25 | 25 | ||
26 | addtask do_patch_ptest_path after do_patch before do_configure | 26 | addtask do_patch_ptest_path after do_patch before do_configure |
27 | do_patch_ptest_path () { | 27 | do_patch_ptest_path () { |
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch new file mode 100644 index 0000000000..9d5fd0de60 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch | |||
@@ -0,0 +1,93 @@ | |||
1 | From fec007d9630e010062cf5699a08460f71f46b527 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 25 Mar 2024 08:54:42 -0400 | ||
4 | Subject: [PATCH 1/4] Fix: ASoC snd_doc_dapm on linux 6.9-rc1 | ||
5 | |||
6 | See upstream commit: | ||
7 | |||
8 | commit 7df3eb4cdb6bbfa482f51548b9fd47c2723c68ba | ||
9 | Author: Luca Ceresoli <luca.ceresoli@bootlin.com> | ||
10 | Date: Wed Mar 6 10:30:01 2024 +0100 | ||
11 | |||
12 | ASoC: trace: add event to snd_soc_dapm trace events | ||
13 | |||
14 | Add the event value to the snd_soc_dapm_start and snd_soc_dapm_done trace | ||
15 | events to make them more informative. | ||
16 | |||
17 | Trace before: | ||
18 | |||
19 | aplay-229 [000] 250.140309: snd_soc_dapm_start: card=vscn-2046 | ||
20 | aplay-229 [000] 250.167531: snd_soc_dapm_done: card=vscn-2046 | ||
21 | aplay-229 [000] 251.169588: snd_soc_dapm_start: card=vscn-2046 | ||
22 | aplay-229 [000] 251.195245: snd_soc_dapm_done: card=vscn-2046 | ||
23 | |||
24 | Trace after: | ||
25 | |||
26 | aplay-214 [000] 693.290612: snd_soc_dapm_start: card=vscn-2046 event=1 | ||
27 | aplay-214 [000] 693.315508: snd_soc_dapm_done: card=vscn-2046 event=1 | ||
28 | aplay-214 [000] 694.537349: snd_soc_dapm_start: card=vscn-2046 event=2 | ||
29 | aplay-214 [000] 694.563241: snd_soc_dapm_done: card=vscn-2046 event=2 | ||
30 | |||
31 | Upstream-Status: Backport [88c4e0fe Fix: ASoC snd_doc_dapm on linux 6.9-rc1] | ||
32 | |||
33 | Change-Id: If0d33544b8dd1dfb3d12ca9390892190fc0444b0 | ||
34 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
35 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
36 | --- | ||
37 | include/instrumentation/events/asoc.h | 33 +++++++++++++++++++++++++++ | ||
38 | 1 file changed, 33 insertions(+) | ||
39 | |||
40 | diff --git a/include/instrumentation/events/asoc.h b/include/instrumentation/events/asoc.h | ||
41 | index 21d13a0f..5126d4c1 100644 | ||
42 | --- a/include/instrumentation/events/asoc.h | ||
43 | +++ b/include/instrumentation/events/asoc.h | ||
44 | @@ -51,6 +51,38 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_done, | ||
45 | |||
46 | ) | ||
47 | |||
48 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) | ||
49 | +LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic, | ||
50 | + | ||
51 | + TP_PROTO(struct snd_soc_card *card, int event), | ||
52 | + | ||
53 | + TP_ARGS(card, event), | ||
54 | + | ||
55 | + TP_FIELDS( | ||
56 | + ctf_string(name, card->name) | ||
57 | + ctf_integer(int, event, event) | ||
58 | + ) | ||
59 | +) | ||
60 | +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_start, | ||
61 | + | ||
62 | + asoc_snd_soc_dapm_start, | ||
63 | + | ||
64 | + TP_PROTO(struct snd_soc_card *card, int event), | ||
65 | + | ||
66 | + TP_ARGS(card, event) | ||
67 | + | ||
68 | +) | ||
69 | + | ||
70 | +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done, | ||
71 | + | ||
72 | + asoc_snd_soc_dapm_done, | ||
73 | + | ||
74 | + TP_PROTO(struct snd_soc_card *card, int event), | ||
75 | + | ||
76 | + TP_ARGS(card, event) | ||
77 | + | ||
78 | +) | ||
79 | +#else | ||
80 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic, | ||
81 | |||
82 | TP_PROTO(struct snd_soc_card *card), | ||
83 | @@ -81,6 +113,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done, | ||
84 | TP_ARGS(card) | ||
85 | |||
86 | ) | ||
87 | +#endif | ||
88 | |||
89 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget, | ||
90 | |||
91 | -- | ||
92 | 2.39.2 | ||
93 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch new file mode 100644 index 0000000000..120528bf9c --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 878f89b6136ff7b870a19e04901cc6f316bbe10a Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Sat, 15 May 2021 10:26:38 -0400 | ||
4 | Subject: [PATCH] src/Kbuild: change missing CONFIG_TRACEPOINTS to warning | ||
5 | |||
6 | Taken from a previous patch to the main lttng-modules Makefile, by | ||
7 | Otavio Salvador: | ||
8 | |||
9 | The lttng-modules are being pulled by the tools-profile image feature, | ||
10 | however, not every kernel has the CONFIG_TRACEPOINTS feature enabled. | ||
11 | |||
12 | This change makes the build do not fail when CONFIG_TRACEPOINTS is not | ||
13 | available, allowing it to be kept being pulled by default. | ||
14 | |||
15 | Upstream-Status: Inappropriate [embedded specific] | ||
16 | |||
17 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
18 | --- | ||
19 | src/Kbuild | 7 ++++++- | ||
20 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
21 | |||
22 | Index: lttng-modules-2.13.10/src/Kbuild | ||
23 | =================================================================== | ||
24 | --- lttng-modules-2.13.10.orig/src/Kbuild | ||
25 | +++ lttng-modules-2.13.10/src/Kbuild | ||
26 | @@ -2,10 +2,13 @@ | ||
27 | |||
28 | ifdef CONFIG_LOCALVERSION # Check if dot-config is included. | ||
29 | ifeq ($(CONFIG_TRACEPOINTS),) | ||
30 | - $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) | ||
31 | + $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) | ||
32 | + DISABLE_MODULE = y | ||
33 | endif # CONFIG_TRACEPOINTS | ||
34 | endif # ifdef CONFIG_LOCALVERSION | ||
35 | |||
36 | +ifneq ($(DISABLE_MODULE),y) | ||
37 | + | ||
38 | TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/.. | ||
39 | |||
40 | lttng_check_linux_version = $(shell pwd)/include/linux/version.h | ||
41 | @@ -150,3 +153,5 @@ lttng-statedump-objs := lttng-statedump- | ||
42 | obj-$(CONFIG_LTTNG) += probes/ | ||
43 | obj-$(CONFIG_LTTNG) += lib/ | ||
44 | obj-$(CONFIG_LTTNG) += tests/ | ||
45 | + | ||
46 | +endif # DISABLE_MODULE | ||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch new file mode 100644 index 0000000000..6ea10ffc91 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch | |||
@@ -0,0 +1,132 @@ | |||
1 | From d8379ec6365a925db33cae94fb6783cdbdb6a922 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 25 Mar 2024 09:40:29 -0400 | ||
4 | Subject: [PATCH 2/4] Fix: ASoC add component to set_bias_level events in linux | ||
5 | 6.9-rc1 | ||
6 | |||
7 | See upstream commit: | ||
8 | |||
9 | commit 6ef46a69ec32fe1cf56de67742fcd01af4bf48af | ||
10 | Author: Luca Ceresoli <luca.ceresoli@bootlin.com> | ||
11 | Date: Wed Mar 6 10:30:00 2024 +0100 | ||
12 | |||
13 | ASoC: trace: add component to set_bias_level trace events | ||
14 | |||
15 | The snd_soc_bias_level_start and snd_soc_bias_level_done trace events | ||
16 | currently look like: | ||
17 | |||
18 | aplay-229 [000] 1250.140778: snd_soc_bias_level_start: card=vscn-2046 val=1 | ||
19 | aplay-229 [000] 1250.140784: snd_soc_bias_level_done: card=vscn-2046 val=1 | ||
20 | aplay-229 [000] 1250.140786: snd_soc_bias_level_start: card=vscn-2046 val=2 | ||
21 | aplay-229 [000] 1250.140788: snd_soc_bias_level_done: card=vscn-2046 val=2 | ||
22 | kworker/u8:1-21 [000] 1250.140871: snd_soc_bias_level_start: card=vscn-2046 val=1 | ||
23 | kworker/u8:0-11 [000] 1250.140951: snd_soc_bias_level_start: card=vscn-2046 val=1 | ||
24 | kworker/u8:0-11 [000] 1250.140956: snd_soc_bias_level_done: card=vscn-2046 val=1 | ||
25 | kworker/u8:0-11 [000] 1250.140959: snd_soc_bias_level_start: card=vscn-2046 val=2 | ||
26 | kworker/u8:0-11 [000] 1250.140961: snd_soc_bias_level_done: card=vscn-2046 val=2 | ||
27 | kworker/u8:1-21 [000] 1250.167219: snd_soc_bias_level_done: card=vscn-2046 val=1 | ||
28 | kworker/u8:1-21 [000] 1250.167222: snd_soc_bias_level_start: card=vscn-2046 val=2 | ||
29 | kworker/u8:1-21 [000] 1250.167232: snd_soc_bias_level_done: card=vscn-2046 val=2 | ||
30 | kworker/u8:0-11 [000] 1250.167440: snd_soc_bias_level_start: card=vscn-2046 val=3 | ||
31 | kworker/u8:0-11 [000] 1250.167444: snd_soc_bias_level_done: card=vscn-2046 val=3 | ||
32 | kworker/u8:1-21 [000] 1250.167497: snd_soc_bias_level_start: card=vscn-2046 val=3 | ||
33 | kworker/u8:1-21 [000] 1250.167506: snd_soc_bias_level_done: card=vscn-2046 val=3 | ||
34 | |||
35 | There are clearly multiple calls, one per component, but they cannot be | ||
36 | discriminated from each other. | ||
37 | |||
38 | Change the ftrace events to also print the component name, to make it clear | ||
39 | which part of the code is involved. This requires changing the passed value | ||
40 | from a struct snd_soc_card, where the DAPM context is not kwown, to a | ||
41 | struct snd_soc_dapm_context where it is obviously known but the a card | ||
42 | pointer is also available. | ||
43 | |||
44 | With this change, the resulting trace becomes: | ||
45 | |||
46 | aplay-247 [000] 1436.357332: snd_soc_bias_level_start: card=vscn-2046 component=(none) val=1 | ||
47 | aplay-247 [000] 1436.357338: snd_soc_bias_level_done: card=vscn-2046 component=(none) val=1 | ||
48 | aplay-247 [000] 1436.357340: snd_soc_bias_level_start: card=vscn-2046 component=(none) val=2 | ||
49 | aplay-247 [000] 1436.357343: snd_soc_bias_level_done: card=vscn-2046 component=(none) val=2 | ||
50 | kworker/u8:4-215 [000] 1436.357437: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=1 | ||
51 | kworker/u8:5-231 [000] 1436.357518: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=1 | ||
52 | kworker/u8:5-231 [000] 1436.357523: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=1 | ||
53 | kworker/u8:5-231 [000] 1436.357526: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=2 | ||
54 | kworker/u8:5-231 [000] 1436.357528: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=2 | ||
55 | kworker/u8:4-215 [000] 1436.383217: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=1 | ||
56 | kworker/u8:4-215 [000] 1436.383221: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=2 | ||
57 | kworker/u8:4-215 [000] 1436.383231: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=2 | ||
58 | kworker/u8:5-231 [000] 1436.383468: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=3 | ||
59 | kworker/u8:5-231 [000] 1436.383472: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=3 | ||
60 | kworker/u8:4-215 [000] 1436.383503: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=3 | ||
61 | kworker/u8:4-215 [000] 1436.383513: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=3 | ||
62 | |||
63 | Upstream-Status: Backport [303434ab Fix: ASoC add component to set_bias_level events in linux 6.9-rc1] | ||
64 | |||
65 | Change-Id: I959f1680c002acdf29828b968d3975247f5433d8 | ||
66 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
67 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
68 | --- | ||
69 | include/instrumentation/events/asoc.h | 36 +++++++++++++++++++++++++++ | ||
70 | 1 file changed, 36 insertions(+) | ||
71 | |||
72 | Index: lttng-modules-2.13.12/include/instrumentation/events/asoc.h | ||
73 | =================================================================== | ||
74 | --- lttng-modules-2.13.12.orig/include/instrumentation/events/asoc.h | ||
75 | +++ lttng-modules-2.13.12/include/instrumentation/events/asoc.h | ||
76 | @@ -10,6 +10,7 @@ | ||
77 | #include <lttng/kernel-version.h> | ||
78 | |||
79 | #define DAPM_DIRECT "(direct)" | ||
80 | +#define DAPM_COMPONENT_NONE "(none)" | ||
81 | |||
82 | #ifndef _TRACE_ASOC_DEF | ||
83 | #define _TRACE_ASOC_DEF | ||
84 | @@ -119,6 +120,40 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc | ||
85 | ) | ||
86 | #endif | ||
87 | |||
88 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) | ||
89 | +LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_context, | ||
90 | + | ||
91 | + TP_PROTO(struct snd_soc_dapm_context *dapm, int val), | ||
92 | + | ||
93 | + TP_ARGS(dapm, val), | ||
94 | + | ||
95 | + TP_FIELDS( | ||
96 | + ctf_string(name, dapm->card->name) | ||
97 | + ctf_string(component, dapm->component ? dapm->component->name : DAPM_COMPONENT_NONE) | ||
98 | + ctf_integer(int, val, val) | ||
99 | + ) | ||
100 | +) | ||
101 | + | ||
102 | +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_context, snd_soc_bias_level_start, | ||
103 | + | ||
104 | + asoc_snd_soc_bias_level_start, | ||
105 | + | ||
106 | + TP_PROTO(struct snd_soc_dapm_context *dapm, int val), | ||
107 | + | ||
108 | + TP_ARGS(dapm, val) | ||
109 | + | ||
110 | +) | ||
111 | + | ||
112 | +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_context, snd_soc_bias_level_done, | ||
113 | + | ||
114 | + asoc_snd_soc_bias_level_done, | ||
115 | + | ||
116 | + TP_PROTO(struct snd_soc_dapm_context *dapm, int val), | ||
117 | + | ||
118 | + TP_ARGS(dapm, val) | ||
119 | + | ||
120 | +) | ||
121 | +#else | ||
122 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card, | ||
123 | |||
124 | TP_PROTO(struct snd_soc_card *card, int val), | ||
125 | @@ -150,6 +185,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc | ||
126 | TP_ARGS(card, val) | ||
127 | |||
128 | ) | ||
129 | +#endif | ||
130 | |||
131 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) | ||
132 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic, | ||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch new file mode 100644 index 0000000000..66c48ebe8f --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From f4a6415f8d5fa447868d1fdc7119e0a328966379 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 25 Mar 2024 10:30:32 -0400 | ||
4 | Subject: [PATCH 3/4] Fix: mm_compaction_migratepages changed in linux 6.9-rc1 | ||
5 | |||
6 | See upstream commit: | ||
7 | |||
8 | commit ab755bf4249b992fc2140d615ab0a686d50765b4 | ||
9 | Author: Baolin Wang <baolin.wang@linux.alibaba.com> | ||
10 | Date: Tue Feb 20 14:16:31 2024 +0800 | ||
11 | |||
12 | mm: compaction: update the cc->nr_migratepages when allocating or freeing the freepages | ||
13 | |||
14 | Currently we will use 'cc->nr_freepages >= cc->nr_migratepages' comparison | ||
15 | to ensure that enough freepages are isolated in isolate_freepages(), | ||
16 | however it just decreases the cc->nr_freepages without updating | ||
17 | cc->nr_migratepages in compaction_alloc(), which will waste more CPU | ||
18 | cycles and cause too many freepages to be isolated. | ||
19 | |||
20 | So we should also update the cc->nr_migratepages when allocating or | ||
21 | freeing the freepages to avoid isolating excess freepages. And I can see | ||
22 | fewer free pages are scanned and isolated when running thpcompact on my | ||
23 | Arm64 server: | ||
24 | |||
25 | k6.7 k6.7_patched | ||
26 | Ops Compaction pages isolated 120692036.00 118160797.00 | ||
27 | Ops Compaction migrate scanned 131210329.00 154093268.00 | ||
28 | Ops Compaction free scanned 1090587971.00 1080632536.00 | ||
29 | Ops Compact scan efficiency 12.03 14.26 | ||
30 | |||
31 | Moreover, I did not see an obvious latency improvements, this is likely | ||
32 | because isolating freepages is not the bottleneck in the thpcompact test | ||
33 | case. | ||
34 | |||
35 | k6.7 k6.7_patched | ||
36 | Amean fault-both-1 1089.76 ( 0.00%) 1080.16 * 0.88%* | ||
37 | Amean fault-both-3 1616.48 ( 0.00%) 1636.65 * -1.25%* | ||
38 | Amean fault-both-5 2266.66 ( 0.00%) 2219.20 * 2.09%* | ||
39 | Amean fault-both-7 2909.84 ( 0.00%) 2801.90 * 3.71%* | ||
40 | Amean fault-both-12 4861.26 ( 0.00%) 4733.25 * 2.63%* | ||
41 | Amean fault-both-18 7351.11 ( 0.00%) 6950.51 * 5.45%* | ||
42 | Amean fault-both-24 9059.30 ( 0.00%) 9159.99 * -1.11%* | ||
43 | Amean fault-both-30 10685.68 ( 0.00%) 11399.02 * -6.68%* | ||
44 | |||
45 | Upstream-Status: Backport [175fe77c Fix: mm_compaction_migratepages changed in linux 6.9-rc1] | ||
46 | |||
47 | Change-Id: I103a43fd1b549360b3fc978fd409b7c17ef3e192 | ||
48 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
49 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
50 | --- | ||
51 | include/instrumentation/events/compaction.h | 17 ++++++++++++++++- | ||
52 | 1 file changed, 16 insertions(+), 1 deletion(-) | ||
53 | |||
54 | Index: lttng-modules-2.13.12/include/instrumentation/events/compaction.h | ||
55 | =================================================================== | ||
56 | --- lttng-modules-2.13.12.orig/include/instrumentation/events/compaction.h | ||
57 | +++ lttng-modules-2.13.12/include/instrumentation/events/compaction.h | ||
58 | @@ -97,7 +97,22 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(comp | ||
59 | |||
60 | #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */ | ||
61 | |||
62 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) || \ | ||
63 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) | ||
64 | +LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, | ||
65 | + | ||
66 | + compaction_migratepages, | ||
67 | + | ||
68 | + TP_PROTO(unsigned int nr_migratepages, | ||
69 | + unsigned int nr_succeeded), | ||
70 | + | ||
71 | + TP_ARGS(nr_migratepages, nr_succeeded), | ||
72 | + | ||
73 | + TP_FIELDS( | ||
74 | + ctf_integer(unsigned long, nr_migrated, nr_succeeded) | ||
75 | + ctf_integer(unsigned long, nr_failed, nr_migratepages - nr_succeeded) | ||
76 | + ) | ||
77 | +) | ||
78 | +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) || \ | ||
79 | LTTNG_RHEL_KERNEL_RANGE(5,14,0,163,0,0, 5,15,0,0,0,0)) | ||
80 | LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, | ||
81 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch new file mode 100644 index 0000000000..59ef4f9313 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From 217bc2e4685050dddce9bdd2557b64f6b8c16622 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 25 Mar 2024 10:53:46 -0400 | ||
4 | Subject: [PATCH 4/4] Fix: dev_base_lock removed in linux 6.9-rc1 | ||
5 | |||
6 | See upstream commit: | ||
7 | |||
8 | commit 1b3ef46cb7f2618cc0b507393220a69810f6da12 | ||
9 | Author: Eric Dumazet <edumazet@google.com> | ||
10 | Date: Tue Feb 13 06:32:45 2024 +0000 | ||
11 | |||
12 | net: remove dev_base_lock | ||
13 | |||
14 | dev_base_lock is not needed anymore, all remaining users also hold RTNL. | ||
15 | |||
16 | Upstream-Status: Backport [52eb2ee9 Fix: dev_base_lock removed in linux 6.9-rc1] | ||
17 | |||
18 | Change-Id: I6b07e6eed07fd398302ca14d23162ed24d74df15 | ||
19 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
20 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
21 | --- | ||
22 | src/lttng-statedump-impl.c | 15 +++++++++++++++ | ||
23 | 1 file changed, 15 insertions(+) | ||
24 | |||
25 | Index: lttng-modules-2.13.12/src/lttng-statedump-impl.c | ||
26 | =================================================================== | ||
27 | --- lttng-modules-2.13.12.orig/src/lttng-statedump-impl.c | ||
28 | +++ lttng-modules-2.13.12/src/lttng-statedump-impl.c | ||
29 | @@ -392,6 +392,20 @@ void lttng_enumerate_device(struct lttng | ||
30 | } | ||
31 | } | ||
32 | |||
33 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) | ||
34 | +static | ||
35 | +int lttng_enumerate_network_ip_interface(struct lttng_kernel_session *session) | ||
36 | +{ | ||
37 | + struct net_device *dev; | ||
38 | + | ||
39 | + rtnl_lock(); | ||
40 | + for_each_netdev(&init_net, dev) | ||
41 | + lttng_enumerate_device(session, dev); | ||
42 | + rtnl_unlock(); | ||
43 | + | ||
44 | + return 0; | ||
45 | +} | ||
46 | +#else | ||
47 | static | ||
48 | int lttng_enumerate_network_ip_interface(struct lttng_kernel_session *session) | ||
49 | { | ||
50 | @@ -404,6 +418,7 @@ int lttng_enumerate_network_ip_interface | ||
51 | |||
52 | return 0; | ||
53 | } | ||
54 | +#endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) */ | ||
55 | #else /* CONFIG_INET */ | ||
56 | static inline | ||
57 | int lttng_enumerate_network_ip_interface(struct lttng_kernel_session *session) | ||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch b/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch deleted file mode 100644 index e411242272..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | From 1b0e574d680101105a6c1e8931c78824f5a97a42 Mon Sep 17 00:00:00 2001 | ||
2 | From: Otavio Salvador <otavio@ossystems.com.br> | ||
3 | Date: Mon, 5 Sep 2016 17:08:56 +0000 | ||
4 | Subject: [PATCH] Makefile: Do not fail if CONFIG_TRACEPOINTS is not enabled | ||
5 | Organization: O.S. Systems Software LTDA. | ||
6 | |||
7 | The lttng-modules are being pulled by the tools-profile image feature, | ||
8 | however, not every kernel has the CONFIG_TRACEPOINTS feature enabled. | ||
9 | |||
10 | This change makes the build do not fail when CONFIG_TRACEPOINTS is not | ||
11 | available, allowing it to be kept being pulled by default. | ||
12 | |||
13 | Upstream-Status: Inappropriate [embedded specific] | ||
14 | |||
15 | Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> | ||
16 | --- | ||
17 | Makefile | 9 +++++---- | ||
18 | 1 file changed, 5 insertions(+), 4 deletions(-) | ||
19 | |||
20 | diff --git a/Makefile b/Makefile | ||
21 | index 8602649..75550cc 100644 | ||
22 | --- a/Makefile | ||
23 | +++ b/Makefile | ||
24 | @@ -8,10 +8,7 @@ ifneq ($(KERNELRELEASE),) | ||
25 | # and defines the modules to be built. | ||
26 | |||
27 | ifdef CONFIG_LOCALVERSION # Check if dot-config is included. | ||
28 | - ifeq ($(CONFIG_TRACEPOINTS),) | ||
29 | - $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) | ||
30 | - endif # CONFIG_TRACEPOINTS | ||
31 | - endif # ifdef CONFIG_LOCALVERSION | ||
32 | + ifneq ($(CONFIG_TRACEPOINTS),) | ||
33 | |||
34 | TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST))) | ||
35 | |||
36 | @@ -94,6 +91,10 @@ ifneq ($(KERNELRELEASE),) | ||
37 | obj-$(CONFIG_LTTNG) += lib/ | ||
38 | obj-$(CONFIG_LTTNG) += tests/ | ||
39 | |||
40 | + else | ||
41 | + $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration) | ||
42 | + endif # CONFIG_TRACEPOINTS | ||
43 | + endif # ifdef CONFIG_LOCALVERSION | ||
44 | else # KERNELRELEASE | ||
45 | |||
46 | # This part of the Makefile is used when the 'make' command is runned in the | ||
47 | -- | ||
48 | 2.1.4 | ||
49 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.12.4.bb b/meta/recipes-kernel/lttng/lttng-modules_2.12.4.bb deleted file mode 100644 index 3ca59f789a..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules_2.12.4.bb +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | SECTION = "devel" | ||
2 | SUMMARY = "Linux Trace Toolkit KERNEL MODULE" | ||
3 | DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules" | ||
4 | HOMEPAGE = "https://lttng.org/" | ||
5 | LICENSE = "LGPLv2.1 & GPLv2 & MIT" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3f882d431dc0f32f1f44c0707aa41128" | ||
7 | |||
8 | inherit module | ||
9 | |||
10 | include lttng-platforms.inc | ||
11 | |||
12 | SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ | ||
13 | file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ | ||
14 | " | ||
15 | |||
16 | SRC_URI[sha256sum] = "fe66400fa1b85bff1b9ae24419c74e3bb7d358d643eade0594d81b48bd190688" | ||
17 | |||
18 | export INSTALL_MOD_DIR="kernel/lttng-modules" | ||
19 | |||
20 | EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'" | ||
21 | |||
22 | do_install_append() { | ||
23 | # Delete empty directories to avoid QA failures if no modules were built | ||
24 | find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \; | ||
25 | } | ||
26 | |||
27 | python do_package_prepend() { | ||
28 | if not os.path.exists(os.path.join(d.getVar('D'), d.getVar('nonarch_base_libdir')[1:], 'modules')): | ||
29 | bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN')) | ||
30 | } | ||
31 | |||
32 | BBCLASSEXTEND = "devupstream:target" | ||
33 | LIC_FILES_CHKSUM_class-devupstream = "file://LICENSE;md5=3f882d431dc0f32f1f44c0707aa41128" | ||
34 | DEFAULT_PREFERENCE_class-devupstream = "-1" | ||
35 | SRC_URI_class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.12 \ | ||
36 | file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ | ||
37 | " | ||
38 | SRCREV_class-devupstream = "be71b60a327d7ad2588abc5cad2861177119972b" | ||
39 | PV_class-devupstream = "2.12.3+git${SRCPV}" | ||
40 | S_class-devupstream = "${WORKDIR}/git" | ||
41 | SRCREV_FORMAT ?= "lttng_git" | ||
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.12.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.12.bb new file mode 100644 index 0000000000..95d5e2d615 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.12.bb | |||
@@ -0,0 +1,45 @@ | |||
1 | SECTION = "devel" | ||
2 | SUMMARY = "Linux Trace Toolkit KERNEL MODULE" | ||
3 | DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules" | ||
4 | HOMEPAGE = "https://lttng.org/" | ||
5 | LICENSE = "LGPL-2.1-only & GPL-2.0-only & MIT" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0464cff101a009c403cd2ed65d01d4c4" | ||
7 | |||
8 | inherit module | ||
9 | |||
10 | include lttng-platforms.inc | ||
11 | |||
12 | SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ | ||
13 | file://0001-Fix-ASoC-snd_doc_dapm-on-linux-6.9-rc1.patch \ | ||
14 | file://0002-Fix-ASoC-add-component-to-set_bias_level-events-in-l.patch \ | ||
15 | file://0003-Fix-mm_compaction_migratepages-changed-in-linux-6.9-.patch \ | ||
16 | file://0004-Fix-dev_base_lock-removed-in-linux-6.9-rc1.patch \ | ||
17 | " | ||
18 | |||
19 | # Use :append here so that the patch is applied also when using devupstream | ||
20 | SRC_URI:append = " file://0001-src-Kbuild-change-missing-CONFIG_TRACEPOINTS-to-warn.patch" | ||
21 | |||
22 | SRC_URI[sha256sum] = "d85fcb66c7bd31003ab8735e8c77700e5e4f417b4c22fe1f20112cf435abad79" | ||
23 | |||
24 | export INSTALL_MOD_DIR="kernel/lttng-modules" | ||
25 | |||
26 | EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'" | ||
27 | |||
28 | MODULES_MODULE_SYMVERS_LOCATION = "src" | ||
29 | |||
30 | do_install:append() { | ||
31 | # Delete empty directories to avoid QA failures if no modules were built | ||
32 | if [ -d ${D}/${nonarch_base_libdir} ]; then | ||
33 | find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \; | ||
34 | fi | ||
35 | } | ||
36 | |||
37 | python do_package:prepend() { | ||
38 | if not os.path.exists(os.path.join(d.getVar('D'), d.getVar('nonarch_base_libdir')[1:], 'modules')): | ||
39 | bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN')) | ||
40 | } | ||
41 | |||
42 | BBCLASSEXTEND = "devupstream:target" | ||
43 | SRC_URI:class-devupstream = "git://git.lttng.org/lttng-modules;branch=stable-2.13;protocol=https" | ||
44 | SRCREV:class-devupstream = "7584cfc04914cb0842a986e9808686858b9c8630" | ||
45 | SRCREV_FORMAT ?= "lttng_git" | ||
diff --git a/meta/recipes-kernel/lttng/lttng-platforms.inc b/meta/recipes-kernel/lttng/lttng-platforms.inc index aa8220bbb4..900e36df82 100644 --- a/meta/recipes-kernel/lttng/lttng-platforms.inc +++ b/meta/recipes-kernel/lttng/lttng-platforms.inc | |||
@@ -2,16 +2,20 @@ | |||
2 | # Whether the platform supports kernel tracing | 2 | # Whether the platform supports kernel tracing |
3 | # | 3 | # |
4 | LTTNGMODULES = "lttng-modules" | 4 | LTTNGMODULES = "lttng-modules" |
5 | LTTNGMODULES_arc = "" | 5 | LTTNGMODULES:arc = "" |
6 | LTTNGMODULES_riscv64 = "" | 6 | LTTNGMODULES:riscv64 = "" |
7 | 7 | ||
8 | COMPATIBLE_HOST_riscv64_pn-lttng-modules = "null" | 8 | COMPATIBLE_HOST:riscv64:pn-lttng-modules = "null" |
9 | COMPATIBLE_HOST_arc_pn-lttng-modules = "null" | 9 | COMPATIBLE_HOST:arc:pn-lttng-modules = "null" |
10 | 10 | ||
11 | # Whether the platform supports userspace tracing | 11 | # Whether the platform supports userspace tracing |
12 | # lttng-ust uses sched_getcpu() which is not there on for some platforms. | 12 | # lttng-ust uses sched_getcpu() which is not there on for some platforms. |
13 | LTTNGUST = "lttng-ust" | 13 | LTTNGUST = "lttng-ust" |
14 | LTTNGUST_arc = "" | 14 | LTTNGUST:arc = "" |
15 | 15 | ||
16 | COMPATIBLE_HOST_arc_pn-lttng-ust = "null" | 16 | COMPATIBLE_HOST:arc:pn-lttng-ust = "null" |
17 | 17 | ||
18 | # Whether the platform supports lttng-tools | ||
19 | # lttng-tools requires SYS_ppoll and SYS_pselect6 which are not supported on riscv32. | ||
20 | # It's also turned off for riscv32 in meta-riscv. See https://github.com/riscv/meta-riscv/blob/master/conf/layer.conf | ||
21 | COMPATIBLE_HOST:riscv32:pn-lttng-tools = "null" | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch new file mode 100644 index 0000000000..3286dfb5c1 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 6b45c5f80d20e7bbf3d98c1fa17d2cf8716af3bb Mon Sep 17 00:00:00 2001 | ||
2 | From: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
3 | Date: Mon, 25 Mar 2024 18:20:14 +0800 | ||
4 | Subject: [PATCH] Fix: rotation-destroy-flush: fix session daemon abort if no | ||
5 | kernel module present | ||
6 | |||
7 | Testing rotation-destroy-flush when no lttng kernel modules present, it would | ||
8 | be failed with error message: | ||
9 | |||
10 | Error: Unable to load required module lttng-ring-buffer-client-discard | ||
11 | not ok 1 - Start session daemon | ||
12 | Failed test 'Start session daemon' | ||
13 | not ok 2 - Create session rotation_destroy_flush in -o /tmp/tmp.test_rot ... | ||
14 | ... | ||
15 | |||
16 | This because test script that sets the LTTNG_ABORT_ON_ERROR environment | ||
17 | variable. It's this environment variable that causes the sessiond to handle the | ||
18 | kernel module loading failure as an abort rather than a warning. | ||
19 | |||
20 | Using "check_skip_kernel_test" to detect whether the kernel module fails to | ||
21 | load is expected or not. If the failure is expected, the script won't set that | ||
22 | environment variable any more. | ||
23 | |||
24 | Fixes: 3a174400 | ||
25 | ("tests:add check_skip_kernel_test to check root user and lttng kernel modules") | ||
26 | |||
27 | Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/12155] | ||
28 | |||
29 | Change-Id: I371e9ba717613e2940186f710cf3cccd35baed6c | ||
30 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
31 | --- | ||
32 | .../ust/rotation-destroy-flush/test_rotation_destroy_flush | 6 +++--- | ||
33 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
34 | |||
35 | diff --git a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush | ||
36 | index 669bcbc43..64161768f 100755 | ||
37 | --- a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush | ||
38 | +++ b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush | ||
39 | @@ -23,11 +23,11 @@ SIZE_LIMIT=$PAGE_SIZE | ||
40 | NR_ITER=10 | ||
41 | NUM_TESTS=$((15*$NR_ITER)) | ||
42 | |||
43 | -# Ensure the daemons invoke abort on error. | ||
44 | -export LTTNG_ABORT_ON_ERROR=1 | ||
45 | - | ||
46 | source $TESTDIR/utils/utils.sh | ||
47 | |||
48 | +# Ensure the daemons invoke abort on error. | ||
49 | +check_skip_kernel_test || export LTTNG_ABORT_ON_ERROR=1 | ||
50 | + | ||
51 | # MUST set TESTDIR before calling those functions | ||
52 | function run_app() | ||
53 | { | ||
54 | -- | ||
55 | 2.25.1 | ||
56 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch new file mode 100644 index 0000000000..4e21d1e9f1 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch | |||
@@ -0,0 +1,74 @@ | |||
1 | From 74b3844737b03492756b4f896c938b504b069f14 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jérémie Galarneau <jeremie.galarneau@efficios.com> | ||
3 | Date: Tue, 17 Jan 2023 16:57:35 -0500 | ||
4 | Subject: [PATCH] compat: off64_t is not defined by musl | ||
5 | |||
6 | This helps compile with latest musl, where off64_t is not defined unless | ||
7 | _LARGEFILE64_SOURCE is defined. On glibc, _LARGEFILE64_SOURCE is defined | ||
8 | if _GNU_SOURCE is defined, so the problem is only seen with musl. | ||
9 | |||
10 | Since the project uses AC_SYS_LARGEFILE, which from the autoconf doc: | ||
11 | "arrange for 64-bit file offsets, known as large-file support." | ||
12 | |||
13 | As such, it is safe to assume off_t is 64-bit wide. This is checked by a | ||
14 | static_assert to catch any platform where autoconf would let a 32-bit | ||
15 | off_t slip. | ||
16 | |||
17 | Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/9268] | ||
18 | Reported-by: Khem Raj <raj.khem@gmail.com> | ||
19 | Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> | ||
20 | Change-Id: If2c6007a8c85bc3f3065002af8a7538b882fb4a8 | ||
21 | --- | ||
22 | |||
23 | --- a/src/common/compat/compat-fcntl.c | ||
24 | +++ b/src/common/compat/compat-fcntl.c | ||
25 | @@ -8,14 +8,17 @@ | ||
26 | #define _LGPL_SOURCE | ||
27 | #include <common/compat/fcntl.h> | ||
28 | #include <common/macros.h> | ||
29 | +#include <common/bug.h> | ||
30 | +#include <stdint.h> | ||
31 | #include <unistd.h> | ||
32 | |||
33 | #ifdef __linux__ | ||
34 | |||
35 | LTTNG_HIDDEN | ||
36 | -int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, | ||
37 | +int compat_sync_file_range(int fd, off_t offset, off_t nbytes, | ||
38 | unsigned int flags) | ||
39 | { | ||
40 | + LTTNG_BUILD_BUG_ON(sizeof(off_t) != sizeof(int64_t)); | ||
41 | #ifdef HAVE_SYNC_FILE_RANGE | ||
42 | return sync_file_range(fd, offset, nbytes, flags); | ||
43 | #else | ||
44 | --- a/src/common/compat/fcntl.h | ||
45 | +++ b/src/common/compat/fcntl.h | ||
46 | @@ -13,16 +13,12 @@ | ||
47 | |||
48 | #include <common/compat/errno.h> | ||
49 | |||
50 | -#if (defined(__CYGWIN__)) | ||
51 | -typedef long long off64_t; | ||
52 | -#endif | ||
53 | - | ||
54 | #if (defined(__FreeBSD__) || defined(__sun__)) | ||
55 | typedef off64_t loff_t; | ||
56 | #endif | ||
57 | |||
58 | #ifdef __linux__ | ||
59 | -extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, | ||
60 | +extern int compat_sync_file_range(int fd, off_t offset, off_t nbytes, | ||
61 | unsigned int flags); | ||
62 | #define lttng_sync_file_range(fd, offset, nbytes, flags) \ | ||
63 | compat_sync_file_range(fd, offset, nbytes, flags) | ||
64 | @@ -37,8 +33,8 @@ extern int compat_sync_file_range(int fd | ||
65 | #define SYNC_FILE_RANGE_WAIT_BEFORE 0 | ||
66 | #define SYNC_FILE_RANGE_WRITE 0 | ||
67 | |||
68 | -static inline int lttng_sync_file_range(int fd, off64_t offset, | ||
69 | - off64_t nbytes, unsigned int flags) | ||
70 | +static inline int lttng_sync_file_range(int fd, off_t offset, | ||
71 | + off_t nbytes, unsigned int flags) | ||
72 | { | ||
73 | return -ENOSYS; | ||
74 | } | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch new file mode 100644 index 0000000000..2671a1908e --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch | |||
@@ -0,0 +1,1246 @@ | |||
1 | From cf558f802b259a33605fe0ede4d74ae2ff6be699 Mon Sep 17 00:00:00 2001 | ||
2 | From: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
3 | Date: Mon, 12 Feb 2024 09:23:54 -0500 | ||
4 | Subject: [PATCH] tests: add check_skip_kernel_test to check root user and | ||
5 | lttng kernel modules | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | The current tests will run both userspace and kernel testing. Some of | ||
11 | use cases only use lttng for one kind of tracing on an embedded | ||
12 | device (e.g. userspace), so in this scenario, the kernel modules might | ||
13 | not install to target rootfs, the test cases would be fail and exit. | ||
14 | |||
15 | Add LTTNG_TOOLS_DISABLE_KERNEL_TESTS to skip the lttng kernel features | ||
16 | test, this flag can be set via "make": | ||
17 | |||
18 | make check LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1 | ||
19 | |||
20 | When this flag was set, all kernel related testcases would be marked as | ||
21 | SKIP in result. | ||
22 | |||
23 | Since the the LTTNG_TOOLS_DISABLE_KERNEL_TESTS was checked in function | ||
24 | check_skip_kernel_test, lots of testcases also need to check root | ||
25 | permission, so merging the root permission checking into | ||
26 | check_skip_kernel_test. | ||
27 | |||
28 | Upstream-Status: Backport from | ||
29 | [https://git.lttng.org/?p=lttng-tools.git;a=commit;h=3a1744008331a0604479d3d7461f77056fad3a64] | ||
30 | |||
31 | Change-Id: I49a1f642a9869c21a69e0186c296fd917bd7b525 | ||
32 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
33 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
34 | Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> | ||
35 | --- | ||
36 | tests/destructive/metadata-regeneration | 8 +---- | ||
37 | tests/perf/test_perf_raw.in | 8 +---- | ||
38 | tests/regression/kernel/test_all_events | 8 +---- | ||
39 | tests/regression/kernel/test_callstack | 8 +---- | ||
40 | tests/regression/kernel/test_channel | 8 +---- | ||
41 | tests/regression/kernel/test_clock_override | 8 +---- | ||
42 | tests/regression/kernel/test_event_basic | 8 +---- | ||
43 | tests/regression/kernel/test_kernel_function | 8 +---- | ||
44 | tests/regression/kernel/test_lttng_logger | 8 +---- | ||
45 | tests/regression/kernel/test_ns_contexts | 8 +---- | ||
46 | .../regression/kernel/test_ns_contexts_change | 9 +---- | ||
47 | .../kernel/test_rotation_destroy_flush | 8 +---- | ||
48 | .../regression/kernel/test_select_poll_epoll | 8 +---- | ||
49 | tests/regression/kernel/test_syscall | 8 +---- | ||
50 | tests/regression/kernel/test_userspace_probe | 8 +---- | ||
51 | tests/regression/tools/clear/test_kernel | 8 +---- | ||
52 | .../tools/filtering/test_invalid_filter | 8 +---- | ||
53 | .../tools/filtering/test_unsupported_op | 8 +---- | ||
54 | .../tools/filtering/test_valid_filter | 8 +---- | ||
55 | tests/regression/tools/health/test_health.sh | 10 ++---- | ||
56 | tests/regression/tools/health/test_thread_ok | 9 +---- | ||
57 | tests/regression/tools/live/test_kernel | 10 +++--- | ||
58 | tests/regression/tools/live/test_lttng_kernel | 8 +---- | ||
59 | tests/regression/tools/metadata/test_kernel | 8 +---- | ||
60 | .../test_notification_kernel_buffer_usage | 36 +++++++++---------- | ||
61 | .../test_notification_kernel_capture | 23 ++++++------ | ||
62 | .../test_notification_kernel_error | 23 ++++++------ | ||
63 | .../test_notification_kernel_instrumentation | 23 ++++++------ | ||
64 | .../test_notification_kernel_syscall | 19 +++++----- | ||
65 | .../test_notification_kernel_userspace_probe | 20 +++++------ | ||
66 | .../notification/test_notification_multi_app | 14 +++----- | ||
67 | ...test_notification_notifier_discarded_count | 9 +++-- | ||
68 | .../tools/regen-metadata/test_kernel | 8 +---- | ||
69 | .../tools/regen-statedump/test_kernel | 8 +---- | ||
70 | tests/regression/tools/rotation/test_kernel | 8 +---- | ||
71 | tests/regression/tools/snapshots/test_kernel | 8 +---- | ||
72 | .../tools/snapshots/test_kernel_streaming | 8 +---- | ||
73 | .../streaming/test_high_throughput_limits | 8 +---- | ||
74 | tests/regression/tools/streaming/test_kernel | 8 +---- | ||
75 | .../tools/tracker/test_event_tracker | 8 +---- | ||
76 | .../tools/trigger/test_add_trigger_cli | 12 ++----- | ||
77 | .../tools/trigger/test_list_triggers_cli | 26 +++++--------- | ||
78 | .../tools/wildcard/test_event_wildcard | 8 +---- | ||
79 | .../test_relayd_working_directory | 4 +-- | ||
80 | .../ust/namespaces/test_ns_contexts_change | 7 +--- | ||
81 | tests/regression/ust/test_event_perf | 8 +---- | ||
82 | tests/utils/utils.sh | 35 ++++++++++++++++++ | ||
83 | 47 files changed, 166 insertions(+), 363 deletions(-) | ||
84 | |||
85 | diff --git a/tests/destructive/metadata-regeneration b/tests/destructive/metadata-regeneration | ||
86 | index b81e7af32..36b130d17 100755 | ||
87 | --- a/tests/destructive/metadata-regeneration | ||
88 | +++ b/tests/destructive/metadata-regeneration | ||
89 | @@ -185,19 +185,13 @@ function test_ust_streaming () | ||
90 | rm -f ${file_sync_before_last} | ||
91 | } | ||
92 | |||
93 | -if [ "$(id -u)" == "0" ]; then | ||
94 | - isroot=1 | ||
95 | -else | ||
96 | - isroot=0 | ||
97 | -fi | ||
98 | - | ||
99 | if ! destructive_tests_enabled ; then | ||
100 | echo 'You need to set the LTTNG_ENABLE_DESTRUCTIVE_TESTS to "will-break-my-system" as argument to run this test' | ||
101 | echo 'Moreover, please make sure that ntp is not running while executing this test' | ||
102 | exit 0 | ||
103 | fi | ||
104 | |||
105 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
106 | +check_skip_kernel_test $NUM_TESTS "Skipping all tests." || | ||
107 | { | ||
108 | start_lttng_relayd "-o $TRACE_PATH" | ||
109 | start_lttng_sessiond | ||
110 | diff --git a/tests/perf/test_perf_raw.in b/tests/perf/test_perf_raw.in | ||
111 | index f293ccd71..d35529a87 100644 | ||
112 | --- a/tests/perf/test_perf_raw.in | ||
113 | +++ b/tests/perf/test_perf_raw.in | ||
114 | @@ -137,12 +137,6 @@ function test_kernel_raw() | ||
115 | rm -rf $TRACE_PATH | ||
116 | } | ||
117 | |||
118 | -if [ "$(id -u)" == "0" ]; then | ||
119 | - isroot=1 | ||
120 | -else | ||
121 | - isroot=0 | ||
122 | -fi | ||
123 | - | ||
124 | # MUST set TESTDIR before calling those functions | ||
125 | plan_tests $NUM_TESTS | ||
126 | |||
127 | @@ -154,7 +148,7 @@ have_libpfm | ||
128 | |||
129 | test_ust_raw | ||
130 | |||
131 | -skip $isroot "Root access is needed for kernel testing, skipping." 9 || | ||
132 | +check_skip_kernel_test 9 || | ||
133 | { | ||
134 | modprobe lttng-test | ||
135 | test_kernel_raw | ||
136 | diff --git a/tests/regression/kernel/test_all_events b/tests/regression/kernel/test_all_events | ||
137 | index 2e20888df..044f9b65f 100755 | ||
138 | --- a/tests/regression/kernel/test_all_events | ||
139 | +++ b/tests/regression/kernel/test_all_events | ||
140 | @@ -43,13 +43,7 @@ plan_tests $NUM_TESTS | ||
141 | |||
142 | print_test_banner "$TEST_DESC" | ||
143 | |||
144 | -if [ "$(id -u)" == "0" ]; then | ||
145 | - isroot=1 | ||
146 | -else | ||
147 | - isroot=0 | ||
148 | -fi | ||
149 | - | ||
150 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
151 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
152 | { | ||
153 | validate_lttng_modules_present | ||
154 | start_lttng_sessiond | ||
155 | diff --git a/tests/regression/kernel/test_callstack b/tests/regression/kernel/test_callstack | ||
156 | index a4477fd7c..d8d6b5e0f 100755 | ||
157 | --- a/tests/regression/kernel/test_callstack | ||
158 | +++ b/tests/regression/kernel/test_callstack | ||
159 | @@ -134,13 +134,7 @@ plan_tests $NUM_TESTS | ||
160 | |||
161 | print_test_banner "$TEST_DESC" | ||
162 | |||
163 | -if [ "$(id -u)" == "0" ]; then | ||
164 | - isroot=1 | ||
165 | -else | ||
166 | - isroot=0 | ||
167 | -fi | ||
168 | - | ||
169 | -skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" || | ||
170 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
171 | { | ||
172 | validate_lttng_modules_present | ||
173 | start_lttng_sessiond | ||
174 | diff --git a/tests/regression/kernel/test_channel b/tests/regression/kernel/test_channel | ||
175 | index 9cc74c4e8..4c377bd2a 100755 | ||
176 | --- a/tests/regression/kernel/test_channel | ||
177 | +++ b/tests/regression/kernel/test_channel | ||
178 | @@ -47,13 +47,7 @@ function test_channel_buffer_too_large() | ||
179 | plan_tests $NUM_TESTS | ||
180 | print_test_banner "$TEST_DESC" | ||
181 | |||
182 | -if [ "$(id -u)" == "0" ]; then | ||
183 | - isroot=1 | ||
184 | -else | ||
185 | - isroot=0 | ||
186 | -fi | ||
187 | - | ||
188 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
189 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
190 | { | ||
191 | start_lttng_sessiond | ||
192 | |||
193 | diff --git a/tests/regression/kernel/test_clock_override b/tests/regression/kernel/test_clock_override | ||
194 | index 72892898b..48a3f926a 100755 | ||
195 | --- a/tests/regression/kernel/test_clock_override | ||
196 | +++ b/tests/regression/kernel/test_clock_override | ||
197 | @@ -172,13 +172,7 @@ TESTS=( | ||
198 | TEST_COUNT=${#TESTS[@]} | ||
199 | i=0 | ||
200 | |||
201 | -if [ "$(id -u)" == "0" ]; then | ||
202 | - isroot=1 | ||
203 | -else | ||
204 | - isroot=0 | ||
205 | -fi | ||
206 | - | ||
207 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
208 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
209 | { | ||
210 | validate_lttng_modules_present | ||
211 | trap signal_cleanup SIGTERM SIGINT | ||
212 | diff --git a/tests/regression/kernel/test_event_basic b/tests/regression/kernel/test_event_basic | ||
213 | index ac9ec0549..387e2f733 100755 | ||
214 | --- a/tests/regression/kernel/test_event_basic | ||
215 | +++ b/tests/regression/kernel/test_event_basic | ||
216 | @@ -73,13 +73,7 @@ plan_tests $NUM_TESTS | ||
217 | |||
218 | print_test_banner "$TEST_DESC" | ||
219 | |||
220 | -if [ "$(id -u)" == "0" ]; then | ||
221 | - isroot=1 | ||
222 | -else | ||
223 | - isroot=0 | ||
224 | -fi | ||
225 | - | ||
226 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
227 | +check_skip_kernel_test $NUM_TESTS "Skipping all tests." || | ||
228 | { | ||
229 | validate_lttng_modules_present | ||
230 | start_lttng_sessiond | ||
231 | diff --git a/tests/regression/kernel/test_kernel_function b/tests/regression/kernel/test_kernel_function | ||
232 | index b1d5491fc..ea16cdeef 100755 | ||
233 | --- a/tests/regression/kernel/test_kernel_function | ||
234 | +++ b/tests/regression/kernel/test_kernel_function | ||
235 | @@ -43,13 +43,7 @@ plan_tests $NUM_TESTS | ||
236 | |||
237 | print_test_banner "$TEST_DESC" | ||
238 | |||
239 | -if [ "$(id -u)" == "0" ]; then | ||
240 | - isroot=1 | ||
241 | -else | ||
242 | - isroot=0 | ||
243 | -fi | ||
244 | - | ||
245 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
246 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
247 | { | ||
248 | start_lttng_sessiond_notap | ||
249 | validate_lttng_modules_present | ||
250 | diff --git a/tests/regression/kernel/test_lttng_logger b/tests/regression/kernel/test_lttng_logger | ||
251 | index b8f7ded82..00eaae823 100755 | ||
252 | --- a/tests/regression/kernel/test_lttng_logger | ||
253 | +++ b/tests/regression/kernel/test_lttng_logger | ||
254 | @@ -110,13 +110,7 @@ plan_tests $NUM_TESTS | ||
255 | |||
256 | print_test_banner "$TEST_DESC" | ||
257 | |||
258 | -if [ "$(id -u)" == "0" ]; then | ||
259 | - isroot=1 | ||
260 | -else | ||
261 | - isroot=0 | ||
262 | -fi | ||
263 | - | ||
264 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
265 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
266 | { | ||
267 | validate_lttng_modules_present | ||
268 | start_lttng_sessiond | ||
269 | diff --git a/tests/regression/kernel/test_ns_contexts b/tests/regression/kernel/test_ns_contexts | ||
270 | index 0c8718d78..59e2568f6 100755 | ||
271 | --- a/tests/regression/kernel/test_ns_contexts | ||
272 | +++ b/tests/regression/kernel/test_ns_contexts | ||
273 | @@ -108,13 +108,7 @@ plan_tests $NUM_TESTS | ||
274 | print_test_banner "$TEST_DESC" | ||
275 | |||
276 | |||
277 | -isroot=0 | ||
278 | -if [ "$(id -u)" == "0" ]; then | ||
279 | - isroot=1 | ||
280 | -fi | ||
281 | - | ||
282 | -skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" && exit 0 | ||
283 | - | ||
284 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." && exit 0 | ||
285 | |||
286 | system_has_ns=0 | ||
287 | if [ -d "/proc/$$/ns" ]; then | ||
288 | diff --git a/tests/regression/kernel/test_ns_contexts_change b/tests/regression/kernel/test_ns_contexts_change | ||
289 | index 42a61276b..3f5e4eeab 100755 | ||
290 | --- a/tests/regression/kernel/test_ns_contexts_change | ||
291 | +++ b/tests/regression/kernel/test_ns_contexts_change | ||
292 | @@ -162,14 +162,7 @@ plan_tests $NUM_TESTS | ||
293 | |||
294 | print_test_banner "$TEST_DESC" | ||
295 | |||
296 | - | ||
297 | -isroot=0 | ||
298 | -if [ "$(id -u)" == "0" ]; then | ||
299 | - isroot=1 | ||
300 | -fi | ||
301 | - | ||
302 | -skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" && exit 0 | ||
303 | - | ||
304 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." && exit 0 | ||
305 | |||
306 | system_has_ns=0 | ||
307 | if [ -d "/proc/$$/ns" ]; then | ||
308 | diff --git a/tests/regression/kernel/test_rotation_destroy_flush b/tests/regression/kernel/test_rotation_destroy_flush | ||
309 | index cb773d7df..0af514b49 100755 | ||
310 | --- a/tests/regression/kernel/test_rotation_destroy_flush | ||
311 | +++ b/tests/regression/kernel/test_rotation_destroy_flush | ||
312 | @@ -120,13 +120,7 @@ TESTS=( | ||
313 | TEST_COUNT=${#TESTS[@]} | ||
314 | i=0 | ||
315 | |||
316 | -if [ "$(id -u)" == "0" ]; then | ||
317 | - isroot=1 | ||
318 | -else | ||
319 | - isroot=0 | ||
320 | -fi | ||
321 | - | ||
322 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
323 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
324 | { | ||
325 | validate_lttng_modules_present | ||
326 | trap signal_cleanup SIGTERM SIGINT | ||
327 | diff --git a/tests/regression/kernel/test_select_poll_epoll b/tests/regression/kernel/test_select_poll_epoll | ||
328 | index d8245a0e7..20f0ef0ae 100755 | ||
329 | --- a/tests/regression/kernel/test_select_poll_epoll | ||
330 | +++ b/tests/regression/kernel/test_select_poll_epoll | ||
331 | @@ -374,13 +374,7 @@ if test $? != 0; then | ||
332 | exit 0 | ||
333 | fi | ||
334 | |||
335 | -if [ "$(id -u)" == "0" ]; then | ||
336 | - isroot=1 | ||
337 | -else | ||
338 | - isroot=0 | ||
339 | -fi | ||
340 | - | ||
341 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
342 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
343 | { | ||
344 | validate_lttng_modules_present | ||
345 | |||
346 | diff --git a/tests/regression/kernel/test_syscall b/tests/regression/kernel/test_syscall | ||
347 | index 401a18a8d..219d94703 100755 | ||
348 | --- a/tests/regression/kernel/test_syscall | ||
349 | +++ b/tests/regression/kernel/test_syscall | ||
350 | @@ -664,13 +664,7 @@ plan_tests $NUM_TESTS | ||
351 | |||
352 | print_test_banner "$TEST_DESC" | ||
353 | |||
354 | -if [ "$(id -u)" == "0" ]; then | ||
355 | - isroot=1 | ||
356 | -else | ||
357 | - isroot=0 | ||
358 | -fi | ||
359 | - | ||
360 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
361 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
362 | { | ||
363 | validate_lttng_modules_present | ||
364 | start_lttng_sessiond | ||
365 | diff --git a/tests/regression/kernel/test_userspace_probe b/tests/regression/kernel/test_userspace_probe | ||
366 | index 1091ee65e..5d984d666 100755 | ||
367 | --- a/tests/regression/kernel/test_userspace_probe | ||
368 | +++ b/tests/regression/kernel/test_userspace_probe | ||
369 | @@ -815,13 +815,7 @@ fi | ||
370 | plan_tests $NUM_TESTS | ||
371 | print_test_banner "$TEST_DESC" | ||
372 | |||
373 | -if [ "$(id -u)" == "0" ]; then | ||
374 | - isroot=1 | ||
375 | -else | ||
376 | - isroot=0 | ||
377 | -fi | ||
378 | - | ||
379 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
380 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
381 | { | ||
382 | validate_lttng_modules_present | ||
383 | start_lttng_sessiond | ||
384 | diff --git a/tests/regression/tools/clear/test_kernel b/tests/regression/tools/clear/test_kernel | ||
385 | index 06fb1c368..48250a742 100755 | ||
386 | --- a/tests/regression/tools/clear/test_kernel | ||
387 | +++ b/tests/regression/tools/clear/test_kernel | ||
388 | @@ -536,12 +536,6 @@ plan_tests $NUM_TESTS | ||
389 | |||
390 | print_test_banner "$TEST_DESC" | ||
391 | |||
392 | -if [ "$(id -u)" == "0" ]; then | ||
393 | - isroot=1 | ||
394 | -else | ||
395 | - isroot=0 | ||
396 | -fi | ||
397 | - | ||
398 | streaming_tests=(test_kernel_streaming | ||
399 | test_kernel_streaming_rotate_clear | ||
400 | test_kernel_streaming_clear_rotate | ||
401 | @@ -563,7 +557,7 @@ snapshot_tests=(test_kernel_streaming_snapshot | ||
402 | test_kernel_local_snapshot | ||
403 | ) | ||
404 | |||
405 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
406 | +check_skip_kernel_test "$NUM_TESTS" "Skipping kernel streaming tests." || | ||
407 | { | ||
408 | trap signal_cleanup SIGTERM SIGINT | ||
409 | |||
410 | diff --git a/tests/regression/tools/filtering/test_invalid_filter b/tests/regression/tools/filtering/test_invalid_filter | ||
411 | index 7d9e524d9..8435e5546 100755 | ||
412 | --- a/tests/regression/tools/filtering/test_invalid_filter | ||
413 | +++ b/tests/regression/tools/filtering/test_invalid_filter | ||
414 | @@ -168,13 +168,7 @@ done | ||
415 | |||
416 | test_bytecode_limit -u | ||
417 | |||
418 | -if [ "$(id -u)" == "0" ]; then | ||
419 | - isroot=1 | ||
420 | -else | ||
421 | - isroot=0 | ||
422 | -fi | ||
423 | - | ||
424 | -skip $isroot "Root access is needed. Skipping all kernel invalid filter tests." $NUM_KERNEL_TESTS || | ||
425 | +check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel invalid filter tests." || | ||
426 | { | ||
427 | diag "Test kernel filters" | ||
428 | i=0 | ||
429 | diff --git a/tests/regression/tools/filtering/test_unsupported_op b/tests/regression/tools/filtering/test_unsupported_op | ||
430 | index 299247a3c..91eb86d21 100755 | ||
431 | --- a/tests/regression/tools/filtering/test_unsupported_op | ||
432 | +++ b/tests/regression/tools/filtering/test_unsupported_op | ||
433 | @@ -103,13 +103,7 @@ while [ "$i" -lt "$OP_COUNT" ]; do | ||
434 | let "i++" | ||
435 | done | ||
436 | |||
437 | -if [ "$(id -u)" == "0" ]; then | ||
438 | - isroot=1 | ||
439 | -else | ||
440 | - isroot=0 | ||
441 | -fi | ||
442 | - | ||
443 | -skip $isroot "Root access is needed. Skipping all kernel unsupported filter operations tests." $NUM_KERNEL_TESTS || | ||
444 | +check_skip_kernel_test $NUM_KERNEL_TESTS "Skipping kernel unsupported filter operations tests." || | ||
445 | { | ||
446 | diag "Test kernel unsupported filter operations" | ||
447 | |||
448 | diff --git a/tests/regression/tools/filtering/test_valid_filter b/tests/regression/tools/filtering/test_valid_filter | ||
449 | index e76ffa25f..1ba7c79bb 100755 | ||
450 | --- a/tests/regression/tools/filtering/test_valid_filter | ||
451 | +++ b/tests/regression/tools/filtering/test_valid_filter | ||
452 | @@ -1452,13 +1452,7 @@ KERNEL_FILTERS=( | ||
453 | |||
454 | IFS=$OLDIFS | ||
455 | |||
456 | -if [ "$(id -u)" == "0" ]; then | ||
457 | - isroot=1 | ||
458 | -else | ||
459 | - isroot=0 | ||
460 | -fi | ||
461 | - | ||
462 | -skip $isroot "Root access is needed. Skipping all kernel valid filter tests." $NUM_KERNEL_TESTS || | ||
463 | +check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel valid filter tests." || | ||
464 | { | ||
465 | diag "Test kernel valid filters" | ||
466 | |||
467 | diff --git a/tests/regression/tools/health/test_health.sh b/tests/regression/tools/health/test_health.sh | ||
468 | index b3d6419d2..68716e6b9 100644 | ||
469 | --- a/tests/regression/tools/health/test_health.sh | ||
470 | +++ b/tests/regression/tools/health/test_health.sh | ||
471 | @@ -82,7 +82,7 @@ function test_health | ||
472 | diag "With UST consumer daemons" | ||
473 | enable_ust_lttng_event_ok $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME | ||
474 | |||
475 | - skip $isroot "Root access is needed. Skipping kernel consumer health check test." "1" || | ||
476 | + check_skip_kernel_test "1" "Skipping kernel consumer health check test." || | ||
477 | { | ||
478 | diag "With kernel consumer daemon" | ||
479 | lttng_enable_kernel_event $SESSION_NAME $KERNEL_EVENT_NAME $CHANNEL_NAME | ||
480 | @@ -113,7 +113,7 @@ function test_health | ||
481 | |||
482 | |||
483 | if [ ${test_needs_root} -eq 1 ]; then | ||
484 | - skip ${isroot} "Root access needed for test \"${test_thread_name}\"." "1" || | ||
485 | + check_skip_kernel_test "1" "Skipping \"${test_thread_name}\"." || | ||
486 | { | ||
487 | report_errors "${test_thread_error_string}" "${test_relayd}" | ||
488 | } | ||
489 | @@ -276,12 +276,6 @@ STDERR_PATH=$(mktemp --tmpdir tmp.test_health_stderr_path.XXXXXX) | ||
490 | TRACE_PATH=$(mktemp --tmpdir -d tmp.test_health_trace_path.XXXXXX) | ||
491 | HEALTH_PATH=$(mktemp --tmpdir -d tmp.test_health_trace_path.XXXXXX) | ||
492 | |||
493 | -if [ "$(id -u)" == "0" ]; then | ||
494 | - isroot=1 | ||
495 | -else | ||
496 | - isroot=0 | ||
497 | -fi | ||
498 | - | ||
499 | THREAD_COUNT=${#THREAD[@]} | ||
500 | i=0 | ||
501 | while [ "$i" -lt "$THREAD_COUNT" ]; do | ||
502 | diff --git a/tests/regression/tools/health/test_thread_ok b/tests/regression/tools/health/test_thread_ok | ||
503 | index e84adb611..e5e23543f 100755 | ||
504 | --- a/tests/regression/tools/health/test_thread_ok | ||
505 | +++ b/tests/regression/tools/health/test_thread_ok | ||
506 | @@ -67,7 +67,7 @@ function test_thread_ok | ||
507 | $CURDIR/$HEALTH_CHECK_BIN > ${STDOUT_PATH} 2> ${STDERR_PATH} | ||
508 | report_errors | ||
509 | |||
510 | - skip $isroot "Root access is needed. Skipping kernel consumer health check test." "5" || | ||
511 | + check_skip_kernel_test "5" "Skipping kernel consumer health check test." || | ||
512 | { | ||
513 | diag "With kernel consumer daemon" | ||
514 | create_lttng_session_no_output $SESSION_NAME | ||
515 | @@ -115,13 +115,6 @@ STDERR_PATH=$(mktemp --tmpdir tmp.test_thread_ok_stderr_path.XXXXXX) | ||
516 | TRACE_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX) | ||
517 | HEALTH_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX) | ||
518 | |||
519 | -# The manage kernel thread is only spawned if we are root | ||
520 | -if [ "$(id -u)" == "0" ]; then | ||
521 | - isroot=1 | ||
522 | -else | ||
523 | - isroot=0 | ||
524 | -fi | ||
525 | - | ||
526 | test_thread_ok | ||
527 | |||
528 | rm -rf ${HEALTH_PATH} | ||
529 | diff --git a/tests/regression/tools/live/test_kernel b/tests/regression/tools/live/test_kernel | ||
530 | index b622b5214..fdaa09f0d 100755 | ||
531 | --- a/tests/regression/tools/live/test_kernel | ||
532 | +++ b/tests/regression/tools/live/test_kernel | ||
533 | @@ -39,13 +39,11 @@ function clean_live_tracing() | ||
534 | rm -rf $TRACE_PATH | ||
535 | } | ||
536 | |||
537 | -# Need root access for kernel tracing. | ||
538 | -if [ "$(id -u)" == "0" ]; then | ||
539 | - isroot=1 | ||
540 | -else | ||
541 | - plan_skip_all "Root access is needed. Skipping all tests." | ||
542 | +check_skip_kernel_test && | ||
543 | +{ | ||
544 | + plan_skip_all "Skipping all tests." | ||
545 | exit 0 | ||
546 | -fi | ||
547 | +} | ||
548 | |||
549 | modprobe lttng-test | ||
550 | |||
551 | diff --git a/tests/regression/tools/live/test_lttng_kernel b/tests/regression/tools/live/test_lttng_kernel | ||
552 | index a23d9373a..1b933648f 100755 | ||
553 | --- a/tests/regression/tools/live/test_lttng_kernel | ||
554 | +++ b/tests/regression/tools/live/test_lttng_kernel | ||
555 | @@ -45,13 +45,7 @@ function clean_live_tracing() | ||
556 | } | ||
557 | |||
558 | # Need root access for kernel tracing. | ||
559 | -if [ "$(id -u)" == "0" ]; then | ||
560 | - isroot=1 | ||
561 | -else | ||
562 | - isroot=0 | ||
563 | -fi | ||
564 | - | ||
565 | -skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || | ||
566 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
567 | { | ||
568 | modprobe lttng-test | ||
569 | |||
570 | diff --git a/tests/regression/tools/metadata/test_kernel b/tests/regression/tools/metadata/test_kernel | ||
571 | index 57cace6ea..26e95d93a 100755 | ||
572 | --- a/tests/regression/tools/metadata/test_kernel | ||
573 | +++ b/tests/regression/tools/metadata/test_kernel | ||
574 | @@ -91,13 +91,7 @@ plan_tests $NUM_TESTS | ||
575 | print_test_banner "$TEST_DESC" | ||
576 | |||
577 | |||
578 | -if [ "$(id -u)" == "0" ]; then | ||
579 | - isroot=1 | ||
580 | -else | ||
581 | - isroot=0 | ||
582 | -fi | ||
583 | - | ||
584 | -skip $isroot "Root access is needed. Skipping all kernel metadata tests." $NUM_TESTS || | ||
585 | +check_skip_kernel_test "$NUM_TESTS" "Skipping kernel metadata tests." || | ||
586 | { | ||
587 | validate_lttng_modules_present | ||
588 | modprobe lttng-test | ||
589 | diff --git a/tests/regression/tools/notification/test_notification_kernel_buffer_usage b/tests/regression/tools/notification/test_notification_kernel_buffer_usage | ||
590 | index 76e69a77e..8fdaabb3e 100755 | ||
591 | --- a/tests/regression/tools/notification/test_notification_kernel_buffer_usage | ||
592 | +++ b/tests/regression/tools/notification/test_notification_kernel_buffer_usage | ||
593 | @@ -60,29 +60,27 @@ function test_buffer_usage_notification | ||
594 | wait $APP_PID 2> /dev/null | ||
595 | } | ||
596 | |||
597 | -if [ "$(id -u)" == "0" ]; then | ||
598 | - | ||
599 | - validate_lttng_modules_present | ||
600 | - | ||
601 | +check_skip_kernel_test && | ||
602 | +{ | ||
603 | + plan_skip_all "Skipping all tests." | ||
604 | + rm -rf "$TEST_TMPDIR" | ||
605 | + exit 0 | ||
606 | +} | ||
607 | |||
608 | - modprobe lttng-test | ||
609 | +validate_lttng_modules_present | ||
610 | |||
611 | - # Used on sessiond launch. | ||
612 | - LTTNG_SESSIOND_ENV_VARS="LTTNG_TESTPOINT_ENABLE=1 \ | ||
613 | - CONSUMER_PAUSE_PIPE_PATH=${TESTPOINT_PIPE_PATH} \ | ||
614 | - LD_PRELOAD=${TESTPOINT}" | ||
615 | - start_lttng_sessiond_notap | ||
616 | +modprobe lttng-test | ||
617 | |||
618 | - test_buffer_usage_notification | ||
619 | +# Used on sessiond launch. | ||
620 | +LTTNG_SESSIOND_ENV_VARS="LTTNG_TESTPOINT_ENABLE=1 \ | ||
621 | + CONSUMER_PAUSE_PIPE_PATH=${TESTPOINT_PIPE_PATH} \ | ||
622 | + LD_PRELOAD=${TESTPOINT}" | ||
623 | +start_lttng_sessiond_notap | ||
624 | |||
625 | - stop_lttng_sessiond_notap | ||
626 | - rmmod lttng-test | ||
627 | +test_buffer_usage_notification | ||
628 | |||
629 | - rm -rf "${consumerd_pipe[@]}" 2> /dev/null | ||
630 | -else | ||
631 | - # Kernel tests are skipped. | ||
632 | - plan_tests $NUM_TESTS | ||
633 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
634 | -fi | ||
635 | +stop_lttng_sessiond_notap | ||
636 | +rmmod lttng-test | ||
637 | |||
638 | +rm -rf "${consumerd_pipe[@]}" 2> /dev/null | ||
639 | rm -rf "$TEST_TMPDIR" | ||
640 | diff --git a/tests/regression/tools/notification/test_notification_kernel_capture b/tests/regression/tools/notification/test_notification_kernel_capture | ||
641 | index 88f123d3d..0f8a2bc6f 100755 | ||
642 | --- a/tests/regression/tools/notification/test_notification_kernel_capture | ||
643 | +++ b/tests/regression/tools/notification/test_notification_kernel_capture | ||
644 | @@ -31,22 +31,21 @@ function test_basic_error_path | ||
645 | } | ||
646 | |||
647 | |||
648 | -if [ "$(id -u)" == "0" ]; then | ||
649 | - validate_lttng_modules_present | ||
650 | +check_skip_kernel_test && | ||
651 | +{ | ||
652 | + plan_skip_all "Skipping all tests." | ||
653 | + exit 0 | ||
654 | +} | ||
655 | |||
656 | - modprobe lttng-test | ||
657 | +validate_lttng_modules_present | ||
658 | |||
659 | - start_lttng_sessiond_notap | ||
660 | +modprobe lttng-test | ||
661 | |||
662 | - test_basic_error_path | ||
663 | +start_lttng_sessiond_notap | ||
664 | |||
665 | - stop_lttng_sessiond_notap | ||
666 | - rmmod lttng-test | ||
667 | +test_basic_error_path | ||
668 | |||
669 | -else | ||
670 | - # Kernel tests are skipped. | ||
671 | - plan_tests $NUM_TESTS | ||
672 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
673 | -fi | ||
674 | +stop_lttng_sessiond_notap | ||
675 | +rmmod lttng-test | ||
676 | |||
677 | rm -f "$TESTAPP_STATE_PATH" | ||
678 | diff --git a/tests/regression/tools/notification/test_notification_kernel_error b/tests/regression/tools/notification/test_notification_kernel_error | ||
679 | index 80fe6e5b5..b757ec2b4 100755 | ||
680 | --- a/tests/regression/tools/notification/test_notification_kernel_error | ||
681 | +++ b/tests/regression/tools/notification/test_notification_kernel_error | ||
682 | @@ -30,23 +30,22 @@ function test_basic_error_path | ||
683 | wait $APP_PID 2> /dev/null | ||
684 | } | ||
685 | |||
686 | +check_skip_kernel_test && | ||
687 | +{ | ||
688 | + plan_skip_all "Skipping all tests." | ||
689 | + exit 0 | ||
690 | +} | ||
691 | |||
692 | -if [ "$(id -u)" == "0" ]; then | ||
693 | - validate_lttng_modules_present | ||
694 | +validate_lttng_modules_present | ||
695 | |||
696 | - modprobe lttng-test | ||
697 | +modprobe lttng-test | ||
698 | |||
699 | - start_lttng_sessiond_notap | ||
700 | +start_lttng_sessiond_notap | ||
701 | |||
702 | - test_basic_error_path | ||
703 | +test_basic_error_path | ||
704 | |||
705 | - stop_lttng_sessiond_notap | ||
706 | - rmmod lttng-test | ||
707 | +stop_lttng_sessiond_notap | ||
708 | +rmmod lttng-test | ||
709 | |||
710 | -else | ||
711 | - # Kernel tests are skipped. | ||
712 | - plan_tests $NUM_TESTS | ||
713 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
714 | -fi | ||
715 | |||
716 | rm -f "$TESTAPP_STATE_PATH" | ||
717 | diff --git a/tests/regression/tools/notification/test_notification_kernel_instrumentation b/tests/regression/tools/notification/test_notification_kernel_instrumentation | ||
718 | index 90545a541..705f7703d 100755 | ||
719 | --- a/tests/regression/tools/notification/test_notification_kernel_instrumentation | ||
720 | +++ b/tests/regression/tools/notification/test_notification_kernel_instrumentation | ||
721 | @@ -28,22 +28,21 @@ function test_kernel_instrumentation_notification | ||
722 | wait $APP_PID 2> /dev/null | ||
723 | } | ||
724 | |||
725 | -if [ "$(id -u)" == "0" ]; then | ||
726 | - validate_lttng_modules_present | ||
727 | +check_skip_kernel_test && | ||
728 | +{ | ||
729 | + plan_skip_all "Skipping all tests." | ||
730 | + exit 0 | ||
731 | +} | ||
732 | |||
733 | - modprobe lttng-test | ||
734 | +validate_lttng_modules_present | ||
735 | |||
736 | - start_lttng_sessiond_notap | ||
737 | +modprobe lttng-test | ||
738 | |||
739 | - test_kernel_instrumentation_notification | ||
740 | +start_lttng_sessiond_notap | ||
741 | |||
742 | - stop_lttng_sessiond_notap | ||
743 | - rmmod lttng-test | ||
744 | +test_kernel_instrumentation_notification | ||
745 | |||
746 | -else | ||
747 | - # Kernel tests are skipped. | ||
748 | - plan_tests $NUM_TESTS | ||
749 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
750 | -fi | ||
751 | +stop_lttng_sessiond_notap | ||
752 | +rmmod lttng-test | ||
753 | |||
754 | rm -f "$TESTAPP_STATE_PATH" | ||
755 | diff --git a/tests/regression/tools/notification/test_notification_kernel_syscall b/tests/regression/tools/notification/test_notification_kernel_syscall | ||
756 | index d273cb55d..7fa235388 100755 | ||
757 | --- a/tests/regression/tools/notification/test_notification_kernel_syscall | ||
758 | +++ b/tests/regression/tools/notification/test_notification_kernel_syscall | ||
759 | @@ -31,19 +31,18 @@ function test_kernel_syscall_notification | ||
760 | wait $APP_PID 2> /dev/null | ||
761 | } | ||
762 | |||
763 | -if [ "$(id -u)" == "0" ]; then | ||
764 | - validate_lttng_modules_present | ||
765 | +check_skip_kernel_test && | ||
766 | +{ | ||
767 | + plan_skip_all "Skipping all tests." | ||
768 | + exit 0 | ||
769 | +} | ||
770 | |||
771 | - start_lttng_sessiond_notap | ||
772 | +validate_lttng_modules_present | ||
773 | |||
774 | - test_kernel_syscall_notification | ||
775 | +start_lttng_sessiond_notap | ||
776 | |||
777 | - stop_lttng_sessiond_notap | ||
778 | +test_kernel_syscall_notification | ||
779 | |||
780 | -else | ||
781 | - # Kernel tests are skipped. | ||
782 | - plan_tests $NUM_TESTS | ||
783 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
784 | -fi | ||
785 | +stop_lttng_sessiond_notap | ||
786 | |||
787 | rm -f "$TESTAPP_STATE_PATH" | ||
788 | diff --git a/tests/regression/tools/notification/test_notification_kernel_userspace_probe b/tests/regression/tools/notification/test_notification_kernel_userspace_probe | ||
789 | index 8ef8d708d..abddd9be7 100755 | ||
790 | --- a/tests/regression/tools/notification/test_notification_kernel_userspace_probe | ||
791 | +++ b/tests/regression/tools/notification/test_notification_kernel_userspace_probe | ||
792 | @@ -29,18 +29,18 @@ function test_kernel_userspace_probe_notification | ||
793 | wait $APP_PID 2> /dev/null | ||
794 | } | ||
795 | |||
796 | -if [ "$(id -u)" == "0" ]; then | ||
797 | - validate_lttng_modules_present | ||
798 | +check_skip_kernel_test && | ||
799 | +{ | ||
800 | + plan_skip_all "Skipping all tests." | ||
801 | + exit 0 | ||
802 | +} | ||
803 | + | ||
804 | +validate_lttng_modules_present | ||
805 | |||
806 | - start_lttng_sessiond_notap | ||
807 | +start_lttng_sessiond_notap | ||
808 | |||
809 | - test_kernel_userspace_probe_notification | ||
810 | +test_kernel_userspace_probe_notification | ||
811 | |||
812 | - stop_lttng_sessiond_notap | ||
813 | -else | ||
814 | - # Kernel tests are skipped. | ||
815 | - plan_tests $NUM_TESTS | ||
816 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $NUM_TESTS | ||
817 | -fi | ||
818 | +stop_lttng_sessiond_notap | ||
819 | |||
820 | rm -f "$TESTAPP_STATE_PATH" | ||
821 | diff --git a/tests/regression/tools/notification/test_notification_multi_app b/tests/regression/tools/notification/test_notification_multi_app | ||
822 | index d8b639225..61891b56f 100755 | ||
823 | --- a/tests/regression/tools/notification/test_notification_multi_app | ||
824 | +++ b/tests/regression/tools/notification/test_notification_multi_app | ||
825 | @@ -411,22 +411,18 @@ function test_on_register_evaluation () | ||
826 | rm -rf "$output_dir" | ||
827 | } | ||
828 | |||
829 | - | ||
830 | TESTS=( | ||
831 | test_multi_app_ust | ||
832 | test_on_register_evaluation_ust | ||
833 | ) | ||
834 | |||
835 | -if [ "$(id -u)" == "0" ]; then | ||
836 | +check_skip_kernel_test "$NUM_TEST_KERNEL" "Skipping kernel multi-app notification tests." || { | ||
837 | validate_lttng_modules_present | ||
838 | TESTS+=( | ||
839 | - test_multi_app_kernel | ||
840 | - test_on_register_evaluation_kernel | ||
841 | -) | ||
842 | -else | ||
843 | - skip 0 "Root access is needed. Skipping all kernel multi-app notification tests." $NUM_TEST_KERNEL | ||
844 | -fi | ||
845 | - | ||
846 | + test_multi_app_kernel | ||
847 | + test_on_register_evaluation_kernel | ||
848 | + ) | ||
849 | +} | ||
850 | |||
851 | for fct_test in ${TESTS[@]}; | ||
852 | do | ||
853 | diff --git a/tests/regression/tools/notification/test_notification_notifier_discarded_count b/tests/regression/tools/notification/test_notification_notifier_discarded_count | ||
854 | index c9235393e..a6c31a728 100755 | ||
855 | --- a/tests/regression/tools/notification/test_notification_notifier_discarded_count | ||
856 | +++ b/tests/regression/tools/notification/test_notification_notifier_discarded_count | ||
857 | @@ -391,7 +391,8 @@ function test_ust_notifier_discarded_regardless_trigger_owner | ||
858 | test_ust_notifier_discarded_count | ||
859 | test_ust_notifier_discarded_count_max_bucket | ||
860 | |||
861 | -if [ "$(id -u)" == "0" ]; then | ||
862 | +check_skip_kernel_test "$KERNEL_NUM_TESTS" "Skipping kernel notification tests." || | ||
863 | +{ | ||
864 | |||
865 | validate_lttng_modules_present | ||
866 | |||
867 | @@ -413,9 +414,7 @@ if [ "$(id -u)" == "0" ]; then | ||
868 | modprobe --remove lttng-test | ||
869 | |||
870 | rm -rf "${sessiond_pipe[@]}" 2> /dev/null | ||
871 | -else | ||
872 | - # Kernel tests are skipped. | ||
873 | - skip 0 "Root access is needed. Skipping all kernel notification tests." $KERNEL_NUM_TESTS | ||
874 | -fi | ||
875 | + | ||
876 | +} | ||
877 | |||
878 | rm -rf "$TEST_TMPDIR" | ||
879 | diff --git a/tests/regression/tools/regen-metadata/test_kernel b/tests/regression/tools/regen-metadata/test_kernel | ||
880 | index 49eea32a7..555a4e2ce 100755 | ||
881 | --- a/tests/regression/tools/regen-metadata/test_kernel | ||
882 | +++ b/tests/regression/tools/regen-metadata/test_kernel | ||
883 | @@ -99,13 +99,7 @@ plan_tests $NUM_TESTS | ||
884 | |||
885 | print_test_banner "$TEST_DESC" | ||
886 | |||
887 | -if [ "$(id -u)" == "0" ]; then | ||
888 | - isroot=1 | ||
889 | -else | ||
890 | - isroot=0 | ||
891 | -fi | ||
892 | - | ||
893 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
894 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
895 | { | ||
896 | validate_lttng_modules_present | ||
897 | |||
898 | diff --git a/tests/regression/tools/regen-statedump/test_kernel b/tests/regression/tools/regen-statedump/test_kernel | ||
899 | index 8a261355d..bbbac3942 100755 | ||
900 | --- a/tests/regression/tools/regen-statedump/test_kernel | ||
901 | +++ b/tests/regression/tools/regen-statedump/test_kernel | ||
902 | @@ -39,13 +39,7 @@ plan_tests $NUM_TESTS | ||
903 | |||
904 | print_test_banner "$TEST_DESC" | ||
905 | |||
906 | -if [ "$(id -u)" == "0" ]; then | ||
907 | - isroot=1 | ||
908 | -else | ||
909 | - isroot=0 | ||
910 | -fi | ||
911 | - | ||
912 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
913 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
914 | { | ||
915 | validate_lttng_modules_present | ||
916 | start_lttng_sessiond | ||
917 | diff --git a/tests/regression/tools/rotation/test_kernel b/tests/regression/tools/rotation/test_kernel | ||
918 | index f5f1f5553..efe3fd359 100755 | ||
919 | --- a/tests/regression/tools/rotation/test_kernel | ||
920 | +++ b/tests/regression/tools/rotation/test_kernel | ||
921 | @@ -82,13 +82,7 @@ plan_tests $NUM_TESTS | ||
922 | |||
923 | print_test_banner "$TEST_DESC" | ||
924 | |||
925 | -if [ "$(id -u)" == "0" ]; then | ||
926 | - isroot=1 | ||
927 | -else | ||
928 | - isroot=0 | ||
929 | -fi | ||
930 | - | ||
931 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
932 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
933 | { | ||
934 | validate_lttng_modules_present | ||
935 | |||
936 | diff --git a/tests/regression/tools/snapshots/test_kernel b/tests/regression/tools/snapshots/test_kernel | ||
937 | index abb243563..d91876867 100755 | ||
938 | --- a/tests/regression/tools/snapshots/test_kernel | ||
939 | +++ b/tests/regression/tools/snapshots/test_kernel | ||
940 | @@ -217,13 +217,7 @@ plan_tests $NUM_TESTS | ||
941 | |||
942 | print_test_banner "$TEST_DESC" | ||
943 | |||
944 | -if [ "$(id -u)" == "0" ]; then | ||
945 | - isroot=1 | ||
946 | -else | ||
947 | - isroot=0 | ||
948 | -fi | ||
949 | - | ||
950 | -skip $isroot "Root access is needed. Skipping all kernel snapshot tests" $NUM_TESTS || | ||
951 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
952 | { | ||
953 | |||
954 | validate_lttng_modules_present | ||
955 | diff --git a/tests/regression/tools/snapshots/test_kernel_streaming b/tests/regression/tools/snapshots/test_kernel_streaming | ||
956 | index 0c92dc710..dd965afee 100755 | ||
957 | --- a/tests/regression/tools/snapshots/test_kernel_streaming | ||
958 | +++ b/tests/regression/tools/snapshots/test_kernel_streaming | ||
959 | @@ -145,13 +145,7 @@ plan_tests $NUM_TESTS | ||
960 | |||
961 | print_test_banner "$TEST_DESC" | ||
962 | |||
963 | -if [ "$(id -u)" == "0" ]; then | ||
964 | - isroot=1 | ||
965 | -else | ||
966 | - isroot=0 | ||
967 | -fi | ||
968 | - | ||
969 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests" $NUM_TESTS || | ||
970 | +check_skip_kernel_test $NUM_TESTS "Skipping all tests." || | ||
971 | { | ||
972 | validate_lttng_modules_present | ||
973 | |||
974 | diff --git a/tests/regression/tools/streaming/test_high_throughput_limits b/tests/regression/tools/streaming/test_high_throughput_limits | ||
975 | index 2b9e3ad39..c55d51098 100755 | ||
976 | --- a/tests/regression/tools/streaming/test_high_throughput_limits | ||
977 | +++ b/tests/regression/tools/streaming/test_high_throughput_limits | ||
978 | @@ -170,13 +170,7 @@ plan_tests $NUM_TESTS | ||
979 | |||
980 | print_test_banner "$TEST_DESC" | ||
981 | |||
982 | -if [ "$(id -u)" == "0" ]; then | ||
983 | - isroot=1 | ||
984 | -else | ||
985 | - isroot=0 | ||
986 | -fi | ||
987 | - | ||
988 | -skip $isroot "Root access is needed to set bandwith limits. Skipping all tests." $NUM_TESTS || | ||
989 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
990 | { | ||
991 | |||
992 | # Catch sigint and try to cleanup limits | ||
993 | diff --git a/tests/regression/tools/streaming/test_kernel b/tests/regression/tools/streaming/test_kernel | ||
994 | index 33334229f..113eea7bf 100755 | ||
995 | --- a/tests/regression/tools/streaming/test_kernel | ||
996 | +++ b/tests/regression/tools/streaming/test_kernel | ||
997 | @@ -47,13 +47,7 @@ plan_tests $NUM_TESTS | ||
998 | |||
999 | print_test_banner "$TEST_DESC" | ||
1000 | |||
1001 | -if [ "$(id -u)" == "0" ]; then | ||
1002 | - isroot=1 | ||
1003 | -else | ||
1004 | - isroot=0 | ||
1005 | -fi | ||
1006 | - | ||
1007 | -skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_TESTS || | ||
1008 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || | ||
1009 | { | ||
1010 | validate_lttng_modules_present | ||
1011 | |||
1012 | diff --git a/tests/regression/tools/tracker/test_event_tracker b/tests/regression/tools/tracker/test_event_tracker | ||
1013 | index cc0f698d2..de0c79d36 100755 | ||
1014 | --- a/tests/regression/tools/tracker/test_event_tracker | ||
1015 | +++ b/tests/regression/tools/tracker/test_event_tracker | ||
1016 | @@ -466,13 +466,7 @@ test_event_track_untrack ust 0 "${EVENT_NAME}" "--pid --all" # backward compat | ||
1017 | test_event_tracker ust 1 "${EVENT_NAME}" "--pid --all" # backward compat | ||
1018 | test_event_pid_tracker ust 1 "${EVENT_NAME}" | ||
1019 | |||
1020 | -if [ "$(id -u)" == "0" ]; then | ||
1021 | - isroot=1 | ||
1022 | -else | ||
1023 | - isroot=0 | ||
1024 | -fi | ||
1025 | - | ||
1026 | -skip $isroot "Root access is needed. Skipping all kernel tracker tests." $NUM_KERNEL_TESTS || | ||
1027 | +check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel tracker tests." || | ||
1028 | { | ||
1029 | diag "Test kernel tracker" | ||
1030 | |||
1031 | diff --git a/tests/regression/tools/trigger/test_add_trigger_cli b/tests/regression/tools/trigger/test_add_trigger_cli | ||
1032 | index 98ecf6272..d1763aa2e 100755 | ||
1033 | --- a/tests/regression/tools/trigger/test_add_trigger_cli | ||
1034 | +++ b/tests/regression/tools/trigger/test_add_trigger_cli | ||
1035 | @@ -34,12 +34,6 @@ tmp_stdout=$(mktemp --tmpdir -t test_parse_cli_trigger_stdout.XXXXXX) | ||
1036 | tmp_stderr=$(mktemp --tmpdir -t test_parse_cli_trigger_stderr.XXXXXX) | ||
1037 | uprobe_elf_binary="${TESTDIR}/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary" | ||
1038 | |||
1039 | -if [ "$(id -u)" == "0" ]; then | ||
1040 | - ist_root=1 | ||
1041 | -else | ||
1042 | - ist_root=0 | ||
1043 | -fi | ||
1044 | - | ||
1045 | function test_success () | ||
1046 | { | ||
1047 | local test_name="$1" | ||
1048 | @@ -223,7 +217,7 @@ test_success "--exclude-name two" "trigger5" \ | ||
1049 | --condition event-rule-matches --type=user --name='jean-*' --exclude-name jean-chretien -x jean-charest \ | ||
1050 | --action notify | ||
1051 | |||
1052 | -skip $ist_root "non-root user: skipping kprobe tests" 18 || { | ||
1053 | +check_skip_kernel_test 18 "Skipping kprobe tests." || { | ||
1054 | i=0 | ||
1055 | |||
1056 | for type in kprobe kernel:kprobe; do | ||
1057 | @@ -262,7 +256,7 @@ skip $ist_root "non-root user: skipping kprobe tests" 18 || { | ||
1058 | done | ||
1059 | } | ||
1060 | |||
1061 | -skip $ist_root "non-root user: skipping uprobe tests" 6 || { | ||
1062 | +check_skip_kernel_test 6 "Skipping uprobe tests." || { | ||
1063 | test_success "--condition event-rule-matches uprobe" "uprobe-trigger-0" \ | ||
1064 | --name="uprobe-trigger-0" \ | ||
1065 | --condition event-rule-matches --type=kernel:uprobe --location=${uprobe_elf_binary}:test_function --event-name=ma-probe \ | ||
1066 | @@ -274,7 +268,7 @@ skip $ist_root "non-root user: skipping uprobe tests" 6 || { | ||
1067 | --action notify | ||
1068 | } | ||
1069 | |||
1070 | -skip $ist_root "non-root user: skipping syscall tests" 30 || { | ||
1071 | +check_skip_kernel_test 30 "Skipping syscall tests." || { | ||
1072 | test_success "--condition event-rule-matches one syscall" "syscall-trigger-0" \ | ||
1073 | --name="syscall-trigger-0" \ | ||
1074 | --condition event-rule-matches --type=syscall --name=open \ | ||
1075 | diff --git a/tests/regression/tools/trigger/test_list_triggers_cli b/tests/regression/tools/trigger/test_list_triggers_cli | ||
1076 | index a04018013..02c3de3e9 100755 | ||
1077 | --- a/tests/regression/tools/trigger/test_list_triggers_cli | ||
1078 | +++ b/tests/regression/tools/trigger/test_list_triggers_cli | ||
1079 | @@ -36,22 +36,12 @@ uprobe_sdt_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-sdt-binar | ||
1080 | register_some_triggers_bin=$(realpath "${CURDIR}/utils/register-some-triggers") | ||
1081 | |||
1082 | uid=$(id --user) | ||
1083 | -gid=$(id --group) | ||
1084 | |||
1085 | -if [ "$uid" == "0" ]; then | ||
1086 | - ist_root=1 | ||
1087 | - ls "$uprobe_sdt_binary" >/dev/null 2>&1 | ||
1088 | - if test $? == 0; then | ||
1089 | - hast_sdt_binary=1 | ||
1090 | - else | ||
1091 | - hast_sdt_binary=0 | ||
1092 | - fi | ||
1093 | -else | ||
1094 | - ist_root=0 | ||
1095 | - hast_sdt_binary=0 | ||
1096 | +sdt_binary_present=0 | ||
1097 | +if [ -f "$uprobe_sdt_binary" ]; then | ||
1098 | + sdt_binary_present=1 | ||
1099 | fi | ||
1100 | |||
1101 | - | ||
1102 | test_top_level_options () | ||
1103 | { | ||
1104 | diag "Listing top level options" | ||
1105 | @@ -2695,10 +2685,12 @@ start_lttng_sessiond_notap | ||
1106 | |||
1107 | test_top_level_options | ||
1108 | test_event_rule_matches_tracepoint | ||
1109 | -skip $ist_root "non-root user: skipping kprobe tests" 13 || test_event_rule_matches_probe | ||
1110 | -skip $ist_root "non-root user: skipping uprobe tests" 9 || test_event_rule_matches_userspace_probe_elf | ||
1111 | -skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt | ||
1112 | -skip $ist_root "non-root user: skipping syscall tests" 17 || test_event_rule_matches_syscall | ||
1113 | +check_skip_kernel_test 48 "Skipping kprobe, uprobe, SDT and syscall tests." || { | ||
1114 | + test_event_rule_matches_probe | ||
1115 | + test_event_rule_matches_userspace_probe_elf | ||
1116 | + skip $sdt_binary_present "No SDT binary. Skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt | ||
1117 | + test_event_rule_matches_syscall | ||
1118 | +} | ||
1119 | test_session_consumed_size_condition | ||
1120 | test_buffer_usage_conditions | ||
1121 | test_session_rotation_conditions | ||
1122 | diff --git a/tests/regression/tools/wildcard/test_event_wildcard b/tests/regression/tools/wildcard/test_event_wildcard | ||
1123 | index f69baffc4..14d9bb88a 100755 | ||
1124 | --- a/tests/regression/tools/wildcard/test_event_wildcard | ||
1125 | +++ b/tests/regression/tools/wildcard/test_event_wildcard | ||
1126 | @@ -124,13 +124,7 @@ test_event_wildcard ust 1 'tp*tptest' | ||
1127 | test_event_wildcard ust 1 'tp**tptest' | ||
1128 | test_event_wildcard ust 1 'tp*test' | ||
1129 | |||
1130 | -if [ "$(id -u)" == "0" ]; then | ||
1131 | - isroot=1 | ||
1132 | -else | ||
1133 | - isroot=0 | ||
1134 | -fi | ||
1135 | - | ||
1136 | -skip $isroot "Root access is needed. Skipping all kernel wildcard tests." $NUM_KERNEL_TESTS || | ||
1137 | +check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel wildcard tests." || | ||
1138 | { | ||
1139 | diag "Test kernel wildcards" | ||
1140 | |||
1141 | diff --git a/tests/regression/tools/working-directory/test_relayd_working_directory b/tests/regression/tools/working-directory/test_relayd_working_directory | ||
1142 | index c7e784cca..6bd1e504a 100755 | ||
1143 | --- a/tests/regression/tools/working-directory/test_relayd_working_directory | ||
1144 | +++ b/tests/regression/tools/working-directory/test_relayd_working_directory | ||
1145 | @@ -145,9 +145,9 @@ function test_relayd_debug_permission() | ||
1146 | diag "Test lttng-relayd change working directory on non writable directory" | ||
1147 | |||
1148 | if [ "$(id -u)" == "0" ]; then | ||
1149 | - is_user=0 | ||
1150 | + is_user=0 | ||
1151 | else | ||
1152 | - is_user=1 | ||
1153 | + is_user=1 | ||
1154 | fi | ||
1155 | |||
1156 | skip $is_user "Skipping permission debug output test; operation can't fail as root" 6 || | ||
1157 | diff --git a/tests/regression/ust/namespaces/test_ns_contexts_change b/tests/regression/ust/namespaces/test_ns_contexts_change | ||
1158 | index 8a4b62ce3..622241f7b 100755 | ||
1159 | --- a/tests/regression/ust/namespaces/test_ns_contexts_change | ||
1160 | +++ b/tests/regression/ust/namespaces/test_ns_contexts_change | ||
1161 | @@ -101,12 +101,7 @@ plan_tests $NUM_TESTS | ||
1162 | |||
1163 | print_test_banner "$TEST_DESC" | ||
1164 | |||
1165 | -isroot=0 | ||
1166 | -if [ "$(id -u)" == "0" ]; then | ||
1167 | - isroot=1 | ||
1168 | -fi | ||
1169 | - | ||
1170 | -skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" && exit 0 | ||
1171 | +check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." && exit 0 | ||
1172 | |||
1173 | system_has_ns=0 | ||
1174 | if [ -d "/proc/$$/ns" ]; then | ||
1175 | diff --git a/tests/regression/ust/test_event_perf b/tests/regression/ust/test_event_perf | ||
1176 | index 33aab2981..178959a19 100755 | ||
1177 | --- a/tests/regression/ust/test_event_perf | ||
1178 | +++ b/tests/regression/ust/test_event_perf | ||
1179 | @@ -119,17 +119,11 @@ plan_tests $NUM_TESTS | ||
1180 | |||
1181 | print_test_banner "$TEST_DESC" | ||
1182 | |||
1183 | -if [ "$(id -u)" == "0" ]; then | ||
1184 | - isroot=1 | ||
1185 | -else | ||
1186 | - isroot=0 | ||
1187 | -fi | ||
1188 | - | ||
1189 | start_lttng_sessiond | ||
1190 | |||
1191 | test_parsing_raw | ||
1192 | |||
1193 | -skip $isroot "Root access is needed. Skipping UST perf tests." 8 || | ||
1194 | +check_skip_kernel_test 8 "Skipping UST perf tests." || | ||
1195 | { | ||
1196 | test_event_basic | ||
1197 | } | ||
1198 | diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh | ||
1199 | index faa87e783..da0e0569d 100644 | ||
1200 | --- a/tests/utils/utils.sh | ||
1201 | +++ b/tests/utils/utils.sh | ||
1202 | @@ -318,6 +318,41 @@ function conf_proc_count() | ||
1203 | echo | ||
1204 | } | ||
1205 | |||
1206 | +# Usage: | ||
1207 | +# check_skip_kernel_test [NB_TESTS] [SKIP_MESSAGE] | ||
1208 | +# Return 0 if LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set or the current user is not a root user | ||
1209 | +# If NB_TESTS is set, call skip() to skip number of tests. | ||
1210 | +# If NB_TESTS is empty, just output a reason with diag. | ||
1211 | +# An optional message can be added. | ||
1212 | + | ||
1213 | +function check_skip_kernel_test () | ||
1214 | +{ | ||
1215 | + local num_tests="$1" | ||
1216 | + local skip_message="$2" | ||
1217 | + | ||
1218 | + # Check for skip test kernel flag | ||
1219 | + if [ "$LTTNG_TOOLS_DISABLE_KERNEL_TESTS" == "1" ]; then | ||
1220 | + if ! test -z "$num_tests"; then | ||
1221 | + skip 0 "LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set.${skip_message+ }${skip_message}" "$num_tests" | ||
1222 | + else | ||
1223 | + diag "LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set.${skip_message+ }${skip_message}" | ||
1224 | + fi | ||
1225 | + return 0 | ||
1226 | + fi | ||
1227 | + | ||
1228 | + # Check if we are running as root | ||
1229 | + if [ "$(id -u)" != "0" ]; then | ||
1230 | + if ! test -z "$num_tests"; then | ||
1231 | + skip 0 "Root access is needed for kernel testing.${skip_message+ }${skip_message}" "$num_tests" | ||
1232 | + else | ||
1233 | + diag "Root access is needed for kernel testing.${skip_message+ }${skip_message}" | ||
1234 | + fi | ||
1235 | + return 0 | ||
1236 | + fi | ||
1237 | + | ||
1238 | + return 1 | ||
1239 | +} | ||
1240 | + | ||
1241 | # Check if base lttng-modules are present. | ||
1242 | # Bail out on failure | ||
1243 | function validate_lttng_modules_present () | ||
1244 | -- | ||
1245 | 2.25.1 | ||
1246 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch index 2d08b08879..2f95889c4b 100644 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch +++ b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-do-not-strip-a-helper-library.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From ab238c213fac190972f55e73cf3e0bb1c7846eb8 Mon Sep 17 00:00:00 2001 | 1 | From 2237748af00467ad8250a7ccd944200f811db69a Mon Sep 17 00:00:00 2001 |
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
3 | Date: Thu, 12 Dec 2019 16:52:07 +0100 | 3 | Date: Thu, 12 Dec 2019 16:52:07 +0100 |
4 | Subject: [PATCH] tests: do not strip a helper library | 4 | Subject: [PATCH] tests: do not strip a helper library |
@@ -10,10 +10,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | |||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | 10 | 1 file changed, 1 insertion(+), 1 deletion(-) |
11 | 11 | ||
12 | diff --git a/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am b/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | 12 | diff --git a/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am b/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am |
13 | index 03f5d5a..d12c343 100644 | 13 | index 836f13e..e19a554 100644 |
14 | --- a/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | 14 | --- a/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am |
15 | +++ b/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | 15 | +++ b/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am |
16 | @@ -12,7 +12,7 @@ userspace_probe_elf_binary_LDADD = libfoo.la | 16 | @@ -14,7 +14,7 @@ userspace_probe_elf_binary_LDADD = libfoo.la |
17 | libfoo.strip: libfoo.la | 17 | libfoo.strip: libfoo.la |
18 | $(OBJCOPY) --strip-all .libs/libfoo.so | 18 | $(OBJCOPY) --strip-all .libs/libfoo.so |
19 | 19 | ||
@@ -22,6 +22,3 @@ index 03f5d5a..d12c343 100644 | |||
22 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ | 22 | @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ |
23 | for script in $(EXTRA_DIST); do \ | 23 | for script in $(EXTRA_DIST); do \ |
24 | cp -f $(srcdir)/$$script $(builddir); \ | 24 | cp -f $(srcdir)/$$script $(builddir); \ |
25 | -- | ||
26 | 2.17.1 | ||
27 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-regression-disable-the-tools-live-tests.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-tests-regression-disable-the-tools-live-tests.patch deleted file mode 100644 index 08c1423310..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-tests-regression-disable-the-tools-live-tests.patch +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | From de9fc501e775cae05f1f87534b4237cd78e8d9a8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Fri, 24 Jan 2020 18:03:25 +0100 | ||
4 | Subject: [PATCH] tests/regression: disable the tools/live tests | ||
5 | |||
6 | They have been found to sporadically fail; the issue has been | ||
7 | reported upstream and they will work to investigate and fix: | ||
8 | https://bugs.lttng.org/issues/1217 | ||
9 | |||
10 | Upstream-Status: Inappropriate [upstream is working on a real fix] | ||
11 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
12 | |||
13 | --- | ||
14 | tests/regression/Makefile.am | 10 +--------- | ||
15 | 1 file changed, 1 insertion(+), 9 deletions(-) | ||
16 | |||
17 | diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am | ||
18 | index cbac90d..d467886 100644 | ||
19 | --- a/tests/regression/Makefile.am | ||
20 | +++ b/tests/regression/Makefile.am | ||
21 | @@ -11,16 +11,10 @@ TESTS = tools/filtering/test_invalid_filter \ | ||
22 | tools/filtering/test_valid_filter \ | ||
23 | tools/streaming/test_ust \ | ||
24 | tools/health/test_thread_ok \ | ||
25 | - tools/live/test_ust \ | ||
26 | - tools/live/test_ust_tracefile_count \ | ||
27 | - tools/live/test_lttng_ust \ | ||
28 | tools/tracefile-limits/test_tracefile_count \ | ||
29 | tools/tracefile-limits/test_tracefile_size \ | ||
30 | - tools/exclusion/test_exclusion \ | ||
31 | tools/snapshots/test_ust_fast \ | ||
32 | - tools/snapshots/test_ust_streaming \ | ||
33 | tools/save-load/test_save \ | ||
34 | - tools/save-load/test_load \ | ||
35 | tools/save-load/test_autoload \ | ||
36 | tools/mi/test_mi \ | ||
37 | tools/wildcard/test_event_wildcard \ | ||
38 | @@ -38,8 +32,7 @@ TESTS = tools/filtering/test_invalid_filter \ | ||
39 | tools/working-directory/test_relayd_working_directory \ | ||
40 | tools/notification/test_notification_multi_app \ | ||
41 | tools/clear/test_ust \ | ||
42 | - tools/clear/test_kernel \ | ||
43 | - tools/tracker/test_event_tracker | ||
44 | + tools/clear/test_kernel | ||
45 | |||
46 | if HAVE_LIBLTTNG_UST_CTL | ||
47 | SUBDIRS += ust | ||
48 | @@ -60,7 +53,6 @@ TESTS += ust/before-after/test_before_after \ | ||
49 | ust/multi-lib/test_multi_lib \ | ||
50 | ust/rotation-destroy-flush/test_rotation_destroy_flush \ | ||
51 | ust/namespaces/test_ns_contexts \ | ||
52 | - ust/namespaces/test_ns_contexts_change \ | ||
53 | tools/metadata/test_ust \ | ||
54 | tools/relayd-grouping/test_ust | ||
55 | endif # HAVE_LIBLTTNG_UST_CTL | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/determinism.patch b/meta/recipes-kernel/lttng/lttng-tools/determinism.patch deleted file mode 100644 index b2ab880bd6..0000000000 --- a/meta/recipes-kernel/lttng/lttng-tools/determinism.patch +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | This is a bit ugly. Specifing abs_builddir as an RPATH is plain wrong when | ||
2 | cross compiling. Sadly, removing the rpath makes libtool/automake do | ||
3 | weird things and breaks the build as shared libs are no longer generated. | ||
4 | |||
5 | We already try and delete the RPATH at do_install with chrpath however | ||
6 | that does leave the path in the string table so it doesn't help us | ||
7 | with reproducibility. | ||
8 | |||
9 | Instead, hack in a bogus but harmless path, then delete it later in | ||
10 | our do_install. Ultimately we may want to pass a specific path to use | ||
11 | to configure if we really do need to set an RPATH at all. It is unclear | ||
12 | to me whether the tests need that or not. | ||
13 | |||
14 | Fixes reproducibility issues for lttng-tools. | ||
15 | |||
16 | Upstream-Status: Pending [needs discussion with upstream about the correct solution] | ||
17 | RP 2021/3/1 | ||
18 | |||
19 | Index: lttng-tools-2.12.2/tests/regression/ust/ust-dl/Makefile.am | ||
20 | =================================================================== | ||
21 | --- lttng-tools-2.12.2.orig/tests/regression/ust/ust-dl/Makefile.am | ||
22 | +++ lttng-tools-2.12.2/tests/regression/ust/ust-dl/Makefile.am | ||
23 | @@ -27,16 +27,16 @@ noinst_LTLIBRARIES = libzzz.la libbar.la | ||
24 | |||
25 | libzzz_la_SOURCES = libzzz.c libzzz.h | ||
26 | libzzz_la_LDFLAGS = -module -shared -avoid-version \ | ||
27 | - -rpath $(abs_builddir) | ||
28 | + -rpath /usr/lib | ||
29 | |||
30 | libbar_la_SOURCES = libbar.c libbar.h | ||
31 | libbar_la_LDFLAGS = -module -shared -avoid-version \ | ||
32 | - -rpath $(abs_builddir) | ||
33 | + -rpath /usr/lib | ||
34 | libbar_la_LIBADD = libzzz.la | ||
35 | |||
36 | libfoo_la_SOURCES = libfoo.c libfoo.h | ||
37 | libfoo_la_LDFLAGS = -module -shared -avoid-version \ | ||
38 | - -rpath $(abs_builddir) | ||
39 | + -rpath /usr/lib | ||
40 | libfoo_la_LIBADD = libbar.la | ||
41 | |||
42 | CLEANFILES = libfoo.so libfoo.so.debug libbar.so libbar.so.debug \ | ||
43 | @@ -44,7 +44,7 @@ CLEANFILES = libfoo.so libfoo.so.debug l | ||
44 | |||
45 | libtp_la_SOURCES = libbar-tp.h libbar-tp.c libfoo-tp.h libfoo-tp.c \ | ||
46 | libzzz-tp.h libzzz-tp.c | ||
47 | -libtp_la_LDFLAGS = -module -shared -rpath $(abs_builddir) | ||
48 | +libtp_la_LDFLAGS = -module -shared -rpath /usr/lib | ||
49 | |||
50 | # Extract debug symbols | ||
51 | libfoo.so.debug: libfoo.la | ||
52 | Index: lttng-tools-2.12.2/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | ||
53 | =================================================================== | ||
54 | --- lttng-tools-2.12.2.orig/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | ||
55 | +++ lttng-tools-2.12.2/tests/utils/testapp/userspace-probe-elf-binary/Makefile.am | ||
56 | @@ -5,7 +5,7 @@ AM_CFLAGS += -O0 | ||
57 | noinst_LTLIBRARIES = libfoo.la | ||
58 | |||
59 | libfoo_la_SOURCES = foo.c foo.h | ||
60 | -libfoo_la_LDFLAGS = -shared -module -avoid-version -rpath $(abs_builddir)/.libs/ | ||
61 | +libfoo_la_LDFLAGS = -shared -module -avoid-version -rpath /usr/lib | ||
62 | |||
63 | noinst_PROGRAMS = userspace-probe-elf-binary | ||
64 | userspace_probe_elf_binary_SOURCES = userspace-probe-elf-binary.c | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch b/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch new file mode 100644 index 0000000000..3a77ea2e43 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-tools/disable-tests.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | Upstream-Status: Inappropriate [need to root cause the test hangs] | ||
2 | |||
3 | We keep seeing hangs in the tools/notifications tests on x86 and arm for | ||
4 | a variety of distros. Exclude them for now to work out if this is the | ||
5 | only place we see them and give SWAT/triage a break from the stream | ||
6 | of them. | ||
7 | |||
8 | https://bugzilla.yoctoproject.org/show_bug.cgi?id=14263 | ||
9 | |||
10 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
11 | |||
12 | Index: lttng-tools-2.13.1/tests/regression/Makefile.am | ||
13 | =================================================================== | ||
14 | --- lttng-tools-2.13.1.orig/tests/regression/Makefile.am | ||
15 | +++ lttng-tools-2.13.1/tests/regression/Makefile.am | ||
16 | @@ -29,18 +29,6 @@ TESTS = tools/base-path/test_ust \ | ||
17 | tools/crash/test_crash \ | ||
18 | tools/regen-metadata/test_ust \ | ||
19 | tools/regen-statedump/test_ust \ | ||
20 | - tools/notification/test_notification_ust_error \ | ||
21 | - tools/notification/test_notification_ust_buffer_usage \ | ||
22 | - tools/notification/test_notification_ust_capture \ | ||
23 | - tools/notification/test_notification_ust_event_rule_condition_exclusion \ | ||
24 | - tools/notification/test_notification_kernel_error \ | ||
25 | - tools/notification/test_notification_kernel_buffer_usage \ | ||
26 | - tools/notification/test_notification_kernel_capture \ | ||
27 | - tools/notification/test_notification_kernel_instrumentation \ | ||
28 | - tools/notification/test_notification_kernel_syscall \ | ||
29 | - tools/notification/test_notification_notifier_discarded_count \ | ||
30 | - tools/notification/test_notification_kernel_userspace_probe \ | ||
31 | - tools/notification/test_notification_multi_app \ | ||
32 | tools/rotation/test_ust \ | ||
33 | tools/rotation/test_kernel \ | ||
34 | tools/rotation/test_save_load_mi \ | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/meta/recipes-kernel/lttng/lttng-tools/run-ptest index eaa2e7b29d..39d93e2bbf 100755 --- a/meta/recipes-kernel/lttng/lttng-tools/run-ptest +++ b/meta/recipes-kernel/lttng/lttng-tools/run-ptest | |||
@@ -1,6 +1,45 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # Without --ignore-exit, the tap harness causes any FAILs within a | 2 | # Without --ignore-exit, the tap harness causes any FAILs within a |
3 | # test plan to raise ERRORs; this is just noise. | 3 | # test plan to raise ERRORs; this is just noise. |
4 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD" | 4 | |
5 | make -k -t all >/dev/null 2>&1 | 5 | #Detecting whether current system has lttng kernel modules |
6 | exec make -k -s $makeargs check 2>/dev/null | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g' | 6 | LTTNG_KMOD_PATH=/lib/modules/$(uname -r)/kernel/lttng-modules/lttng-tracer.ko |
7 | function validate_lttng_modules_present() | ||
8 | { | ||
9 | # Check for loadable modules. | ||
10 | if [ -f "$LTTNG_KMOD_PATH" ]; then | ||
11 | return 0 | ||
12 | fi | ||
13 | |||
14 | # Check for builtin modules. | ||
15 | ls /proc/lttng > /dev/null 2>&1 | ||
16 | if [ $? -eq 0 ]; then | ||
17 | return 0 | ||
18 | fi | ||
19 | |||
20 | return 1 | ||
21 | } | ||
22 | |||
23 | export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs | ||
24 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=FIXMEPTESTPATH top_builddir=FIXMEPTESTPATH" | ||
25 | |||
26 | #If current system doesn't have lttng kernel modules, disable lttng kernel related tests. | ||
27 | validate_lttng_modules_present || { | ||
28 | makeargs="$makeargs LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1" | ||
29 | } | ||
30 | |||
31 | make -k -t all >error.log 2>&1 | ||
32 | # Can specify a test e.g.: | ||
33 | # -C tests/regression/ check TESTS='kernel/test_callstack' | ||
34 | make -k -s $makeargs check 2>error.log | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g' | ||
35 | exitcode=$? | ||
36 | if [ -e error.log ]; then | ||
37 | cat error.log | ||
38 | fi | ||
39 | if [ -e tests/unit/test-suite.log ]; then | ||
40 | cat tests/unit/test-suite.log | ||
41 | fi | ||
42 | if [ -e tests/regression/test-suite.log ]; then | ||
43 | cat tests/regression/test-suite.log | ||
44 | fi | ||
45 | exit $exitcode | ||
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.12.2.bb b/meta/recipes-kernel/lttng/lttng-tools_2.13.13.bb index 52bfd36370..174dec036e 100644 --- a/meta/recipes-kernel/lttng/lttng-tools_2.12.2.bb +++ b/meta/recipes-kernel/lttng/lttng-tools_2.13.13.bb | |||
@@ -5,27 +5,27 @@ to extract program execution details from the Linux operating system \ | |||
5 | and interpret them." | 5 | and interpret them." |
6 | HOMEPAGE = "https://github.com/lttng/lttng-tools" | 6 | HOMEPAGE = "https://github.com/lttng/lttng-tools" |
7 | 7 | ||
8 | LICENSE = "GPLv2 & LGPLv2.1" | 8 | LICENSE = "GPL-2.0-only & LGPL-2.1-only" |
9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \ | 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=40ef17463fbd6f377db3c47b1cbaded8 \ |
10 | file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \ | 10 | file://LICENSES/GPL-2.0;md5=e68f69a54b44ba526ad7cb963e18fbce \ |
11 | file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95" | 11 | file://LICENSES/LGPL-2.1;md5=9920968d0f2ff585ce61fae30344dd95" |
12 | 12 | ||
13 | include lttng-platforms.inc | 13 | include lttng-platforms.inc |
14 | 14 | ||
15 | DEPENDS = "liburcu popt libxml2 util-linux" | 15 | DEPENDS = "liburcu popt libxml2 util-linux bison-native" |
16 | RDEPENDS_${PN} = "libgcc" | 16 | RDEPENDS:${PN} = "libgcc" |
17 | RRECOMMENDS_${PN} += "${LTTNGMODULES}" | 17 | RRECOMMENDS:${PN} += "${LTTNGMODULES}" |
18 | RDEPENDS_${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core" | 18 | RDEPENDS:${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod ${LTTNGMODULES} sed python3-core grep binutils" |
19 | RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" | 19 | RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" |
20 | RDEPENDS_${PN}-ptest_append_libc-musl = " musl-utils" | 20 | RDEPENDS:${PN}-ptest:append:libc-musl = " musl-utils" |
21 | # babelstats.pl wants getopt-long | 21 | # babelstats.pl wants getopt-long |
22 | RDEPENDS_${PN}-ptest += "perl-module-getopt-long" | 22 | RDEPENDS:${PN}-ptest += "perl-module-getopt-long" |
23 | 23 | ||
24 | PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ | 24 | PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ |
25 | am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ | 25 | am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ |
26 | PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ | 26 | PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ |
27 | " | 27 | " |
28 | PACKAGECONFIG ??= "${LTTNGUST}" | 28 | PACKAGECONFIG ??= "${LTTNGUST} kmod" |
29 | PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native" | 29 | PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native" |
30 | PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust" | 30 | PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust" |
31 | PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod" | 31 | PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod" |
@@ -35,48 +35,59 @@ SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ | |||
35 | file://0001-tests-do-not-strip-a-helper-library.patch \ | 35 | file://0001-tests-do-not-strip-a-helper-library.patch \ |
36 | file://run-ptest \ | 36 | file://run-ptest \ |
37 | file://lttng-sessiond.service \ | 37 | file://lttng-sessiond.service \ |
38 | file://0001-tests-regression-disable-the-tools-live-tests.patch \ | 38 | file://disable-tests.patch \ |
39 | file://determinism.patch \ | 39 | file://0001-compat-Define-off64_t-as-off_t-on-linux.patch \ |
40 | file://0001-tests-add-check_skip_kernel_test-to-check-root-user-.patch \ | ||
41 | file://0001-Fix-rotation-destroy-flush-fix-session-daemon-abort-.patch \ | ||
40 | " | 42 | " |
41 | 43 | ||
42 | SRC_URI[sha256sum] = "9ed9161795ff023b076f9f95afaa4f1f822ec42495c0fa04c586ab8fa74e84f1" | 44 | SRC_URI[sha256sum] = "ff5f4f00b081dac66092afe8e72b7c790670931cf1c1ee0deaa7f80fbc53883e" |
43 | 45 | ||
44 | inherit autotools ptest pkgconfig useradd python3-dir manpages systemd | 46 | inherit autotools ptest pkgconfig useradd python3-dir manpages systemd |
45 | 47 | ||
46 | SYSTEMD_SERVICE_${PN} = "lttng-sessiond.service" | 48 | CACHED_CONFIGUREVARS = "PGREP=/usr/bin/pgrep" |
49 | |||
50 | SYSTEMD_SERVICE:${PN} = "lttng-sessiond.service" | ||
47 | SYSTEMD_AUTO_ENABLE = "disable" | 51 | SYSTEMD_AUTO_ENABLE = "disable" |
48 | 52 | ||
49 | USERADD_PACKAGES = "${PN}" | 53 | USERADD_PACKAGES = "${PN}" |
50 | GROUPADD_PARAM_${PN} = "tracing" | 54 | GROUPADD_PARAM:${PN} = "tracing" |
51 | 55 | ||
52 | FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \ | 56 | FILES:${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \ |
53 | ${PYTHON_SITEPACKAGES_DIR}/*" | 57 | ${PYTHON_SITEPACKAGES_DIR}/*" |
54 | FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" | 58 | FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" |
55 | FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" | 59 | FILES:${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" |
56 | 60 | ||
57 | # Since files are installed into ${libdir}/lttng/libexec we match | 61 | # Since files are installed into ${libdir}/lttng/libexec we match |
58 | # the libexec insane test so skip it. | 62 | # the libexec insane test so skip it. |
59 | # Python module needs to keep _lttng.so | 63 | # Python module needs to keep _lttng.so |
60 | INSANE_SKIP_${PN} = "libexec dev-so" | 64 | INSANE_SKIP:${PN} = "libexec dev-so" |
61 | INSANE_SKIP_${PN}-dbg = "libexec" | 65 | INSANE_SKIP:${PN}-dbg = "libexec" |
62 | 66 | ||
63 | PRIVATE_LIBS_${PN}-ptest = "libfoo.so" | 67 | PRIVATE_LIBS:${PN}-ptest = "libfoo.so" |
64 | 68 | ||
65 | do_install_append () { | 69 | do_install:append () { |
66 | # install systemd unit file | 70 | # install systemd unit file |
67 | install -d ${D}${systemd_unitdir}/system | 71 | install -d ${D}${systemd_system_unitdir} |
68 | install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_unitdir}/system | 72 | install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_system_unitdir} |
69 | } | 73 | } |
70 | 74 | ||
71 | do_install_ptest () { | 75 | do_install_ptest () { |
72 | for f in Makefile tests/Makefile tests/utils/utils.sh tests/regression/tools/save-load/load-42*.lttng tests/regression/tools/save-load/configuration/load-42*.lttng tests/regression/tools/health/test_health.sh tests/regression/tools/metadata/utils.sh tests/regression/tools/rotation/rotate_utils.sh; do | 76 | for f in Makefile tests/Makefile tests/utils/utils.sh tests/regression/tools/save-load/*.lttng \ |
77 | tests/regression/tools/save-load/configuration/load-42*.lttng tests/regression/tools/health/test_health.sh \ | ||
78 | tests/regression/tools/metadata/utils.sh tests/regression/tools/rotation/rotate_utils.sh \ | ||
79 | tests/regression/tools/notification/util_event_generator.sh \ | ||
80 | tests/regression/tools/base-path/*.lttng; do | ||
73 | install -D "${B}/$f" "${D}${PTEST_PATH}/$f" | 81 | install -D "${B}/$f" "${D}${PTEST_PATH}/$f" |
74 | done | 82 | done |
75 | 83 | ||
76 | for f in config/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-4.0.xsd; do | 84 | for f in tests/utils/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-4.1.xsd; do |
77 | install -D "${S}/$f" "${D}${PTEST_PATH}/$f" | 85 | install -D "${S}/$f" "${D}${PTEST_PATH}/$f" |
78 | done | 86 | done |
79 | 87 | ||
88 | # Patch in the correct path for the custom libraries a helper executable needs | ||
89 | sed -i -e 's!FIXMEPTESTPATH!${PTEST_PATH}!g' "${D}${PTEST_PATH}/run-ptest" | ||
90 | |||
80 | # Prevent 'make check' from recursing into non-test subdirectories. | 91 | # Prevent 'make check' from recursing into non-test subdirectories. |
81 | sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile" | 92 | sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile" |
82 | 93 | ||
@@ -104,7 +115,7 @@ do_install_ptest () { | |||
104 | for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do | 115 | for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do |
105 | cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f | 116 | cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f |
106 | case $f in | 117 | case $f in |
107 | *.so) | 118 | *.so|userspace-probe-elf-*) |
108 | install -d ${D}${PTEST_PATH}/tests/$d/ | 119 | install -d ${D}${PTEST_PATH}/tests/$d/ |
109 | ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f | 120 | ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f |
110 | # Remove any rpath/runpath to pass QA check. | 121 | # Remove any rpath/runpath to pass QA check. |
@@ -115,6 +126,7 @@ do_install_ptest () { | |||
115 | done | 126 | done |
116 | 127 | ||
117 | chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary | 128 | chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary |
129 | chrpath --delete ${D}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary | ||
118 | chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libbar.so | 130 | chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libbar.so |
119 | chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libfoo.so | 131 | chrpath --delete ${D}${PTEST_PATH}/tests/regression/ust/ust-dl/libfoo.so |
120 | 132 | ||
@@ -155,7 +167,7 @@ do_install_ptest () { | |||
155 | -i ${D}${PTEST_PATH}/tests/unit/Makefile | 167 | -i ${D}${PTEST_PATH}/tests/unit/Makefile |
156 | 168 | ||
157 | # Fix hardcoded build path | 169 | # Fix hardcoded build path |
158 | sed -e 's#TESTAPP_PATH=.*/tests/regression/#TESTAPP_PATH=${PTEST_PATH}/tests/regression/#' \ | 170 | sed -e 's#TESTAPP_PATH=.*/tests/regression/#TESTAPP_PATH="${PTEST_PATH}/tests/regression/#' \ |
159 | -i ${D}${PTEST_PATH}/tests/regression/ust/python-logging/test_python_logging | 171 | -i ${D}${PTEST_PATH}/tests/regression/ust/python-logging/test_python_logging |
160 | 172 | ||
161 | # Substitute links to installed binaries. | 173 | # Substitute links to installed binaries. |
@@ -172,3 +184,14 @@ do_install_ptest () { | |||
172 | esac | 184 | esac |
173 | done | 185 | done |
174 | } | 186 | } |
187 | |||
188 | INHIBIT_PACKAGE_STRIP_FILES = "\ | ||
189 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary \ | ||
190 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary \ | ||
191 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary \ | ||
192 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/userspace-probe-elf-cxx-binary/.libs/userspace-probe-elf-cxx-binary \ | ||
193 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events/gen-syscall-events \ | ||
194 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events/.libs/gen-syscall-events \ | ||
195 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack \ | ||
196 | ${PKGD}${PTEST_PATH}/tests/utils/testapp/gen-syscall-events-callstack/.libs/gen-syscall-events-callstack \ | ||
197 | " | ||
diff --git a/meta/recipes-kernel/lttng/lttng-ust/0001-Makefile.am-update-rpath-link.patch b/meta/recipes-kernel/lttng/lttng-ust/0001-Makefile.am-update-rpath-link.patch new file mode 100644 index 0000000000..6aca8f85fa --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-ust/0001-Makefile.am-update-rpath-link.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 7d053804ab3823d40ae10d90f4efc49dbfb4cb66 Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Wed, 22 Sep 2021 16:33:10 +0800 | ||
4 | Subject: [PATCH] Makefile.am: update rpath link | ||
5 | |||
6 | since commit 6339062 Move liblttng-ust to 'src/lib/', | ||
7 | liblttng-ust.so/liblttng-ust-common.so/liblttng-ust-tracepoint.so | ||
8 | 's location changed from one dir to multiple dirs. which make below | ||
9 | error: | ||
10 | ld: warning: liblttng-ust-common.so.1, needed by ../../../src/lib/lttng-ust/.libs/liblttng-ust.so, not found (try using -rpath or -rpath-link) | ||
11 | ld: warning: liblttng-ust-tracepoint.so.1, needed by ../../../src/lib/lttng-ust/.libs/liblttng-ust.so, not found (try using -rpath or -rpath-link) | ||
12 | |||
13 | Upstream-Status: Submitted [https://github.com/lttng/lttng-ust/pull/61] | ||
14 | |||
15 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
16 | |||
17 | --- | ||
18 | doc/examples/Makefile.am | 2 +- | ||
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am | ||
22 | index 57782cc..d46caa6 100644 | ||
23 | --- a/doc/examples/Makefile.am | ||
24 | +++ b/doc/examples/Makefile.am | ||
25 | @@ -167,7 +167,7 @@ all-local: | ||
26 | CFLAGS='$(CFLAGS)' \ | ||
27 | AM_CFLAGS='$(AM_CFLAGS)' \ | ||
28 | LDFLAGS="$(LDFLAGS)" \ | ||
29 | - AM_LDFLAGS='$(AM_LDFLAGS) -L../../../src/lib/lttng-ust/.libs -Wl,-rpath="$(PWD)/../../src/lib/lttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../src/lib/lttng-ust/.libs/"' \ | ||
30 | + AM_LDFLAGS='$(AM_LDFLAGS) -L../../../src/lib/lttng-ust/.libs -Wl,-rpath="$(PWD)/../../src/lib/lttng-ust/.libs/" -Wl,-rpath-link="$(PWD)/../../src/lib/lttng-ust/.libs/:$(PWD)/../../src/lib/lttng-ust-tracepoint/.libs:$(PWD)/../../src/lib/lttng-ust-common/.libs/"' \ | ||
31 | LTTNG_GEN_TP_PATH="$$rel_src_subdir$(top_srcdir)/tools/" \ | ||
32 | AM_V_P="$(AM_V_P)" \ | ||
33 | AM_V_at="$(AM_V_at)" \ | ||
diff --git a/meta/recipes-kernel/lttng/lttng-ust/0001-lttng-ust-common-link-with-liburcu-explicitly.patch b/meta/recipes-kernel/lttng/lttng-ust/0001-lttng-ust-common-link-with-liburcu-explicitly.patch new file mode 100644 index 0000000000..e85dbdb439 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-ust/0001-lttng-ust-common-link-with-liburcu-explicitly.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 27402453f25fbdb5a9fb1a1b88d1c4d9852187d2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex@linutronix.de> | ||
3 | Date: Sun, 5 Sep 2021 10:44:19 +0200 | ||
4 | Subject: [PATCH] lttng-ust-common: link with liburcu explicitly | ||
5 | |||
6 | Otherwise linking errors are seen on x86-32. | ||
7 | |||
8 | Upstream-Status: Submitted [by email to lttng-dev, Francis, Jonathan] | ||
9 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
10 | |||
11 | --- | ||
12 | src/lib/lttng-ust-common/Makefile.am | 1 + | ||
13 | 1 file changed, 1 insertion(+) | ||
14 | |||
15 | diff --git a/src/lib/lttng-ust-common/Makefile.am b/src/lib/lttng-ust-common/Makefile.am | ||
16 | index 1ccc290..6531fa0 100644 | ||
17 | --- a/src/lib/lttng-ust-common/Makefile.am | ||
18 | +++ b/src/lib/lttng-ust-common/Makefile.am | ||
19 | @@ -16,6 +16,7 @@ liblttng_ust_common_la_SOURCES = \ | ||
20 | |||
21 | liblttng_ust_common_la_LIBADD = \ | ||
22 | $(top_builddir)/src/common/libcommon.la \ | ||
23 | + $(URCU_LIBS) \ | ||
24 | $(DL_LIBS) | ||
25 | |||
26 | liblttng_ust_common_la_LDFLAGS = -no-undefined -version-info $(LTTNG_UST_LIBRARY_VERSION) | ||
diff --git a/meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch b/meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch index c2028d0e1a..7c49583e0d 100644 --- a/meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch +++ b/meta/recipes-kernel/lttng/lttng-ust/0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch | |||
@@ -1,6 +1,6 @@ | |||
1 | From f79dac30af9adda12996da7f6aa6667d3b580537 Mon Sep 17 00:00:00 2001 | 1 | From f65efd963e52de51d35e2e03fb773f33dd64f565 Mon Sep 17 00:00:00 2001 |
2 | From: Robert Yang <liezhi.yang@windriver.com> | 2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> |
3 | Date: Thu, 26 Sep 2019 17:54:00 +0800 | 3 | Date: Tue, 20 Feb 2024 12:19:06 +0000 |
4 | Subject: [PATCH] python-lttngust/Makefile.am: Add --install-lib to setup.py | 4 | Subject: [PATCH] python-lttngust/Makefile.am: Add --install-lib to setup.py |
5 | 5 | ||
6 | Otherwise it may install to /usr/lib, but should be /usr/lib64 when cross | 6 | Otherwise it may install to /usr/lib, but should be /usr/lib64 when cross |
@@ -9,23 +9,21 @@ building. | |||
9 | Upstream-Status: Submitted [https://github.com/lttng/lttng-ust/pull/59] | 9 | Upstream-Status: Submitted [https://github.com/lttng/lttng-ust/pull/59] |
10 | 10 | ||
11 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | 11 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> |
12 | |||
12 | --- | 13 | --- |
13 | python-lttngust/Makefile.am | 2 +- | 14 | src/python-lttngust/Makefile.am | 2 +- |
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
15 | 16 | ||
16 | diff --git a/python-lttngust/Makefile.am b/python-lttngust/Makefile.am | 17 | diff --git a/src/python-lttngust/Makefile.am b/src/python-lttngust/Makefile.am |
17 | index 6c0d20d..38b51b8 100644 | 18 | index d53e21d..283901e 100644 |
18 | --- a/python-lttngust/Makefile.am | 19 | --- a/src/python-lttngust/Makefile.am |
19 | +++ b/python-lttngust/Makefile.am | 20 | +++ b/src/python-lttngust/Makefile.am |
20 | @@ -9,7 +9,7 @@ install-exec-local: | 21 | @@ -45,7 +45,7 @@ install-exec-local: build-python-bindings.stamp |
21 | if [ "$(DESTDIR)" != "" ]; then \ | 22 | if [ "$(DESTDIR)" != "" ]; then \ |
22 | opts="$$opts --root=$(DESTDIR)"; \ | 23 | opts="$$opts --root=$(DESTDIR)"; \ |
23 | fi; \ | 24 | fi; \ |
24 | - $(PYTHON) setup.py install $$opts; | 25 | - $(PYTHON) $(builddir)/setup.py install $(PY_INSTALL_OPTS) $$opts; |
25 | + $(PYTHON) setup.py install $$opts --install-lib=$(pythondir); | 26 | + $(PYTHON) $(builddir)/setup.py install $(PY_INSTALL_OPTS) $$opts --install-lib=$(pythondir); |
26 | 27 | ||
27 | clean-local: | 28 | clean-local: |
28 | rm -rf $(builddir)/build | 29 | rm -rf $(builddir)/build |
29 | -- | ||
30 | 2.7.4 | ||
31 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-ust_2.12.1.bb b/meta/recipes-kernel/lttng/lttng-ust_2.13.8.bb index 67b53cbbba..dddd3a5004 100644 --- a/meta/recipes-kernel/lttng/lttng-ust_2.12.1.bb +++ b/meta/recipes-kernel/lttng/lttng-ust_2.13.8.bb | |||
@@ -3,38 +3,38 @@ DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library t | |||
3 | HOMEPAGE = "http://lttng.org/ust" | 3 | HOMEPAGE = "http://lttng.org/ust" |
4 | BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust" | 4 | BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust" |
5 | 5 | ||
6 | LICENSE = "LGPLv2.1+ & MIT & GPLv2" | 6 | LICENSE = "LGPL-2.1-or-later & MIT & GPL-2.0-only" |
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \ | 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=a46577a38ad0c36ff6ff43ccf40c480f" |
8 | file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \ | ||
9 | file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44" | ||
10 | 8 | ||
11 | PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ | 9 | PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ |
12 | am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ | 10 | am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ |
13 | PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ | 11 | PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ |
14 | " | 12 | " |
15 | 13 | ||
16 | inherit autotools lib_package manpages python3native | 14 | inherit autotools lib_package manpages python3native pkgconfig |
17 | 15 | ||
18 | include lttng-platforms.inc | 16 | include lttng-platforms.inc |
19 | 17 | ||
20 | EXTRA_OECONF = "--disable-numa" | 18 | EXTRA_OECONF = "--disable-numa" |
19 | CPPFLAGS:append:arm = "${@oe.utils.vartrue('DEBUG_BUILD', '-DUATOMIC_NO_LINK_ERROR', '', d)}" | ||
21 | 20 | ||
22 | DEPENDS = "liburcu util-linux" | 21 | DEPENDS = "liburcu util-linux" |
23 | RDEPENDS_${PN}-bin = "python3-core" | 22 | RDEPENDS:${PN}-bin = "python3-core" |
24 | 23 | ||
25 | # For backwards compatibility after rename | 24 | # For backwards compatibility after rename |
26 | RPROVIDES_${PN} = "lttng2-ust" | 25 | RPROVIDES:${PN} = "lttng2-ust" |
27 | RREPLACES_${PN} = "lttng2-ust" | 26 | RREPLACES:${PN} = "lttng2-ust" |
28 | RCONFLICTS_${PN} = "lttng2-ust" | 27 | RCONFLICTS:${PN} = "lttng2-ust" |
29 | 28 | ||
30 | PE = "2" | 29 | PE = "2" |
31 | 30 | ||
32 | SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \ | 31 | SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \ |
33 | file://0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch \ | 32 | file://0001-python-lttngust-Makefile.am-Add-install-lib-to-setup.patch \ |
33 | file://0001-lttng-ust-common-link-with-liburcu-explicitly.patch \ | ||
34 | file://0001-Makefile.am-update-rpath-link.patch \ | ||
34 | " | 35 | " |
35 | 36 | ||
36 | SRC_URI[md5sum] = "11787d1df69b04dd7431614ab43b2e12" | 37 | SRC_URI[sha256sum] = "d4ef98dab9a37ad4f524ccafdfd50af4f266039b528dd5afabce78e49024d937" |
37 | SRC_URI[sha256sum] = "48a3948b168195123a749d22818809bd25127bb5f1a66458c3c012b210d2a051" | ||
38 | 38 | ||
39 | CVE_PRODUCT = "ust" | 39 | CVE_PRODUCT = "ust" |
40 | 40 | ||
@@ -42,11 +42,11 @@ PACKAGECONFIG[examples] = "--enable-examples, --disable-examples," | |||
42 | PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" | 42 | PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" |
43 | PACKAGECONFIG[python3-agent] = "--enable-python-agent ${PYTHON_OPTION}, --disable-python-agent, python3, python3" | 43 | PACKAGECONFIG[python3-agent] = "--enable-python-agent ${PYTHON_OPTION}, --disable-python-agent, python3, python3" |
44 | 44 | ||
45 | FILES_${PN} += " ${PYTHON_SITEPACKAGES_DIR}/*" | 45 | FILES:${PN} += " ${PYTHON_SITEPACKAGES_DIR}/*" |
46 | FILES_${PN}-staticdev += " ${PYTHON_SITEPACKAGES_DIR}/*.a" | 46 | FILES:${PN}-staticdev += " ${PYTHON_SITEPACKAGES_DIR}/*.a" |
47 | FILES_${PN}-dev += " ${PYTHON_SITEPACKAGES_DIR}/*.la" | 47 | FILES:${PN}-dev += " ${PYTHON_SITEPACKAGES_DIR}/*.la" |
48 | 48 | ||
49 | do_install_append() { | 49 | do_install:append() { |
50 | # Patch python tools to use Python 3; they should be source compatible, but | 50 | # Patch python tools to use Python 3; they should be source compatible, but |
51 | # still refer to Python 2 in the shebang | 51 | # still refer to Python 2 in the shebang |
52 | sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp | 52 | sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp |