diff options
Diffstat (limited to 'meta/recipes-kernel/systemtap')
6 files changed, 95 insertions, 109 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap-native_git.bb b/meta/recipes-kernel/systemtap/systemtap-native_git.bb index 19cc1cf0f0..2690b259c8 100644 --- a/meta/recipes-kernel/systemtap/systemtap-native_git.bb +++ b/meta/recipes-kernel/systemtap/systemtap-native_git.bb | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | require systemtap_git.bb | 2 | require systemtap_git.bb |
3 | 3 | ||
4 | inherit native | 4 | inherit_defer native |
5 | 5 | ||
6 | addtask addto_recipe_sysroot after do_populate_sysroot before do_build | 6 | addtask addto_recipe_sysroot after do_populate_sysroot before do_build |
diff --git a/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb b/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb deleted file mode 100644 index 46820ef489..0000000000 --- a/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | SUMMARY = "UProbes kernel module for SystemTap" | ||
2 | |||
3 | require systemtap_git.inc | ||
4 | |||
5 | DEPENDS = "systemtap virtual/kernel" | ||
6 | |||
7 | # On systems without CONFIG_UTRACE, this package is empty. | ||
8 | ALLOW_EMPTY_${PN} = "1" | ||
9 | |||
10 | inherit module-base gettext | ||
11 | |||
12 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:" | ||
13 | |||
14 | FILES_${PN} += "${datadir}/systemtap/runtime/uprobes" | ||
15 | |||
16 | # Compile and install the uprobes kernel module on machines with utrace | ||
17 | # support. Note that staprun expects it in the systemtap/runtime directory, | ||
18 | # not in /lib/modules. | ||
19 | do_compile() { | ||
20 | if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config | ||
21 | then | ||
22 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP | ||
23 | oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ | ||
24 | AR="${KERNEL_AR}" \ | ||
25 | -C ${STAGING_KERNEL_DIR} scripts | ||
26 | oe_runmake KDIR=${STAGING_KERNEL_DIR} \ | ||
27 | M="${S}/runtime/uprobes/" \ | ||
28 | CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ | ||
29 | AR="${KERNEL_AR}" \ | ||
30 | -C "${S}/runtime/uprobes/" | ||
31 | fi | ||
32 | } | ||
33 | |||
34 | do_install() { | ||
35 | if [ -e "${S}/runtime/uprobes/uprobes.ko" ] | ||
36 | then | ||
37 | install -d ${D}${datadir}/systemtap/runtime/uprobes/ | ||
38 | install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/ | ||
39 | fi | ||
40 | } | ||
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-staprun-address-ncurses-6.3-failures.patch b/meta/recipes-kernel/systemtap/systemtap/0001-staprun-address-ncurses-6.3-failures.patch new file mode 100644 index 0000000000..1decf21593 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-staprun-address-ncurses-6.3-failures.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 191f528da19193d713d94ee252e2485efd9af4d3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex@linutronix.de> | ||
3 | Date: Mon, 25 Oct 2021 17:59:24 +0200 | ||
4 | Subject: [PATCH] staprun: address ncurses 6.3 failures | ||
5 | |||
6 | Upstream-Status: Submitted [by email to smakarov@redhat.com,systemtap@sourceware.org] | ||
7 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
8 | --- | ||
9 | staprun/monitor.c | 24 ++++++++++++------------ | ||
10 | 1 file changed, 12 insertions(+), 12 deletions(-) | ||
11 | |||
12 | diff --git a/staprun/monitor.c b/staprun/monitor.c | ||
13 | index 478634c09..f4fbfd686 100644 | ||
14 | --- a/staprun/monitor.c | ||
15 | +++ b/staprun/monitor.c | ||
16 | @@ -448,12 +448,12 @@ void monitor_render(void) | ||
17 | if (active_window == 0) | ||
18 | wattron(status, A_BOLD); | ||
19 | wprintw(status, "\n%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%s\n", | ||
20 | - width[p_index], HIGHLIGHT("index", p_index, comp_fn_index), | ||
21 | - width[p_state], HIGHLIGHT("state", p_state, comp_fn_index), | ||
22 | - width[p_hits], HIGHLIGHT("hits", p_hits, comp_fn_index), | ||
23 | - width[p_min], HIGHLIGHT("min", p_min, comp_fn_index), | ||
24 | - width[p_avg], HIGHLIGHT("avg", p_avg, comp_fn_index), | ||
25 | - width[p_max], HIGHLIGHT("max", p_max, comp_fn_index), | ||
26 | + (int)width[p_index], HIGHLIGHT("index", p_index, comp_fn_index), | ||
27 | + (int)width[p_state], HIGHLIGHT("state", p_state, comp_fn_index), | ||
28 | + (int)width[p_hits], HIGHLIGHT("hits", p_hits, comp_fn_index), | ||
29 | + (int)width[p_min], HIGHLIGHT("min", p_min, comp_fn_index), | ||
30 | + (int)width[p_avg], HIGHLIGHT("avg", p_avg, comp_fn_index), | ||
31 | + (int)width[p_max], HIGHLIGHT("max", p_max, comp_fn_index), | ||
32 | HIGHLIGHT("name", p_name, comp_fn_index)); | ||
33 | if (active_window == 0) | ||
34 | wattroff(status, A_BOLD); | ||
35 | @@ -466,17 +466,17 @@ void monitor_render(void) | ||
36 | json_object *probe, *field; | ||
37 | probe = json_object_array_get_idx(jso_probe_list, i); | ||
38 | json_object_object_get_ex(probe, "index", &field); | ||
39 | - wprintw(status, "%*s\t", width[p_index], json_object_get_string(field)); | ||
40 | + wprintw(status, "%*s\t", (int)width[p_index], json_object_get_string(field)); | ||
41 | json_object_object_get_ex(probe, "state", &field); | ||
42 | - wprintw(status, "%*s\t", width[p_state], json_object_get_string(field)); | ||
43 | + wprintw(status, "%*s\t", (int)width[p_state], json_object_get_string(field)); | ||
44 | json_object_object_get_ex(probe, "hits", &field); | ||
45 | - wprintw(status, "%*s\t", width[p_hits], json_object_get_string(field)); | ||
46 | + wprintw(status, "%*s\t", (int)width[p_hits], json_object_get_string(field)); | ||
47 | json_object_object_get_ex(probe, "min", &field); | ||
48 | - wprintw(status, "%*s\t", width[p_min], json_object_get_string(field)); | ||
49 | + wprintw(status, "%*s\t", (int)width[p_min], json_object_get_string(field)); | ||
50 | json_object_object_get_ex(probe, "avg", &field); | ||
51 | - wprintw(status, "%*s\t", width[p_avg], json_object_get_string(field)); | ||
52 | + wprintw(status, "%*s\t", (int)width[p_avg], json_object_get_string(field)); | ||
53 | json_object_object_get_ex(probe, "max", &field); | ||
54 | - wprintw(status, "%*s\t", width[p_max], json_object_get_string(field)); | ||
55 | + wprintw(status, "%*s\t", (int)width[p_max], json_object_get_string(field)); | ||
56 | getyx(status, discard, cur_x); | ||
57 | json_object_object_get_ex(probe, "name", &field); | ||
58 | wprintw(status, "%.*s", max_cols-cur_x-1, json_object_get_string(field)); | ||
59 | -- | ||
60 | 2.20.1 | ||
61 | |||
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-transport-protect-include-and-callsite-with-same-con.patch b/meta/recipes-kernel/systemtap/systemtap/0001-transport-protect-include-and-callsite-with-same-con.patch deleted file mode 100644 index efc79f6c0f..0000000000 --- a/meta/recipes-kernel/systemtap/systemtap/0001-transport-protect-include-and-callsite-with-same-con.patch +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | From cbf27cd54071f788231e69d96dbaad563f1010d4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Fri, 18 Dec 2020 13:15:08 -0500 | ||
4 | Subject: [PATCH] transport: protect include and callsite with same conditional | ||
5 | |||
6 | transport.c has the following code block: | ||
7 | |||
8 | if (!debugfs_p && security_locked_down (LOCKDOWN_DEBUGFS)) | ||
9 | |||
10 | Which is protected by the conditional STAPCONF_LOCKDOWN_DEBUGFS. | ||
11 | |||
12 | linux/security.h provides the definition of LOCKDOWN_DEBUGFS, and | ||
13 | must be included or we have a compilation issue. | ||
14 | |||
15 | The include of security.h is protected by #ifdef CONFIG_SECURITY_LOCKDOWN_LSM, | ||
16 | which means that in some configurations we can get out of sync with | ||
17 | the include and the callsite. | ||
18 | |||
19 | If we protect the include and the callsite with the same #ifdef, we can | ||
20 | be sure that they will be consistent. | ||
21 | |||
22 | Upstream-status: Inappropriate (kernel-devsrc specific) | ||
23 | |||
24 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
25 | --- | ||
26 | runtime/transport/transport.c | 2 +- | ||
27 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
28 | |||
29 | diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c | ||
30 | index bb4a98bd3..88e20ea28 100644 | ||
31 | --- a/runtime/transport/transport.c | ||
32 | +++ b/runtime/transport/transport.c | ||
33 | @@ -21,7 +21,7 @@ | ||
34 | #include <linux/namei.h> | ||
35 | #include <linux/delay.h> | ||
36 | #include <linux/mutex.h> | ||
37 | -#ifdef CONFIG_SECURITY_LOCKDOWN_LSM | ||
38 | +#ifdef STAPCONF_LOCKDOWN_DEBUGFS | ||
39 | #include <linux/security.h> | ||
40 | #endif | ||
41 | #include "../uidgid_compatibility.h" | ||
42 | -- | ||
43 | 2.19.1 | ||
44 | |||
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb index 923d64b975..68f5c76428 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.bb +++ b/meta/recipes-kernel/systemtap/systemtap_git.bb | |||
@@ -1,9 +1,15 @@ | |||
1 | SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux" | 1 | SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux" |
2 | DESCRIPTION = "It provides free software infrastructure to simplify the \ | ||
3 | gathering of information about the running Linux system. This assists \ | ||
4 | diagnosis of a performance or functional problem." | ||
2 | HOMEPAGE = "https://sourceware.org/systemtap/" | 5 | HOMEPAGE = "https://sourceware.org/systemtap/" |
3 | 6 | ||
4 | require systemtap_git.inc | 7 | require systemtap_git.inc |
5 | 8 | ||
6 | SRC_URI += "file://0001-improve-reproducibility-for-c-compiling.patch" | 9 | SRC_URI += " \ |
10 | file://0001-improve-reproducibility-for-c-compiling.patch \ | ||
11 | file://0001-staprun-address-ncurses-6.3-failures.patch \ | ||
12 | " | ||
7 | 13 | ||
8 | DEPENDS = "elfutils" | 14 | DEPENDS = "elfutils" |
9 | 15 | ||
@@ -18,58 +24,62 @@ STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs" | |||
18 | 24 | ||
19 | EXTRA_OECONF += "${STAP_DOCS} " | 25 | EXTRA_OECONF += "${STAP_DOCS} " |
20 | 26 | ||
21 | PACKAGECONFIG ??= "translator sqlite monitor python3-probes" | 27 | PACKAGECONFIG ??= "translator sqlite monitor python3-probes ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}" |
22 | PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash" | 28 | PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash" |
23 | PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt" | 29 | PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt" |
24 | PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3" | 30 | PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3" |
25 | PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c" | 31 | PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c" |
26 | PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native" | 32 | PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native" |
33 | PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod" | ||
27 | 34 | ||
28 | inherit autotools gettext pkgconfig systemd | 35 | inherit autotools gettext pkgconfig systemd |
29 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'distutils3-base', '', d)} | 36 | inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)} |
37 | |||
38 | # | ../git/elaborate.cxx:2601:21: error: storing the address of local variable 'sym' in '*s.systemtap_session::symbol_resolver' [-Werror=dangling-pointer=] | ||
39 | CXXFLAGS += "-Wno-dangling-pointer" | ||
30 | 40 | ||
31 | # exporter comes with python3-probes | 41 | # exporter comes with python3-probes |
32 | PACKAGES =+ "${PN}-exporter" | 42 | PACKAGES =+ "${PN}-exporter" |
33 | FILES_${PN}-exporter = "${sysconfdir}/stap-exporter/* \ | 43 | FILES:${PN}-exporter = "${sysconfdir}/stap-exporter/* \ |
34 | ${sysconfdir}/sysconfig/stap-exporter \ | 44 | ${sysconfdir}/sysconfig/stap-exporter \ |
35 | ${systemd_unitdir}/system/stap-exporter.service \ | 45 | ${systemd_system_unitdir}/stap-exporter.service \ |
36 | ${sbindir}/stap-exporter" | 46 | ${sbindir}/stap-exporter" |
37 | RDEPENDS_${PN}-exporter = "${PN} python3-core python3-netclient" | 47 | RDEPENDS:${PN}-exporter = "${PN} python3-core python3-netclient" |
38 | SYSTEMD_SERVICE_${PN}-exporter = "stap-exporter.service" | 48 | SYSTEMD_SERVICE:${PN}-exporter = "stap-exporter.service" |
39 | 49 | ||
40 | PACKAGES =+ "${PN}-runtime" | 50 | PACKAGES =+ "${PN}-runtime" |
41 | FILES_${PN}-runtime = "\ | 51 | FILES:${PN}-runtime = "\ |
42 | ${bindir}/staprun \ | 52 | ${bindir}/staprun \ |
43 | ${bindir}/stap-merge \ | 53 | ${bindir}/stap-merge \ |
44 | ${bindir}/stapsh \ | 54 | ${bindir}/stapsh \ |
45 | ${libexecdir}/${BPN}/stapio \ | 55 | ${libexecdir}/${BPN}/stapio \ |
46 | " | 56 | " |
47 | RDEPENDS_${PN}_class-target += "${PN}-runtime" | 57 | RDEPENDS:${PN}:class-target += "${PN}-runtime" |
48 | 58 | ||
49 | PACKAGES =+ "${PN}-examples" | 59 | PACKAGES =+ "${PN}-examples" |
50 | FILES_${PN}-examples = "${datadir}/${BPN}/examples/" | 60 | FILES:${PN}-examples = "${datadir}/${BPN}/examples/" |
51 | RDEPENDS_${PN}-examples += "${PN}" | 61 | RDEPENDS:${PN}-examples += "${PN}" |
52 | 62 | ||
53 | # don't complain that some examples involve bash, perl, php... | 63 | # don't complain that some examples involve bash, perl, php... |
54 | INSANE_SKIP_${PN}-examples += "file-rdeps" | 64 | INSANE_SKIP:${PN}-examples += "file-rdeps" |
55 | 65 | ||
56 | PACKAGES =+ "${PN}-python" | 66 | PACKAGES =+ "${PN}-python" |
57 | FILES_${PN}-python += "\ | 67 | FILES:${PN}-python += "\ |
58 | ${bindir}/dtrace \ | 68 | ${bindir}/dtrace \ |
59 | ${libdir}/python*/ \ | 69 | ${libdir}/python*/ \ |
60 | ${libexecdir}/${BPN}/python/ \ | 70 | ${libexecdir}/${BPN}/python/ \ |
61 | " | 71 | " |
62 | # python material requires sdt headers | 72 | # python material requires sdt headers |
63 | RDEPENDS_${PN}-python += "${PN}-dev python3-core" | 73 | RDEPENDS:${PN}-python += "${PN}-dev python3-core" |
64 | INSANE_SKIP_${PN}-python += "dev-deps" | 74 | INSANE_SKIP:${PN}-python += "dev-deps" |
65 | 75 | ||
66 | do_configure_prepend () { | 76 | do_configure:prepend () { |
67 | # Improve reproducibility for c++ object files | 77 | # Improve reproducibility for c++ object files |
68 | reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}" | 78 | reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}" |
69 | sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h | 79 | sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h |
70 | } | 80 | } |
71 | 81 | ||
72 | do_install_append () { | 82 | do_install:append () { |
73 | if [ ! -f ${D}${bindir}/stap ]; then | 83 | if [ ! -f ${D}${bindir}/stap ]; then |
74 | # translator disabled case, need to leave only minimal runtime | 84 | # translator disabled case, need to leave only minimal runtime |
75 | rm -rf ${D}${datadir}/${PN} | 85 | rm -rf ${D}${datadir}/${PN} |
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc index 016b423847..cc9fc81430 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.inc +++ b/meta/recipes-kernel/systemtap/systemtap_git.inc | |||
@@ -1,17 +1,16 @@ | |||
1 | LICENSE = "GPLv2" | 1 | LICENSE = "GPL-2.0-only" |
2 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | 2 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
3 | SRCREV = "988f439af39a359b4387963ca4633649866d8275" | 3 | SRCREV = "3a0c9c15163520dd0d9ab07177da62ce9cc2332f" |
4 | PV = "4.4" | 4 | PV = "5.1" |
5 | 5 | ||
6 | SRC_URI = "git://sourceware.org/git/systemtap.git \ | 6 | SRC_URI = "git://sourceware.org/git/systemtap.git;branch=master;protocol=https \ |
7 | file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \ | 7 | file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \ |
8 | file://0001-Install-python-modules-to-correct-library-dir.patch \ | 8 | file://0001-Install-python-modules-to-correct-library-dir.patch \ |
9 | file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \ | 9 | file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \ |
10 | file://0001-transport-protect-include-and-callsite-with-same-con.patch \ | ||
11 | " | 10 | " |
12 | 11 | ||
13 | COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips).*-linux' | 12 | COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips|riscv64).*-linux' |
14 | COMPATIBLE_HOST_libc-musl = 'null' | 13 | COMPATIBLE_HOST:libc-musl = 'null' |
15 | 14 | ||
16 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
17 | 16 | ||