mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add Systemtap package
This commit is contained in:
parent
2d41636606
commit
e22b863f26
9 changed files with 379 additions and 0 deletions
79
systemtap/Makefile
Normal file
79
systemtap/Makefile
Normal file
|
@ -0,0 +1,79 @@
|
|||
#
|
||||
# Copyright (C) 2018-2022 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=systemtap
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=4.9
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://sourceware.org/systemtap/ftp/releases/
|
||||
PKG_HASH:=d01033baea9d0af52a65e70167816931f4b856427a53ff2ab30e4b45f6ad3a98
|
||||
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DEPENDS:=systemtap/host
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/systemtap
|
||||
SUBMENU:=System
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Simplify the gathering of information
|
||||
URL:=http://sourceware.org/systemtap/wiki
|
||||
DEPENDS:=@(LINUX_5_15||LINUX_6_1) +libelf +libdw
|
||||
MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
endef
|
||||
|
||||
define Package/systemtap/description
|
||||
SystemTap (stap) is a scripting language and tool for dynamically instrumenting running production Linux-based operating systems.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += --without-rpm \
|
||||
--without-nss --without-avahi --without-dyninst \
|
||||
--disable-server --disable-grapher --enable-prologues \
|
||||
--without-python2-probes --disable-translator \
|
||||
--disable-libvirt --disable-sqlite --disable-monitor --without-python3-probes \
|
||||
ac_cv_prog_have_javac=no \
|
||||
ac_cv_prog_have_jar=no
|
||||
|
||||
HOST_CONFIGURE_ARGS += --without-rpm \
|
||||
--without-nss --without-avahi --without-dyninst \
|
||||
--disable-server --disable-grapher --enable-prologues \
|
||||
--without-python2-probes \
|
||||
--disable-libvirt --disable-sqlite --disable-monitor --without-python3-probes \
|
||||
ac_cv_prog_have_javac=no \
|
||||
ac_cv_prog_have_jar=no
|
||||
|
||||
define Package/systemtap/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/share
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/share/* $(1)/usr/share/
|
||||
endef
|
||||
|
||||
define Host/install
|
||||
$(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/bin
|
||||
$(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/include
|
||||
$(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/lib
|
||||
$(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/share
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(STAGING_DIR_HOST)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(STAGING_DIR_HOST)/usr/include/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(STAGING_DIR_HOST)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/share/* $(STAGING_DIR_HOST)/usr/share/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,systemtap))
|
|
@ -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,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
|
24
systemtap/patches/basename.patch
Normal file
24
systemtap/patches/basename.patch
Normal file
|
@ -0,0 +1,24 @@
|
|||
--- a/buildrun.cxx 2023-05-03 10:17:44.338633166 +0200
|
||||
+++ b/buildrun.cxx 2023-05-03 10:18:48.465507072 +0200
|
||||
@@ -943,7 +943,8 @@
|
||||
if (remotedir.empty())
|
||||
opt_u.append(s.uprobes_path);
|
||||
else
|
||||
- opt_u.append(remotedir + "/" + basename(s.uprobes_path.c_str()));
|
||||
+ //opt_u.append(remotedir + "/" + basename(s.uprobes_path.c_str()));
|
||||
+ opt_u.append(remotedir + "/" + s.uprobes_path.substr(s.uprobes_path.rfind('/')+1));
|
||||
}
|
||||
cmd.push_back(opt_u);
|
||||
}
|
||||
--- a/remote.cxx 2023-05-03 13:52:06.614257954 +0200
|
||||
+++ b/remote.cxx 2023-05-03 13:53:19.784994466 +0200
|
||||
@@ -472,7 +472,8 @@
|
||||
|
||||
if (!s->uprobes_path.empty())
|
||||
{
|
||||
- string remoteuprobes = basename(s->uprobes_path.c_str());
|
||||
+ //string remoteuprobes = basename(s->uprobes_path.c_str());
|
||||
+ string remoteuprobes = s->uprobes_path.substr(s->uprobes_path.rfind('/')+1);
|
||||
if ((rc = send_file(s->uprobes_path, remoteuprobes)))
|
||||
return rc;
|
||||
|
15
systemtap/patches/conversion.patch
Normal file
15
systemtap/patches/conversion.patch
Normal file
|
@ -0,0 +1,15 @@
|
|||
--- a/util.cxx 2023-05-03 13:20:34.930972141 +0200
|
||||
+++ b/util.cxx 2023-05-03 13:21:15.398273958 +0200
|
||||
@@ -257,8 +257,10 @@
|
||||
{
|
||||
char *dirc, *basec, *bname, *dname;
|
||||
|
||||
- dirc = strdupa (path.c_str());
|
||||
- basec = strdupa (path.c_str());
|
||||
+ dirc = strdup (path.c_str());
|
||||
+ basec = strdup (path.c_str());
|
||||
dname = dirname (dirc);
|
||||
bname = basename (basec);
|
||||
+ free(dirc);
|
||||
+ free(basec);
|
||||
directory = dname;
|
22
systemtap/patches/include-fix.patch
Normal file
22
systemtap/patches/include-fix.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
--- a/staprun/staprun.h 2023-05-03 21:59:59.097825632 +0200
|
||||
+++ b/staprun/staprun.h 2023-05-03 22:00:06.457699309 +0200
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <errno.h>
|
||||
#include <linux/fd.h>
|
||||
#include <sys/mman.h>
|
||||
-#include <sys/poll.h>
|
||||
+#include <poll.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/socket.h>
|
||||
#include <linux/limits.h>
|
||||
--- a/stapbpf/stapbpf.cxx 2023-05-03 22:02:20.483398963 +0200
|
||||
+++ b/stapbpf/stapbpf.cxx 2023-05-03 22:02:34.879151884 +0200
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <limits.h>
|
||||
#include <inttypes.h>
|
||||
#include <getopt.h>
|
||||
-#include <sys/fcntl.h>
|
||||
+#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/syscall.h>
|
60
systemtap/patches/types.patch
Normal file
60
systemtap/patches/types.patch
Normal file
|
@ -0,0 +1,60 @@
|
|||
--- a/util.h 2023-05-03 08:32:15.445228767 +0200
|
||||
+++ b/util.h 2023-05-03 08:33:38.683781936 +0200
|
||||
@@ -16,6 +16,27 @@
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
+#include <sys/types.h>
|
||||
+#include <linux/types.h>
|
||||
+
|
||||
+typedef off_t __off_t;
|
||||
+typedef signed char __int8_t;
|
||||
+typedef unsigned char __uint8_t;
|
||||
+typedef signed short int __int16_t;
|
||||
+typedef unsigned short int __uint16_t;
|
||||
+typedef signed int __int32_t;
|
||||
+typedef unsigned int __uint32_t;
|
||||
+#if __WORDSIZE == 64
|
||||
+typedef signed long int __int64_t;
|
||||
+typedef unsigned long int __uint64_t;
|
||||
+#elif defined(__GNUC__)
|
||||
+__extension__ typedef signed long long int __int64_t;
|
||||
+__extension__ typedef unsigned long long int __uint64_t;
|
||||
+#endif
|
||||
+
|
||||
+#ifndef FNM_EXTMATCH
|
||||
+#define FNM_EXTMATCH 0
|
||||
+#endif
|
||||
|
||||
extern "C" {
|
||||
#if ENABLE_NLS
|
||||
@@ -415,6 +415,9 @@
|
||||
const sigset_t *sigmask);
|
||||
#endif
|
||||
|
||||
+#ifndef __GLIBC__
|
||||
+#define canonicalize_file_name(name) realpath(name,NULL)
|
||||
+#endif
|
||||
|
||||
int read_from_file (const std::string &fname, int &data);
|
||||
template <class T>
|
||||
--- a/tapsets.cxx 2023-05-03 09:17:52.009600253 +0200
|
||||
+++ b/tapsets.cxx 2023-05-03 09:18:02.989408144 +0200
|
||||
@@ -51,7 +51,6 @@
|
||||
#include <elfutils/libdw.h>
|
||||
#include <dwarf.h>
|
||||
#include <elf.h>
|
||||
-#include <obstack.h>
|
||||
#include <glob.h>
|
||||
#include <fnmatch.h>
|
||||
#include <stdio.h>
|
||||
--- a/staprun/staprun.h 2023-05-03 21:56:21.277564278 +0200
|
||||
+++ b/staprun/staprun.h 2023-05-03 21:57:10.364721740 +0200
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
+typedef off_t __off_t;
|
||||
|
||||
/* define gettext options if NLS is set */
|
||||
#if ENABLE_NLS
|
Loading…
Add table
Add a link
Reference in a new issue