commit d5967aca0e0db6c1743222aa46315f1697f4142f Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:17:56 2019 -0400 Package init diff --git a/bugfix-sysstat-10.1.5-read-ttyAMA-first-for-arm64.patch b/bugfix-sysstat-10.1.5-read-ttyAMA-first-for-arm64.patch new file mode 100755 index 0000000..17b5d5f --- /dev/null +++ b/bugfix-sysstat-10.1.5-read-ttyAMA-first-for-arm64.patch @@ -0,0 +1,64 @@ +From cfddf05021b151fdd16830cef764bf180b273ec8 Mon Sep 17 00:00:00 2001 +From: Zhikun Shan +Date: Wed, 7 Aug 2019 02:23:19 -0400 +Subject: [PATCH] sysstat: bugfix sysstat 10.1.5 read ttyAMA first for arm64 + +reason:read ttyAMA first for arm64. +Signed-off-by: Zhikun Shan +--- + count.c | 7 +++++-- + rd_stats.c | 7 +++++-- + rd_stats.h | 1 + + 3 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/count.c b/count.c +index d84ae7a..56864d3 100644 +--- a/count.c ++++ b/count.c +@@ -317,8 +317,11 @@ __nr_t get_serial_nr(void) + char line[256]; + __nr_t sl = 0; + +- if ((fp = fopen(SERIAL, "r")) == NULL) +- return 0; /* No SERIAL file */ ++ if ((fp = fopen(TTYAMA, "r")) == NULL) { ++ if ((fp = fopen(SERIAL, "r")) == NULL) { ++ return 0; /* No SERIAL file */ ++ } ++ } + + while (fgets(line, sizeof(line), fp) != NULL) { + /* +diff --git a/rd_stats.c b/rd_stats.c +index 68e2799..8ccfec4 100644 +--- a/rd_stats.c ++++ b/rd_stats.c +@@ -871,8 +871,11 @@ __nr_t read_tty_driver_serial(struct stats_serial *st_serial, __nr_t nr_alloc) + char *p; + __nr_t sl_read = 0; + +- if ((fp = fopen(SERIAL, "r")) == NULL) +- return 0; ++ if ((fp = fopen(TTYAMA, "r")) == NULL) { ++ if ((fp = fopen(SERIAL, "r")) == NULL) { ++ return; ++ } ++ } + + while (fgets(line, sizeof(line), fp) != NULL ) { + +diff --git a/rd_stats.h b/rd_stats.h +index bc99127..599fbea 100644 +--- a/rd_stats.h ++++ b/rd_stats.h +@@ -54,6 +54,7 @@ + + /* Files */ + #define SERIAL PRE "/proc/tty/driver/serial" ++#define TTYAMA PRE "/proc/tty/driver/ttyAMA" + #define FDENTRY_STATE PRE "/proc/sys/fs/dentry-state" + #define FFILE_NR PRE "/proc/sys/fs/file-nr" + #define FINODE_STATE PRE "/proc/sys/fs/inode-state" +-- +2.19.1 + diff --git a/colorsysstat.csh b/colorsysstat.csh new file mode 100755 index 0000000..725e15a --- /dev/null +++ b/colorsysstat.csh @@ -0,0 +1,2 @@ +# Color sysstat output +if ( "$?S_COLORS" == 0 ) setenv S_COLORS auto diff --git a/colorsysstat.sh b/colorsysstat.sh new file mode 100755 index 0000000..2a4dfc7 --- /dev/null +++ b/colorsysstat.sh @@ -0,0 +1,2 @@ +# Color sysstat output +export S_COLORS=${S_COLORS-auto} diff --git a/sysstat-12.1.6.tar.xz b/sysstat-12.1.6.tar.xz new file mode 100755 index 0000000..c5ca975 Binary files /dev/null and b/sysstat-12.1.6.tar.xz differ diff --git a/sysstat.spec b/sysstat.spec new file mode 100755 index 0000000..58bdeef --- /dev/null +++ b/sysstat.spec @@ -0,0 +1,94 @@ +Name: sysstat +Version: 12.1.6 +Release: 1 +Summary: System performance tools for the Linux operating system +License: GPLv2+ +URL: http://sebastien.godard.pagesperso-orange.fr/ +Source0: http://sebastien.godard.pagesperso-orange.fr/%{name}-%{version}.tar.xz +Source1: colorsysstat.csh +Source2: colorsysstat.sh + +BuildRequires: gcc, gettext, lm_sensors-devel, systemd + +Requires: findutils, xz +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +Patch9000: bugfix-sysstat-10.1.5-read-ttyAMA-first-for-arm64.patch + + +%description +The sysstat package contains various utilities, common to many commercial +Unixes, to monitor system performance and usage activity: +iostat: reports CPU statistics and input/output statistics for block devices +and partitions. +mpstat: reports individual or combined processor related statistics. +pidstat: reports statistics for Linux tasks (processes) : I/O, CPU, memory, etc. +tapestat: reports statistics for tape drives connected to the system. +cifsiostat: reports CIFS statistics. +Sysstat also contains tools you can schedule via cron or systemd to collect and +historize performance and activity data: +sar: collects, reports and saves system activity information (see below a list +of metrics collected by sar). +sadc: is the system activity data collector, used as a backend for sar. +sa1: collects and stores binary data in the system activity daily data file. + It is a front end to sadc designed to be run from cron or systemd. +sa2: writes a summarized daily activity report. It is a front end to sar +designed to be run from cron or systemd. +sadf: displays data collected by sar in multiple formats (CSV, XML, JSON, etc.) + and can be used for data exchange with other programs. This command can also +be used to draw graphs for the various activities collected by sar using SVG ( +Scalable Vector Graphics) format. + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +export sadc_options="-S DISK" +export history="28" +export compressafter="31" +%configure \ + --docdir=%{_pkgdocdir} \ + --enable-install-cron \ + --enable-copy-only \ + --disable-file-attr \ + --disable-stripping +%make_build + +%install +%make_install +%find_lang %{name} +mkdir -p %{buildroot}%{_sysconfdir}/profile.d +install -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/profile.d +install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d + +%check + +%pre + +%preun +%systemd_preun sysstat.service sysstat-collect.timer sysstat-summary.timer +[ "$1" -gt 0 ] || rm -rf %{_localstatedir}/log/sa/* + +%post +%systemd_post sysstat.service sysstat-collect.timer sysstat-summary.timer + +%postun +%systemd_postun sysstat.service sysstat-collect.timer sysstat-summary.timer + +%files -f %{name}.lang +%doc CHANGES COPYING CREDITS FAQ.md README.md %{name}-%{version}.lsm +%config(noreplace) %{_sysconfdir}/sysconfig/sysstat +%config(noreplace) %{_sysconfdir}/sysconfig/sysstat.ioconf +%config(noreplace) %{_sysconfdir}/profile.d/* +%{_bindir}/* +%{_libdir}/sa +%{_unitdir}/sysstat* +%{_localstatedir}/log/sa +%{_mandir}/man*/* + +%changelog +* Sat Sep 07 2019 openEuler Buildteam - 12.1.6-1 +- Package init +