Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,6 @@
require systemtap_git.bb
inherit native
addtask addto_recipe_sysroot after do_populate_sysroot before do_build
@@ -0,0 +1,42 @@
SUMMARY = "UProbes kernel module for SystemTap"
HOMEPAGE = "https://sourceware.org/systemtap/"
require systemtap_git.inc
DEPENDS = "systemtap virtual/kernel"
# On systems without CONFIG_UTRACE, this package is empty.
ALLOW_EMPTY:${PN} = "1"
inherit module-base gettext
FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:"
FILES:${PN} += "${datadir}/systemtap/runtime/uprobes"
# Compile and install the uprobes kernel module on machines with utrace
# support. Note that staprun expects it in the systemtap/runtime directory,
# not in /lib/modules.
do_compile() {
if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config
then
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP
oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
AR="${KERNEL_AR}" OBJCOPY="${KERNEL_OBJCOPY}" \
STRIP="${KERNEL_STRIP}" \
-C ${STAGING_KERNEL_DIR} scripts
oe_runmake KDIR=${STAGING_KERNEL_DIR} \
M="${S}/runtime/uprobes/" \
CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
AR="${KERNEL_AR}" OBJCOPY="${KERNEL_OBJCOPY}" \
STRIP="${KERNEL_STRIP}" \
-C "${S}/runtime/uprobes/"
fi
}
do_install() {
if [ -e "${S}/runtime/uprobes/uprobes.ko" ]
then
install -d ${D}${datadir}/systemtap/runtime/uprobes/
install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/
fi
}
@@ -0,0 +1,25 @@
From ab29615ed6c2e779b472903564dc683dc1015de7 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Wed, 22 Feb 2017 13:37:33 +0200
Subject: [PATCH] Do not let configure write a python location into the dtrace
binary
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
dtrace.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dtrace.in b/dtrace.in
index 5e1cf8079..a24229cbc 100644
--- a/dtrace.in
+++ b/dtrace.in
@@ -1,4 +1,4 @@
-#!@preferred_python@
+#!/usr/bin/python3
# vim: et sta sts=4 sw=4 ts=8
# This handles the systemtap equivalent of
--
2.11.0
@@ -0,0 +1,56 @@
From 2ada22f05460223924efe54080cb4419e2b4c276 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Fri, 24 Feb 2017 17:53:02 +0200
Subject: [PATCH] Install python modules to correct library dir.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Add OE's CFLAGS which contains `-fdebug-prefix-map' options to
setup.py
Supply "--root" directory to the "install" command, and use
it as a prefix to strip off the purported filename encoded
in bytecode files. (It strips build path prefix from .pyc files)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
python/Makefile.am | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/python/Makefile.am b/python/Makefile.am
index a254480..578602f 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -8,6 +8,10 @@ AUTOMAKE_OPTIONS = subdir-objects
AM_CPPFLAGS = -I$(srcdir)/../includes
AM_CPPFLAGS += -I$(abs_builddir)/../includes/sys
+# Add OE's CFLAGS which contains `-fdebug-prefix-map' options to
+# fix build path issue
+AM_CPPFLAGS += $(CFLAGS)
+
# Any script in the following variable will get byte-compiled at
# install time.
pkglibexecpython_PYTHON =
@@ -47,7 +51,7 @@ install-exec-local:
if HAVE_PYTHON2_PROBES
(cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \
--build-base $(shell readlink -f $(builddir))/py2build \
- install --prefix $(DESTDIR)$(prefix) \
+ install --root $(DESTDIR) --prefix $(prefix) --prefix $(prefix) --install-lib=${pythondir} \
--single-version-externally-managed \
--record $(shell readlink -f $(builddir))/py2build/install_files.txt \
--verbose)
@@ -55,7 +59,7 @@ endif
if HAVE_PYTHON3_PROBES
(cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
--build-base $(shell readlink -f $(builddir))/py3build \
- install --prefix $(DESTDIR)$(prefix) \
+ install --root $(DESTDIR) --prefix $(prefix) --install-lib=${python3dir} \
--single-version-externally-managed \
--record $(shell readlink -f $(builddir))/py3build/install_files.txt \
--verbose)
--
2.7.4
@@ -0,0 +1,31 @@
From 6288ba5df0a8c73ef842b609081449ac4de86123 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Wed, 18 Jul 2018 16:58:33 +0800
Subject: [PATCH] improve reproducibility for c++ compiling
Use relative dir to include header string_ref to
strip build path prefix in c++ object file
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
stringtable.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stringtable.h b/stringtable.h
index 5fc42e7..6fd8a1e 100644
--- a/stringtable.h
+++ b/stringtable.h
@@ -19,7 +19,7 @@
#if defined(HAVE_BOOST_UTILITY_STRING_REF_HPP)
#include <boost/version.hpp>
-#include <boost/utility/string_ref.hpp> //header with string_ref
+#include "@RELATIVE_STAGING_INCDIR@/boost/utility/string_ref.hpp" //header with string_ref
// XXX: experimental tunables
#define INTERNED_STRING_FIND_MEMMEM 1 /* perf stat indicates a very slight benefit */
--
2.7.4
@@ -0,0 +1,37 @@
From ebb424eee5599fcc131901c0d82d0bfc0d2f57ab Mon Sep 17 00:00:00 2001
From: "Frank Ch. Eigler" <fche@redhat.com>
Date: Fri, 28 Apr 2023 13:51:27 -0400
Subject: [PATCH] release date fix
Upstream-Status: Backport
---
NEWS | 2 +-
systemtap.spec | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index 695bc990c..46859e304 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-* What's new in version 4.9, 2023-04-27
+* What's new in version 4.9, 2023-04-28
- ISystemtap: the new interactive systemtap jupyter kernel. This provides
a simple GUI for writing/running Systemtap scripts in an easy, incremental
diff --git a/systemtap.spec b/systemtap.spec
index 59814f112..fd8023264 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -1307,7 +1307,7 @@ exit 0
# PRERELEASE
%changelog
-* Thu Apr 27 2023 Frank Ch. Eigler <fche@redhat.com> - 4.9-1
+* Fri Apr 28 2023 Frank Ch. Eigler <fche@redhat.com> - 4.9-1
- Upstream release, see wiki page below for detailed notes.
https://sourceware.org/systemtap/wiki/SystemTapReleases
--
2.40.1
@@ -0,0 +1,61 @@
From 191f528da19193d713d94ee252e2485efd9af4d3 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Mon, 25 Oct 2021 17:59:24 +0200
Subject: [PATCH] staprun: address ncurses 6.3 failures
Upstream-Status: Submitted [by email to smakarov@redhat.com,systemtap@sourceware.org]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
staprun/monitor.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/staprun/monitor.c b/staprun/monitor.c
index 478634c09..f4fbfd686 100644
--- a/staprun/monitor.c
+++ b/staprun/monitor.c
@@ -448,12 +448,12 @@ void monitor_render(void)
if (active_window == 0)
wattron(status, A_BOLD);
wprintw(status, "\n%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%s\n",
- width[p_index], HIGHLIGHT("index", p_index, comp_fn_index),
- width[p_state], HIGHLIGHT("state", p_state, comp_fn_index),
- width[p_hits], HIGHLIGHT("hits", p_hits, comp_fn_index),
- width[p_min], HIGHLIGHT("min", p_min, comp_fn_index),
- width[p_avg], HIGHLIGHT("avg", p_avg, comp_fn_index),
- width[p_max], HIGHLIGHT("max", p_max, comp_fn_index),
+ (int)width[p_index], HIGHLIGHT("index", p_index, comp_fn_index),
+ (int)width[p_state], HIGHLIGHT("state", p_state, comp_fn_index),
+ (int)width[p_hits], HIGHLIGHT("hits", p_hits, comp_fn_index),
+ (int)width[p_min], HIGHLIGHT("min", p_min, comp_fn_index),
+ (int)width[p_avg], HIGHLIGHT("avg", p_avg, comp_fn_index),
+ (int)width[p_max], HIGHLIGHT("max", p_max, comp_fn_index),
HIGHLIGHT("name", p_name, comp_fn_index));
if (active_window == 0)
wattroff(status, A_BOLD);
@@ -466,17 +466,17 @@ void monitor_render(void)
json_object *probe, *field;
probe = json_object_array_get_idx(jso_probe_list, i);
json_object_object_get_ex(probe, "index", &field);
- wprintw(status, "%*s\t", width[p_index], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_index], json_object_get_string(field));
json_object_object_get_ex(probe, "state", &field);
- wprintw(status, "%*s\t", width[p_state], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_state], json_object_get_string(field));
json_object_object_get_ex(probe, "hits", &field);
- wprintw(status, "%*s\t", width[p_hits], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_hits], json_object_get_string(field));
json_object_object_get_ex(probe, "min", &field);
- wprintw(status, "%*s\t", width[p_min], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_min], json_object_get_string(field));
json_object_object_get_ex(probe, "avg", &field);
- wprintw(status, "%*s\t", width[p_avg], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_avg], json_object_get_string(field));
json_object_object_get_ex(probe, "max", &field);
- wprintw(status, "%*s\t", width[p_max], json_object_get_string(field));
+ wprintw(status, "%*s\t", (int)width[p_max], json_object_get_string(field));
getyx(status, discard, cur_x);
json_object_object_get_ex(probe, "name", &field);
wprintw(status, "%.*s", max_cols-cur_x-1, json_object_get_string(field));
--
2.20.1
@@ -0,0 +1,37 @@
From 3e13a006fe3dff9489269274093bf868532036e2 Mon Sep 17 00:00:00 2001
From: Saul Wold <sgw@linux.intel.com>
Date: Tue, 5 Sep 2017 16:02:55 -0700
Subject: [PATCH] staprun/stapbpf: don't support installing a non-root
Since we are in a known environment and installing as root and
expect to be running as root, don't create the group or chmod
the binaries.
Upstream-Status: Inappropriate [Embedded]
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
stapbpf/Makefile.am | 14 +++++++-------
staprun/Makefile.am | 12 ++++++------
2 files changed, 13 insertions(+), 13 deletions(-)
Index: git/stapbpf/Makefile.am
===================================================================
--- git.orig/stapbpf/Makefile.am
+++ git/stapbpf/Makefile.am
@@ -41,10 +41,10 @@
# Why the "id -u" condition? This way, an unprivileged user can run
# make install, and have "sudo stap ...." or "sudo stapbpf ...." work later.
-install-exec-hook:
- if [ `id -u` -eq 0 ] && (getent group stapusr >/dev/null \
- || groupadd -f -g 156 -r stapusr); then \
- chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \
- && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \
- fi
+#install-exec-hook:
+## if [ `id -u` -eq 0 ] && (getent group stapusr >/dev/null \
+## || groupadd -f -g 156 -r stapusr); then \
+## chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \
+# && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \
+# fi
endif
@@ -0,0 +1,102 @@
SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
DESCRIPTION = "It provides free software infrastructure to simplify the \
gathering of information about the running Linux system. This assists \
diagnosis of a performance or functional problem."
HOMEPAGE = "https://sourceware.org/systemtap/"
require systemtap_git.inc
SRC_URI += " \
file://0001-improve-reproducibility-for-c-compiling.patch \
file://0001-staprun-address-ncurses-6.3-failures.patch \
"
DEPENDS = "elfutils"
EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
--without-nss --without-avahi --without-dyninst \
--disable-server --disable-grapher --enable-prologues \
--with-python3 --without-python2-probes \
ac_cv_prog_have_javac=no \
ac_cv_prog_have_jar=no "
STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs"
EXTRA_OECONF += "${STAP_DOCS} "
PACKAGECONFIG ??= "translator sqlite monitor python3-probes"
PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash"
PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3"
PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c"
PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native"
inherit autotools gettext pkgconfig systemd
inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)}
# | ../git/elaborate.cxx:2601:21: error: storing the address of local variable 'sym' in '*s.systemtap_session::symbol_resolver' [-Werror=dangling-pointer=]
CXXFLAGS += "-Wno-dangling-pointer"
# exporter comes with python3-probes
PACKAGES =+ "${PN}-exporter"
FILES:${PN}-exporter = "${sysconfdir}/stap-exporter/* \
${sysconfdir}/sysconfig/stap-exporter \
${systemd_system_unitdir}/stap-exporter.service \
${sbindir}/stap-exporter"
RDEPENDS:${PN}-exporter = "${PN} python3-core python3-netclient"
SYSTEMD_SERVICE:${PN}-exporter = "stap-exporter.service"
PACKAGES =+ "${PN}-runtime"
FILES:${PN}-runtime = "\
${bindir}/staprun \
${bindir}/stap-merge \
${bindir}/stapsh \
${libexecdir}/${BPN}/stapio \
"
RDEPENDS:${PN}:class-target += "${PN}-runtime"
PACKAGES =+ "${PN}-examples"
FILES:${PN}-examples = "${datadir}/${BPN}/examples/"
RDEPENDS:${PN}-examples += "${PN}"
# don't complain that some examples involve bash, perl, php...
INSANE_SKIP:${PN}-examples += "file-rdeps"
PACKAGES =+ "${PN}-python"
FILES:${PN}-python += "\
${bindir}/dtrace \
${libdir}/python*/ \
${libexecdir}/${BPN}/python/ \
"
# python material requires sdt headers
RDEPENDS:${PN}-python += "${PN}-dev python3-core"
INSANE_SKIP:${PN}-python += "dev-deps"
do_configure:prepend () {
# Improve reproducibility for c++ object files
reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}"
sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h
}
do_install:append () {
if [ ! -f ${D}${bindir}/stap ]; then
# translator disabled case, need to leave only minimal runtime
rm -rf ${D}${datadir}/${PN}
rm ${D}${libexecdir}/${PN}/stap-env
fi
if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then
# Fix makefile hardcoded path assumptions for systemd (assumes $prefix)
# without usrmerge distro feature enabled
install -d `dirname ${D}${systemd_unitdir}`
mv ${D}${prefix}/lib/systemd `dirname ${D}${systemd_unitdir}`
rmdir ${D}${prefix}/lib --ignore-fail-on-non-empty
fi
# Ensure correct ownership for files copied in
if [ -d ${D}${sysconfdir}/stap-exporter ]; then
chown root:root ${D}${sysconfdir}/stap-exporter/* -R
fi
}
BBCLASSEXTEND = "nativesdk"
@@ -0,0 +1,23 @@
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRCREV = "418f0a45ca4473491385b5c7eef777607bbdb3b7"
PV = "4.9"
SRC_URI = "git://sourceware.org/git/systemtap.git;branch=master;protocol=https \
file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \
file://0001-Install-python-modules-to-correct-library-dir.patch \
file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \
file://0001-release-date-fix.patch \
"
COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips|riscv64).*-linux'
COMPATIBLE_HOST:libc-musl = 'null'
S = "${WORKDIR}/git"
# systemtap can't be built without optimization, if someone tries to compile an
# entire image as -O0, break with fatal.
python () {
if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
bb.fatal("systemtap can't be built with -O0, using -O1 -Wno-error or -O1 instead.")
}