Compare commits

...

22 Commits

Author SHA1 Message Date
openeuler-ci-bot 7b468f9885 !29 [sync] PR-27: 【轻量级PR】修正changelog中的错误日期
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-06-20 01:17:29 +00:00
openeuler-ci-bot bcf91eabdf !26 【轻量级PR】修正changelog中的错误日期
From: @konglidong 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-06-20 01:07:56 +00:00
konglidong f3a88dedc6 modify bad date in changelog
(cherry picked from commit 5c059dba34)
2022-06-20 09:06:45 +08:00
konglidong aeba2d99ae modify bad date in changelog 2022-06-16 14:51:16 +08:00
openeuler-ci-bot 729da1fb58 !25 同步22.03提交:ncurses升级到6.3后,wprintw函数的调用处会报出关于Wformat=的错误
From: @zhouwenpei 
Reviewed-by: @SuperSix173 
Signed-off-by: @SuperSix173
2022-04-08 02:25:40 +00:00
zhouwenpei 8e2f8c7b2d Add int type cast to resolve gcc issue for option Wformat=2 2022-04-08 09:18:31 +08:00
openeuler-ci-bot df5d2510f5 !20 Remove requires on gcc and systemtap-devel
From: @zhouwenpei 
Reviewed-by: @SuperSix173, @liqingqing_1229 
Signed-off-by: @SuperSix173
2022-02-21 06:43:34 +00:00
zhouwenpei ce4ee0272a Remove requires on gcc and systemtap-devel 2022-02-15 16:09:04 +08:00
openeuler-ci-bot c1b3e5bfd5 !18 update verion to 4.5
From: @zhouwenpei
Reviewed-by: @liqingqing_1229
Signed-off-by: @liqingqing_1229
2021-12-03 01:00:44 +00:00
zhouwenpei 530b3c58ec update verion to 4.5 2021-12-02 21:46:00 +08:00
openeuler-ci-bot ceeded114a !14 upgrade to 4.4
From: @xinghe_1
Reviewed-by: @SuperSix173
Signed-off-by: @SuperSix173
2021-02-01 17:28:54 +08:00
renmingshuai f6be3eef0e update version 2021-02-01 13:49:10 +08:00
openeuler-ci-bot 9bd07d0547 !12 软件包差异分析
Merge pull request !12 from HukunaMatata/master
2020-09-08 15:41:21 +08:00
HukunaMatata 2d43183c1e add diff yaml 2020-09-08 15:05:03 +08:00
openeuler-ci-bot 519e42ed08 !9 update to 4.3
Merge pull request !9 from 靳智敏/master
2020-07-21 20:11:32 +08:00
jinzhimin369 21652d6569 upgrade to 4.3 2020-07-21 11:40:17 +00:00
openeuler-ci-bot a295738814 !8 add yaml file in package
Merge pull request !8 from gaoch_100/master
2020-06-23 19:14:42 +08:00
gaochao_100 eee0b5da51 add yaml file in package 2020-06-11 15:52:09 +08:00
openeuler-ci-bot 18fb3c8dbf !5 remove java-runtime
Merge pull request !5 from HukunaMatata/master
2020-03-15 13:14:29 +08:00
HukunaMatata 2c5d8ff458 remove java-runtime 2020-03-15 12:09:22 +08:00
openeuler-ci-bot 3eed0394ff !4 Delete the requirement of python2-pyparsing
Merge pull request !4 from HukunaMatata/master
2020-02-25 11:45:19 +08:00
HukunaMatata 84907d969c Delete the requirement of python2-pyparsing 2020-02-21 14:16:37 +08:00
9 changed files with 429 additions and 396 deletions
@@ -0,0 +1,53 @@
From: Qiang Wei <qiang.wei@suse.com>
Subject: [PATCH] Add int type cast to resolve gcc issue for option
Wformat=2.
In ncruses 6.3 version, there is type complain for function wprintw
when gcc has option -Wformat=2.
Signed-off-by: Qiang Wei <qiang.wei@suse.com>
--- a/staprun/monitor.c 2022-03-09 06:45:30.534000000 +0000
+++ b/staprun/monitor.c 2022-03-09 06:48:49.804000000 +0000
@@ -448,12 +448,12 @@
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 @@
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));
-42
View File
@@ -1,42 +0,0 @@
--- a/tapset/linux/ipmib.stp
+++ b/tapset/linux/ipmib.stp
@@ -271,7 +271,7 @@
* IPSTATS_MIB_INUNKNOWNPROTOS)
*/
/* icmp_send() is called by ip_local_deliver_finish() */
-probe ipmib.InUnknownProtos=kernel.function("icmp_send")
+probe ipmib.InUnknownProtos=kernel.function("__icmp_send")
{
skb = $skb_in;
op = 1;
@@ -360,7 +360,7 @@
* counted in the global @ReasmTimeout (equivalent to SNMP's MIB
* IPSTATS_MIB_REASMTIMEOUT)
*/
-probe ipmib.ReasmTimeout=kernel.function("icmp_send")
+probe ipmib.ReasmTimeout=kernel.function("__icmp_send")
{
skb = $skb_in;
op = 0;
--- a/tapset/linux/linuxmib.stp
+++ b/tapset/linux/linuxmib.stp
@@ -30,7 +30,7 @@
probe _linuxmib.DelayedACKs.A = kernel.function("tcp_send_ack")
{
- sk=$sk
+ sk=pointer_arg(1)
if ( !indelack_timer[sk] ) next
op=1
key = linuxmib_filter_key(sk,op);
--- a/testsuite/systemtap.examples/network/tcp_trace.stp
+++ b/testsuite/systemtap.examples/network/tcp_trace.stp
@@ -192,7 +192,7 @@
}
}
-probe kernel.function("tcp_transmit_skb")
+probe kernel.function("__tcp_transmit_skb")
{
sk = $sk
key = filter_key(sk)
-29
View File
@@ -1,29 +0,0 @@
--- a/testsuite/systemtap.examples/general/tapset/python3_local.stp
+++ b/testsuite/systemtap.examples/general/tapset/python3_local.stp
@@ -182,7 +182,7 @@
n = @cast (dict, "PyDictObject", @PYTHON3_LIBRARY)->ma_used;
if (i > n || entries == 0)
return 0
- return @cast (entries, "PyDictKeysObject", @PYTHON3_LIBRARY)->dk_entries[i]->me_hash
+ return @cast (@DK_ENTRIES(entries), "PyDictKeyEntry", @PYTHON3_LIBRARY)[i]->me_hash
}
# FUNCTION P3_GET_DICT_KEY
@@ -195,7 +195,7 @@
n = @cast (dict, "PyDictObject", @PYTHON3_LIBRARY)->ma_used;
if (i > n || entries == 0)
return 0
- return @cast (entries, "PyDictKeysObject", @PYTHON3_LIBRARY)->dk_entries[i]->me_key
+ return @cast (@DK_ENTRIES(entries), "PyDictKeyEntry", @PYTHON3_LIBRARY)[i]->me_key
}
# FUNCTION P3_GET_DICT_VALUE
@@ -214,7 +214,7 @@
n = @cast (dict, "PyDictObject", @PYTHON3_LIBRARY)->ma_used;
if (i > n || entries == 0)
return 0
- return @cast (entries, "PyDictKeysObject", @PYTHON3_LIBRARY)->dk_entries[i]->me_value
+ return @cast (@DK_ENTRIES(entries), "PyDictKeyEntry", @PYTHON3_LIBRARY)[i]->me_value
}
}
-44
View File
@@ -1,44 +0,0 @@
diff --git a/testsuite/systemtap.examples/general/tapset/python_local.stpm b/testsuite/systemtap.examples/general/tapset/python_local.stpm
--- a/testsuite/systemtap.examples/general/tapset/python_local.stpm
+++ b/testsuite/systemtap.examples/general/tapset/python_local.stpm
@@ -8,4 +8,39 @@
@define PYTHON3_LIBRARY
%(
- "/usr/lib64/libpython3.4m.so.1.0"
+ "/usr/lib64/libpython3.7m.so.1.0"
%)
+
+@define Py3DictKeysObject(object) %(
+ @cast(@object, "PyDictKeysObject", @PYTHON3_LIBRARY)
+ %)
+@define Py3DictKeyEntry(object) %(
+ @cast(@object, "PyDictKeyEntry", @PYTHON3_LIBRARY)
+ %)
+
+@define DK_SIZE(dk) %(
+ @Py3DictKeysObject(@dk)->dk_size
+%)
+@define DK_IXSIZE(dk) %(
+ %( CONFIG_64BIT == "y" %?
+ %( CONFIG_COMPAT == "y" %?
+ (@__compat_task
+ ? (@DK_SIZE(@dk) <= 0xff ? 1 : (@DK_SIZE(@dk) <= 0xffff ? 2
+: 4))
+ : (@DK_SIZE(@dk) <= 0xff ?
+ 1 : (@DK_SIZE(@dk) <= 0xffff ?
+ 2 : (@DK_SIZE(@dk) <= 0xffffffff ? 4 : 8))))
+ %:
+ (@DK_SIZE(@dk) <= 0xff ?
+ 1 : (@DK_SIZE(@dk) <= 0xffff ?
+ 2 : (@DK_SIZE(@dk) <= 0xffffffff ? 4 : 8)))
+ %)
+ %:
+ (@DK_SIZE(@dk) <= 0xff ? 1 : (@DK_SIZE(@dk) <= 0xffff ? 2 : 4))
+ %)
+%)
+
+@define DK_ENTRIES(dk) %(
+ (@choose_defined(@Py3DictKeysObject(@dk)->dk_entries,
+(&@Py3DictKeyEntry(&@Py3DictKeysObject(@dk)->dk_indices[@DK_SIZE(@dk) *
+@DK_IXSIZE(@dk)]))))
+%)
+33
View File
@@ -0,0 +1,33 @@
name: systemtap
old_version: 4.1
new_version: 4.3
interface_differences:
- type: 'feature'
item: 支持eBPF功能
diff: 新增
influence: 支持prometheus导出器、procfs探针等eBPF功能
- type: 'feature'
item: 同名probe解析功能
diff: 新增
influence: 支持用不同的PC地址去区分多个同名的probe
- type: 'feature'
item: 后端执行器支持try-catch捕获异常
diff: 新增
influence: 不影响
- type: 'ABI'
item: 新增gettimeofday()
diff: 返回当前的时间
influence: 不影响
- type: 'ABI'
item: 新增dump_stack()
diff: 打印内核调用栈
influence: 不影响
- type: 'ABI'
item: gettimeofday_*
diff: 返回当前的时间
influence: 不影响
- type: 'CLI'
item: 加强对$variable变量类型的检查
diff: 可能在解析和编译的时候输出更多的告警信息
influence: 尽可能的修正这些告警信息,虽然不会影响最终的执行结果
remark: '功能增强,无影响;'
Binary file not shown.
Binary file not shown.
+339 -281
View File
@@ -3,8 +3,6 @@
%{!?with_dyninst: %global with_dyninst 1}
%{!?with_mokutil: %global with_mokutil 1}
%{!?with_openssl: %global with_openssl 1}
%{!?with_virthost: %global with_virthost 1}
%global virt_config --enable-virt
%global crash_config --enable-crash
%global dyninst_config --with-dyninst
%else
@@ -12,13 +10,10 @@
%{!?with_dyninst: %global with_dyninst 0}
%{!?with_mokutil: %global with_mokutil 0}
%{!?with_openssl: %global with_openssl 0}
%{!?with_virthost: %global with_virthost 0}
%global virt_config --disable-virt
%global crash_config --disable-crash
%global dyninst_config --without-dyninst
%endif
%define initdir %{_initddir}
%define udevrulesdir /usr/lib/udev/rules.d
%define dracutstap %{_prefix}/lib/dracut/modules.d/99stap
%define dracutbindir /sbin
@@ -26,23 +21,22 @@
%undefine __brp_mangle_shebangs
Name: systemtap
Version: 4.1
Release: 1
Version: 4.5
Release: 3
Summary: Linux trace and probe tool
License: GPLv2+ and Public Domain
URL: http://sourceware.org/systemtap/
URL: http://sourceware.org/systemtap
Source: https://sourceware.org/systemtap/ftp/releases/%{name}-%{version}.tar.gz
Patch9000: fix-py3example-script-run-fail.patch
Patch9001: fix-py3example-script-run-fail-2.patch
Patch9002: fix-network-tcp-test.patch
Patch1: 0001-Add-init-type-cast-to-resolve-gcc-issue.patch
BuildRequires: emacs gcc-c++ gettext-devel jpackage-utils java-devel
BuildRequires: readline-devel rpm-devel systemd pkgconfig(nss)
BuildRequires: pkgconfig(avahi-client) pkgconfig(json-c) pkgconfig(ncurses)
BuildRequires: python3-devel python3-setuptools nss-devel avahi-devel
BuildRequires: sqlite-devel > 3.7
BuildRequires: gcc-c++ emacs systemd python3-setuptools
BuildRequires: gettext-devel rpm-devel readline-devel
BuildRequires: pkgconfig(nss) pkgconfig(avahi-client)
BuildRequires: pkgconfig(ncurses) pkgconfig(json-c)
BuildRequires: jpackage-utils python3-devel
BuildRequires: elfutils-devel >= 0.142
BuildRequires: sqlite-devel > 3.7
%if %{with_dyninst}
BuildRequires: dyninst-devel >= 8.0
BuildRequires: pkgconfig(libselinux)
@@ -50,54 +44,8 @@ BuildRequires: pkgconfig(libselinux)
%if %{with_crash}
BuildRequires: crash-devel zlib-devel
%endif
%if %{with_virthost}
BuildRequires: pkgconfig(libvirt) pkgconfig(libxml-2.0)
Requires: libvirt > 2.0
%endif
Requires: nss coreutils zip unzip shadow-utils chkconfig systemd
Requires: shadow-utils openssh-clients python3-pyparsing pyparsing
Requires: which elfutils grep nc gcc gcc-c++ make glibc-devel
Requires: strace nmap-ncat avahi perl iproute libxml2 findutils
Requires: kernel-devel
%if %{with_openssl}
Requires: openssl
%endif
%if %{with_mokutil}
Requires: mokutil
%endif
%if %{with_crash}
Requires: crash
%endif
Requires(pre): shadow-utils
Requires(post): chkconfig findutils coreutils
Requires(preun): chkconfig grep coreutils
Requires(postun): grep coreutils
Provides: systemtap-devel = %{version}-%{release}
Provides: systemtap-runtime = %{version}-%{release}
Provides: systemtap-server = %{version}-%{release}
Provides: systemtap-client = %{version}-%{release}
Provides: systemtap-initscript = %{version}-%{release}
Provides: systemtap-runtime_java = %{version}-%{release}
Provides: systemtap-runtime-python3 = %{version}-%{release}
Provides: systemtap-stap-exporter = %{version}-%{release}
%if %{with_virthost}
Provides: systemtap-runtime-virthost = %{version}-%{release}
%endif
Provides: systemtap-runtime-virtguest = %{version}-%{release}
Obsoletes: systemtap-devel
Obsoletes: systemtap-runtime
Obsoletes: systemtap-server
Obsoletes: systemtap-client
Obsoletes: systemtap-initscript
Obsoletes: systemtap-runtime_java
Obsoletes: systemtap-runtime-python3
Obsoletes: systemtap-stap-exporter
%if %{with_virthost}
Obsoletes: systemtap-runtime-virthost
%endif
Obsoletes: systemtap-runtime-virtguest
Requires: systemtap-client = %{version}-%{release}
%description
SystemTap is an instrumentation system for systems running Linux.
@@ -105,199 +53,222 @@ Developers can write instrumentation scripts to collect data on
the operation of the system. The base systemtap package contains/requires
the components needed to locally develop and execute systemtap scripts.
%package runtime-java
Summary: Systemtap java runtime
%package devel
Summary: Programmable system-wide instrumentation system - development headers, tools
License: GPLv2+
Requires: %{name} = %{version}-%{release}
Requires: byteman > 2.0
Requires: iproute
Requires: make kernel-devel systemd
%description runtime-java
Systemtap for java runtime support
%description devel
This package contains the components needed to compile a systemtap
script from source form into executable (.ko) forms. It may be
installed on a self-contained developer workstation (along with the
systemtap-client and systemtap-runtime packages), or on a dedicated
remote server (alongside the systemtap-server package). It includes
a copy of the standard tapset library and the runtime library C files.
%package runtime-python3
Summary: Systemtap python 3 runtime
%package server
Summary: Instrumentation System Server
License: GPLv2+
Requires: %{name} = %{version}-%{release}
Requires: systemtap-devel = %{version}-%{release}
Requires: coreutils nss zip unzip
Requires(pre): shadow-utils
BuildRequires: nss-devel avahi-devel
%if %{with_openssl}
Requires: openssl
%endif
%description runtime-python3
Systemtap for python3 runtime support
%description server
This is the remote script compilation server component of systemtap.
It announces itself to nearby clients with avahi (if available), and
compiles systemtap scripts to kernel objects on their demand.
%package runtime
Summary: Programmable system-wide instrumentation system - runtime
License: GPLv2+
Requires(pre): shadow-utils
%description runtime
SystemTap runtime contains the components needed to execute
a systemtap script that was already compiled into a module
using a local or remote systemtap-devel installation.
%package client
Summary: Programmable system-wide instrumentation system - client
License: GPLv2+
Requires: zip unzip
Requires: systemtap-runtime = %{version}-%{release}
Requires: coreutils grep sed unzip zip
Requires: openssh-clients
%if %{with_mokutil}
Requires: mokutil
%endif
%description client
This package contains/requires the components needed to develop
systemtap scripts, and compile them using a local systemtap-devel
or a remote systemtap-server installation, then run them using a
local or remote systemtap-runtime. It includes script samples and
documentation, and a copy of the tapset library for reference.
%package sdt-devel
Summary: Development package for systemtap
Summary: Static probe support tools
License: GPLv2+ and Public Domain
Requires: python3-pyparsing
%description sdt-devel
The sdt-development package for systemtap.
%package help
Summary: Help documents for systemtap
Requires: %{name} = %{version}-%{release}
%description help
The help documents for systemtap.
%package lang
Summary: Language package for systemtap
Requires: %{name} = %{version}-%{release}
%description lang
The language package for systemtap.
This package includes the <sys/sdt.h> header file used for static
instrumentation compiled into userspace programs and libraries, along
with the optional dtrace-compatibility preprocessor to process related
.d files into tracing-macro-laden .h headers.
%package testsuite
Summary: Instrumentation System Testsuite
License: GPLv2+
URL: http://sourceware.org/systemtap/
Requires: systemtap = %{version}-%{release}
Requires: systemtap-devel = %{version}-%{release}
Requires: systemtap-sdt-devel = %{version}-%{release}
Requires: systemtap-server = %{version}-%{release}
Requires: dejagnu which elfutils grep nc
Requires: gcc gcc-c++ make glibc-devel
Requires: strace
Requires: nmap-ncat
Requires: avahi
Requires: strace nc avahi perf
Requires: systemtap-runtime-python3 = %{version}-%{release}
%if %{with_crash}
Requires: crash
%endif
Requires: systemtap-runtime-java = %{version}-%{release}
Requires: systemtap-runtime-python3 = %{version}-%{release}
Requires: perf
%description testsuite
Testsuite for systemtap.
This package includes the dejagnu-based systemtap stress self-testing
suite. This may be used by system administrators to thoroughly check
systemtap on the current system.
%package runtime-python3
Summary: Systemtap Python 3 Runtime Support
License: GPLv2+
URL: http://sourceware.org/systemtap
Requires: systemtap-runtime = %{version}-%{release}
%description runtime-python3
This package includes support files needed to run systemtap scripts
that probe python3 processes.
%package stap-exporter
Summary: Systemtap-prometheus interoperation mechanism
License: GPLv2+
URL: http://sourceware.org/systemtap
Requires: systemtap-runtime = %{version}-%{release}
%description stap-exporter
This package includes files for a systemd service that manages
systemtap sessions and relays prometheus metrics from the sessions
to remote requesters on demand.
%package help
Summary: systemtap manual
License: GPLv2+
URL: http://sourceware.org/systemtap
%description help
This package include systemtap manual
%prep
%autosetup %{?setup_elfutils} -p1
%autosetup -p1
%build
%configure \
%{dyninst_config} \
%{crash_config} \
%{virt_config} \
--enable-sqlite \
--enable-pie \
--with-rpm \
--with-java=%{_jvmdir}/java \
--with-dracutstap=%{dracutstap} \
--with-dracutbindir=%{dracutbindir} \
--with-python3 \
--without-python2-probes \
--with-python3-probes \
--disable-httpd \
--with-bpf \
--disable-silent-rules \
--with-extra-version="rpm %{version}-%{release}"
%{dyninst_config} \
%{crash_config} \
--with-bpf \
--disable-httpd \
--with-dracutstap=%{dracutstap} \
--with-dracutbindir=%{dracutbindir} \
--with-python3 \
--with-python3-probes \
--enable-pie \
--with-rpm \
--enable-sqlite \
--disable-silent-rules \
--with-extra-version="rpm %{version}-%{release}"
%make_build
%{_emacs_bytecompile} emacs/systemtap-mode.el
%install
rm -rf ${RPM_BUILD_ROOT}
%make_install
make DESTDIR=$RPM_BUILD_ROOT install
%find_lang %{name}
for dir in $(ls -1d $RPM_BUILD_ROOT%{_mandir}/{??,??_??}) ; do
dir=$(echo $dir | sed -e "s|^$RPM_BUILD_ROOT||")
lang=$(basename $dir)
echo "%%lang($lang) $dir/man*/*" >> %{name}.lang
done
cp testsuite $RPM_BUILD_ROOT%{_datadir}/systemtap -r
ln -s %{_datadir}/systemtap/examples
find $RPM_BUILD_ROOT%{_datadir}/systemtap/examples -type f -name '*.stp' -print0 | xargs -0 sed -i -r -e '1s@^#!.+stap@#!%{_bindir}/stap@'
chmod 755 $RPM_BUILD_ROOT%{_bindir}/staprun
install -c -m 755 stap-prep $RPM_BUILD_ROOT%{_bindir}/stap-prep
cp -rp testsuite $RPM_BUILD_ROOT%{_datadir}/systemtap
mkdir docs.installed
mv $RPM_BUILD_ROOT%{_datadir}/doc/systemtap/*.pdf docs.installed/
install -D -m 644 macros.systemtap $RPM_BUILD_ROOT%{_rpmmacrodir}/macros.systemtap
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/stap-server
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/stap-server
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/stap-server/.systemtap
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/stap-server
touch $RPM_BUILD_ROOT%{_localstatedir}/log/stap-server/log
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/systemtap
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/systemtap
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -m 644 initscript/logrotate.stap-server $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/stap-server
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
touch $RPM_BUILD_ROOT%{_unitdir}/systemtap.service
install -m 644 initscript/systemtap.service $RPM_BUILD_ROOT%{_unitdir}/systemtap.service
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
install -m 755 initscript/systemtap $RPM_BUILD_ROOT%{_sbindir}/systemtap-service
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/systemtap
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/systemtap/conf.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/systemtap/script.d
install -m 644 initscript/config.systemtap $RPM_BUILD_ROOT%{_sysconfdir}/systemtap/config
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
touch $RPM_BUILD_ROOT%{_unitdir}/stap-server.service
install -m 644 stap-server.service $RPM_BUILD_ROOT%{_unitdir}/stap-server.service
mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}
install -m 644 stap-server.conf $RPM_BUILD_ROOT%{_tmpfilesdir}/stap-server.conf
mkdir -p $RPM_BUILD_ROOT%{_emacs_sitelispdir}
install -p -m 644 emacs/systemtap-mode.el* $RPM_BUILD_ROOT%{_emacs_sitelispdir}
mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir}
install -p -m 644 emacs/systemtap-init.el $RPM_BUILD_ROOT%{_emacs_sitestartdir}/systemtap-init.el
for subdir in ftdetect ftplugin indent syntax
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/$subdir
install -p -m 644 vim/$subdir/*.vim $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/$subdir
done
mkdir -p $RPM_BUILD_ROOT%{dracutstap}
mkdir -p $RPM_BUILD_ROOT%{udevrulesdir}
install -D -m 755 stap-prep $RPM_BUILD_ROOT%{_bindir}/stap-prep
install -D -m 644 macros.systemtap $RPM_BUILD_ROOT%{_rpmmacrodir}/macros.systemtap
install -D -m 644 initscript/logrotate.stap-server $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/stap-server
install -D -m 644 initscript/systemtap.service $RPM_BUILD_ROOT%{_unitdir}/systemtap.service
install -D -m 755 initscript/systemtap $RPM_BUILD_ROOT%{_sbindir}/systemtap-service
install -D -m 644 initscript/config.systemtap $RPM_BUILD_ROOT%{_sysconfdir}/systemtap/config
install -D -m 644 stap-server.service $RPM_BUILD_ROOT%{_unitdir}/stap-server.service
install -D -m 644 stap-server.conf $RPM_BUILD_ROOT%{_tmpfilesdir}/stap-server.conf
install -D -m 644 emacs/systemtap-init.el $RPM_BUILD_ROOT%{_emacs_sitestartdir}/systemtap-init.el
install -D -m 644 emacs/systemtap-mode.el* $RPM_BUILD_ROOT%{_emacs_sitelispdir}/
install -D -m 644 vim/ftdetect/*.vim $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/ftdetect/*.vim
install -D -m 644 vim/ftplugin/*.vim $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/ftplugin/*.vim
install -D -m 644 vim/indent/*.vim $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/indent/*.vim
install -D -m 644 vim/syntax/*.vim $RPM_BUILD_ROOT%{_datadir}/vim/vimfiles/syntax/*.vim
install -D -m 644 staprun/guest/99-stapsh.rules $RPM_BUILD_ROOT%{udevrulesdir}/
install -D -m 644 staprun/guest/stapsh@.service $RPM_BUILD_ROOT%{_unitdir}/
install -D -m 755 initscript/99stap/module-setup.sh $RPM_BUILD_ROOT%{dracutstap}/
install -D -m 755 initscript/99stap/install $RPM_BUILD_ROOT%{dracutstap}/
install -D -m 755 initscript/99stap/check $RPM_BUILD_ROOT%{dracutstap}/
install -D -m 755 initscript/99stap/start-staprun.sh $RPM_BUILD_ROOT%{dracutstap}/
install -D -m 755 stap-exporter/stap-exporter $RPM_BUILD_ROOT%{_bindir}/
install -D -m 644 stap-exporter/stap-exporter.service $RPM_BUILD_ROOT%{_unitdir}/
install -D -m 644 stap-exporter/stap-exporter.8* $RPM_BUILD_ROOT%{_mandir}/man8/
touch $RPM_BUILD_ROOT%{_localstatedir}/log/stap-server/log
install -p -m 755 initscript/99stap/module-setup.sh $RPM_BUILD_ROOT%{dracutstap}
install -p -m 755 initscript/99stap/install $RPM_BUILD_ROOT%{dracutstap}
install -p -m 755 initscript/99stap/check $RPM_BUILD_ROOT%{dracutstap}
install -p -m 755 initscript/99stap/start-staprun.sh $RPM_BUILD_ROOT%{dracutstap}
touch $RPM_BUILD_ROOT%{dracutstap}/params.conf
touch $RPM_BUILD_ROOT%{_unitdir}/systemtap.service
%pre
getent group stapusr >/dev/null || groupadd -r stapusr
getent group stapsys >/dev/null || groupadd -r stapsys
getent group stapdev >/dev/null || groupadd -r stapde
getent group stap-server >/dev/null || groupadd -r stap-server
getent passwd stap-server >/dev/null || useradd -c "Systemtap Compile Server" -g stap-server -d /var/lib/stap-server -r -s /sbin/nologin stap-server
mkdir -p $RPM_BUILD_ROOT/stap-exporter
install -p -m 755 stap-exporter/stap-exporter $RPM_BUILD_ROOT%{_bindir}
install -m 644 stap-exporter/stap-exporter.service $RPM_BUILD_ROOT%{_unitdir}
install -m 644 stap-exporter/stap-exporter.8* $RPM_BUILD_ROOT%{_mandir}/man8
%post
test -e ~stap-server && chmod 750 ~stap-server
if [ ! -f ~stap-server/.systemtap/rc ]; then
mkdir -p ~stap-server/.systemtap
chown stap-server:stap-server ~stap-server/.systemtap
numcpu=`/usr/bin/getconf _NPROCESSORS_ONLN`
if [ -z "$numcpu" -o "$numcpu" -lt 1 ]; then numcpu=1; fi
nproc=`expr $numcpu \* 30`
echo "--rlimit-as=614400000 --rlimit-cpu=60 --rlimit-nproc=$nproc --rlimit-stack=1024000 --rlimit-fsize=51200000" > ~stap-server/.systemtap/rc
chown stap-server:stap-server ~stap-server/.systemtap/rc
fi
test -e /var/log/stap-server/log || {
touch /var/log/stap-server/log
chmod 644 /var/log/stap-server/log
chown stap-server:stap-server /var/log/stap-server/log
}
/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/stap-server.conf >/dev/null 2>&1 || :
/bin/systemctl enable systemtap.service >/dev/null 2>&1 || :
if [ -d /dev/virtio-ports ]; then
(find /dev/virtio-ports -iname 'org.systemtap.stapsh.[0-9]*' -type l \
| xargs -n 1 basename \
| xargs -n 1 -I {} /bin/systemctl start stapsh@{}.service) >/dev/null 2>&1 || :
fi
exit 0
make -C %{_datadir}/systemtap/runtime/uprobes clean || true
/sbin/rmmod uprobes || true
%preun
if [ $1 = 0 ]; then
for service in `/bin/systemctl --full | grep stapsh@ | cut -d ' ' -f 1`; do
/bin/systemctl stop $service >/dev/null 2>&1 || :
done
fi
/bin/systemctl --no-reload disable stap-server.service >/dev/null 2>&1 || :
/bin/systemctl stop stap-server.service >/dev/null 2>&1 || :
make -C %{_datadir}/systemtap/runtime/uprobes clean || true
/sbin/rmmod uprobes || true
%pre runtime
getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr
getent group stapsys >/dev/null || groupadd -g 157 -r stapsys 2>/dev/null || groupadd -r stapsys
getent group stapdev >/dev/null || groupadd -g 158 -r stapdev 2>/dev/null || groupadd -r stapdev
exit 0
%postun
if [ "$1" -ge "1" ] ; then
/bin/systemctl condrestart stap-server.service >/dev/null 2>&1 || :
fi
if [ "$1" -ge "1" ]; then
for service in `/bin/systemctl --full | grep stapsh@ | cut -d ' ' -f 1`; do
/bin/systemctl condrestart $service >/dev/null 2>&1 || :
done
fi
%triggerin -- systemtap-server
if test -e ~stap-server/.systemtap/ssl/server/stap.cert; then
/usr/libexec/systemtap/stap-authorize-cert ~stap-server/.systemtap/ssl/server/stap.cert /etc/systemtap/ssl/client >/dev/null
/usr/libexec/systemtap/stap-authorize-cert ~stap-server/.systemtap/ssl/server/stap.cert /etc/systemtap/staprun >/dev/null
fi
exit 0
%pre server
getent group stap-server >/dev/null || groupadd -g 155 -r stap-server 2>/dev/null || groupadd -r stap-server
getent passwd stap-server >/dev/null || \
useradd -c "Systemtap Compile Server" -u 155 -g stap-server -d %{_localstatedir}/lib/stap-server -r -s /sbin/nologin stap-server 2>/dev/null || \
useradd -c "Systemtap Compile Server" -g stap-server -d %{_localstatedir}/lib/stap-server -r -s /sbin/nologin stap-server
%pre testsuite
getent passwd stapusr >/dev/null || \
@@ -308,113 +279,200 @@ getent passwd stapdev >/dev/null || \
useradd -c "Systemtap 'stapdev' User" -g stapdev -G stapusr -r -s /sbin/nologin stapdev
exit 0
%post server
test -e ~stap-server && chmod 750 ~stap-server
if [ ! -f ~stap-server/.systemtap/rc ]; then
mkdir -p ~stap-server/.systemtap
chown stap-server:stap-server ~stap-server/.systemtap
numcpu=`/usr/bin/getconf _NPROCESSORS_ONLN`
if [ -z "$numcpu" -o "$numcpu" -lt 1 ]; then numcpu=1; fi
nproc=`expr $numcpu \* 30`
echo "--rlimit-as=614400000 --rlimit-cpu=60 --rlimit-nproc=$nproc --rlimit-stack=1024000 --rlimit-fsize=51200000" > ~stap-server/.systemtap/rc
chown stap-server:stap-server ~stap-server/.systemtap/rc
fi
%triggerin -- java-1.8.0-openjdk, java-1.7.0-openjdk, java-1.6.0-openjdk
for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do
arch=`basename $f | cut -f2 -d_ | cut -f1 -d.`
for archdir in %{_jvmdir}/*openjdk*/jre/lib/${arch}; do
if [ -d ${archdir} ]; then
ln -sf %{_libexecdir}/systemtap/libHelperSDT_${arch}.so ${archdir}/libHelperSDT_${arch}.so
ln -sf %{_libexecdir}/systemtap/HelperSDT.jar ${archdir}/../ext/HelperSDT.jar
fi
done
done
test -e %{_localstatedir}/log/stap-server/log || {
touch %{_localstatedir}/log/stap-server/log
chmod 644 %{_localstatedir}/log/stap-server/log
chown stap-server:stap-server %{_localstatedir}/log/stap-server/log
}
/bin/systemd-tmpfiles --create %{_tmpfilesdir}/stap-server.conf >/dev/null 2>&1 || :
exit 0
%triggerun -- java-1.8.0-openjdk, java-1.7.0-openjdk, java-1.6.0-openjdk
for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do
arch=`basename $f | cut -f2 -d_ | cut -f1 -d.`
for archdir in %{_jvmdir}/*openjdk*/jre/lib/${arch}; do
rm -f ${archdir}/libHelperSDT_${arch}.so
rm -f ${archdir}/../ext/HelperSDT.jar
done
done
%triggerin client -- systemtap-server
if test -e ~stap-server/.systemtap/ssl/server/stap.cert; then
%{_libexecdir}/systemtap/stap-authorize-cert ~stap-server/.systemtap/ssl/server/stap.cert %{_sysconfdir}/systemtap/ssl/client >/dev/null
%{_libexecdir}/systemtap/stap-authorize-cert ~stap-server/.systemtap/ssl/server/stap.cert %{_sysconfdir}/systemtap/staprun >/dev/null
fi
exit 0
%triggerpostun -- java-1.8.0-openjdk, java-1.7.0-openjdk, java-1.6.0-openjdk
for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do
arch=`basename $f | cut -f2 -d_ | cut -f1 -d.`
for archdir in %{_jvmdir}/*openjdk*/jre/lib/${arch}; do
if [ -d ${archdir} ]; then
ln -sf %{_libexecdir}/systemtap/libHelperSDT_${arch}.so ${archdir}/libHelperSDT_${arch}.so
ln -sf %{_libexecdir}/systemtap/HelperSDT.jar ${archdir}/../ext/HelperSDT.jar
fi
done
done
%preun server
if [ $1 = 0 ] ; then
/bin/systemctl --no-reload disable stap-server.service >/dev/null 2>&1 || :
/bin/systemctl stop stap-server.service >/dev/null 2>&1 || :
fi
exit 0
%postun server
if [ "$1" -ge "1" ] ; then
/bin/systemctl condrestart stap-server.service >/dev/null 2>&1 || :
fi
exit 0
%postun
if [ "$1" -ge "1" ] ; then
/bin/systemctl condrestart systemtap.service >/dev/null 2>&1 || :
fi
exit 0
%preun stap-exporter
/bin/systemctl stop stap-exporter.service >/dev/null 2>&1 || :
/bin/systemctl disable stap-exporter.service >/dev/null 2>&1 || :
%post
/bin/systemctl enable systemtap.service >/dev/null 2>&1 || :
(make -C %{_datadir}/systemtap/runtime/uprobes clean) >/dev/null 2>&1 || true
(/sbin/rmmod uprobes) >/dev/null 2>&1 || true
%preun
if [ $1 = 0 ] ; then
/bin/systemctl --no-reload disable systemtap.service >/dev/null 2>&1 || :
/bin/systemctl stop systemtap.service >/dev/null 2>&1 || :
fi
exit 0
(make -C %{_datadir}/systemtap/runtime/uprobes clean) >/dev/null 2>&1 || true
(/sbin/rmmod uprobes) >/dev/null 2>&1 || true
%files
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/python3.7/site-packages/*
%{_datadir}/systemtap/examples/*
%{_datadir}/systemtap/tapset
%{_datadir}/systemtap/runtime/*
%{_datadir}/vim/vimfiles/*/*
%{dracutstap}
%{udevrulesdir}/*
%dir %{_libexecdir}/systemtap
%{_libexecdir}/systemtap/*
%{_unitdir}/stap-exporter.service
%{_unitdir}/stap-server.service
%{_unitdir}/stapsh@.service
%license COPYING
%doc README README.unprivileged AUTHORS NEWS
%defattr(-,root,root)
%{_unitdir}/systemtap.service
%{_sbindir}/systemtap-service
%dir %{_sysconfdir}/systemtap
%dir %{_sysconfdir}/systemtap/conf.d
%dir %{_sysconfdir}/systemtap/script.d
%config(noreplace) %{_sysconfdir}/systemtap/config
%dir %{_localstatedir}/cache/systemtap
%ghost %{_localstatedir}/run/systemtap
%dir %{dracutstap}
%{dracutstap}/*
%files server -f systemtap.lang
%defattr(-,root,root)
%{_bindir}/stap-server
%dir %{_libexecdir}/systemtap
%{_libexecdir}/systemtap/stap-serverd
%{_libexecdir}/systemtap/stap-start-server
%{_libexecdir}/systemtap/stap-stop-server
%{_libexecdir}/systemtap/stap-gen-cert
%{_libexecdir}/systemtap/stap-sign-module
%{_libexecdir}/systemtap/stap-authorize-cert
%{_libexecdir}/systemtap/stap-env
%{_unitdir}/stap-server.service
%{_tmpfilesdir}/stap-server.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/stap-server
%dir %{_sysconfdir}/stap-server
%dir %attr(0750,stap-server,stap-server) %{_localstatedir}/lib/stap-server
%dir %attr(0700,stap-server,stap-server) %{_localstatedir}/lib/stap-server/.systemtap
%dir %attr(0755,stap-server,stap-server) %{_localstatedir}/log/stap-server
%ghost %config(noreplace) %attr(0644,stap-server,stap-server) %{_localstatedir}/log/stap-server/log
%ghost %attr(0755,stap-server,stap-server) %{_localstatedir}/run/stap-server
%{!?_licensedir:%global license %%doc}
%files devel -f systemtap.lang
%{_bindir}/stap
%{_bindir}/stap-prep
%{_bindir}/stap-report
%dir %{_datadir}/systemtap
%{_datadir}/systemtap/runtime
%{_datadir}/systemtap/tapset
%{!?_licensedir:%global license %%doc}
%dir %{_libexecdir}/systemtap
%{_emacs_sitelispdir}/*.el*
%{_emacs_sitestartdir}/systemtap-init.el
%config(noreplace) %{_sysconfdir}/logrotate.d/stap-server
%config(noreplace) %{_sysconfdir}/systemtap/config
%ghost %config(noreplace) %attr(0644,stap-server,stap-server) %{_localstatedir}/log/stap-server/log
/etc/sysconfig/stap-exporter
/etc/stap-exporter
%doc README README.unprivileged AUTHORS NEWS
%license COPYING
%if %{with_crash}
%dir %{_libdir}/systemtap
%{_libdir}/%{name}/staplog.so*
%{_exec_prefix}/lib/debug/usr/lib64/%{name}/staplog.so-%{version}-%{release}.x86_64.debug
%endif
%exclude %{_bindir}/dtrace
%exclude %{python3_sitearch}/HelperSDT
%exclude %{python3_sitearch}/HelperSDT-*.egg-info
%exclude %{_libexecdir}/systemtap/libHelperSDT_*.so
%exclude %{_libexecdir}/systemtap/HelperSDT.jar
%exclude %{_libexecdir}/systemtap/stapbm
%{_datadir}/vim/vimfiles/*/*.vim
%{_libexecdir}/systemtap/python/stap-resolve-module-function.py
%files runtime-java
%files runtime -f systemtap.lang
%defattr(-,root,root)
%attr(4110,root,stapusr) %{_bindir}/staprun
%{_bindir}/stapsh
%{_bindir}/stap-merge
%{_bindir}/stap-report
%{_bindir}/stapbpf
%dir %{_libexecdir}/systemtap
%{_libexecdir}/systemtap/libHelperSDT_*.so
%{_libexecdir}/systemtap/HelperSDT.jar
%{_libexecdir}/systemtap/stapbm
%{_libexecdir}/systemtap/stapio
%{_libexecdir}/systemtap/stap-authorize-cert
%{!?_licensedir:%global license %%doc}
%if %{with_dyninst}
%{_bindir}/stapdyn
%endif
%if %{with_crash}
%dir %{_libdir}/systemtap
%{_libdir}/systemtap/staplog.so*
%endif
%files runtime-python3
%{python3_sitearch}/HelperSDT
%{python3_sitearch}/HelperSDT-*.egg-info
%files client -f systemtap.lang
%defattr(-,root,root)
%{_datadir}/systemtap/examples
%{!?_licensedir:%global license %%doc}
%license COPYING
%doc docs.installed/*.pdf
%{_bindir}/stap
%{_bindir}/stap-prep
%{_bindir}/stap-report
%dir %{_datadir}/systemtap
%{_datadir}/systemtap/tapset
%files sdt-devel
%defattr(-,root,root)
%{_bindir}/dtrace
%{_includedir}/sys/sdt.h
%{_includedir}/sys/sdt-config.h
%{_mandir}/man1/dtrace.1*
%{_rpmmacrodir}/macros.systemtap
%doc README AUTHORS NEWS
%license COPYING
%{!?_licensedir:%global license %%doc}
%files testsuite
%defattr(-,root,root)
%dir %{_datadir}/systemtap
%{_datadir}/systemtap/testsuite
%files runtime-python3
%{python3_sitearch}/HelperSDT
%{python3_sitearch}/HelperSDT-*.egg-info
%files stap-exporter
%{_unitdir}/stap-exporter.service
%{_bindir}/stap-exporter
/etc/stap-exporter/*
/usr/sbin/stap-exporter
/etc/sysconfig/stap-exporter
%files help
%{_mandir}/man1/*
%{_mandir}/man3/*
%{_mandir}/man7/*
%{_mandir}/man8/*
%{_datadir}/doc/*
%exclude %{_mandir}/man1/dtrace.1*
%files lang -f systemtap.lang
%{_mandir}/man[1378]/*
%changelog
* Fri Apr 8 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 4.5-3
- Add int type cast to resolve gcc issue for option Wformat=2
* Tue Feb 15 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 4.5-2
- Remove requires on gcc and systemtap-devel
* Thu Dec 2 2021 zhouwenpei <zhouwenpei1@huawei.com> - 4.5-1
- upgrade to 4.5
* Mon Feb 1 2021 xinghe <xinghe1@huawei.com> - 4.4-1
- upgrade to 4.4
* Tue Jul 21 2020 jinzhimin <jinzhimin2@huawei.com> - 4.3-1
- upgrade to 4.3
* Fri Mar 13 2020 yuxiangyang <yuxiangyang4@huawei.com> - 4.1.3
- remove java-runtime
* Fri Feb 21 2020 yuxiangyang <yuxiangyang4@huawei.com> - 4.1.2
- Delete the requirement of python2-pyparsing
* Mon Aug 12 2019 openEuler Buildteam <buildteam@openeuler.org> - 4.1.1
- Package init
+4
View File
@@ -0,0 +1,4 @@
version_control: git
src_repo: https://sourceware.org/git/systemtap.git
tag_prefix: ^release-
seperator: .