From 6b782ce63858e9a5de0ee1c33c412fd8bf195c01 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 05 2015 13:18:33 +0000 Subject: import sysstat-10.1.5-7.el7 --- diff --git a/SOURCES/sysstat-10.1.5-dyn-tick.patch b/SOURCES/sysstat-10.1.5-dyn-tick.patch new file mode 100644 index 0000000..133fa0d --- /dev/null +++ b/SOURCES/sysstat-10.1.5-dyn-tick.patch @@ -0,0 +1,48 @@ +diff -ur sysstat-10.1.5.orig/common.c sysstat-10.1.5/common.c +--- sysstat-10.1.5.orig/common.c 2013-03-23 17:31:46.000000000 +0100 ++++ sysstat-10.1.5/common.c 2014-09-01 22:29:48.173500407 +0200 +@@ -501,26 +501,13 @@ + hz = (unsigned int) ticks; + } + +-/* +- *************************************************************************** +- * Handle overflow conditions properly for counters which are read as +- * unsigned long long, but which can be unsigned long long or +- * unsigned long only depending on the kernel version used. +- * @value1 and @value2 being two values successively read for this +- * counter, if @value2 < @value1 and @value1 <= 0xffffffff, then we can +- * assume that the counter's type was unsigned long and has overflown, and +- * so the difference @value2 - @value1 must be casted to this type. +- * NOTE: These functions should no longer be necessary to handle a particular +- * stat counter when we can assume that everybody is using a recent kernel +- * (defining this counter as unsigned long long). +- *************************************************************************** +- */ + double ll_sp_value(unsigned long long value1, unsigned long long value2, + unsigned long long itv) + { +- if ((value2 < value1) && (value1 <= 0xffffffff)) +- /* Counter's type was unsigned long and has overflown */ +- return ((double) ((value2 - value1) & 0xffffffff)) / itv * 100; ++ /* Workaround: dyn-tick kernel has a race issue and /proc/stat values ++ could be backward. */ ++ if (value2 < value1) ++ return (double) 0; + else + return SP_VALUE(value1, value2, itv); + } +@@ -528,9 +515,10 @@ + double ll_s_value(unsigned long long value1, unsigned long long value2, + unsigned long long itv) + { +- if ((value2 < value1) && (value1 <= 0xffffffff)) +- /* Counter's type was unsigned long and has overflown */ +- return ((double) ((value2 - value1) & 0xffffffff)) / itv * HZ; ++ /* Workaround: dyn-tick kernel has a race issue and /proc/stat values ++ could be backward. */ ++ if (value2 < value1) ++ return (double) 0; + else + return S_VALUE(value1, value2, itv); + } diff --git a/SOURCES/sysstat-10.1.5-elapsed-time.patch b/SOURCES/sysstat-10.1.5-elapsed-time.patch new file mode 100644 index 0000000..6ecd64c --- /dev/null +++ b/SOURCES/sysstat-10.1.5-elapsed-time.patch @@ -0,0 +1,24 @@ +diff -ur sysstat-10.1.5.orig/man/iostat.in sysstat-10.1.5/man/iostat.in +--- sysstat-10.1.5.orig/man/iostat.in 2012-11-27 21:20:34.000000000 +0100 ++++ sysstat-10.1.5/man/iostat.in 2014-11-11 17:44:29.563840350 +0100 +@@ -264,7 +264,7 @@ + .RE + .B %util + .RS +-Percentage of CPU time during which I/O requests were issued to the device ++Percentage of elapsed time during which I/O requests were issued to the device + (bandwidth utilization for the device). Device saturation occurs when this + value is close to 100%. + .RE +diff -ur sysstat-10.1.5.orig/man/sar.in sysstat-10.1.5/man/sar.in +--- sysstat-10.1.5.orig/man/sar.in 2012-09-30 15:11:06.000000000 +0200 ++++ sysstat-10.1.5/man/sar.in 2014-11-11 17:45:00.682712161 +0100 +@@ -306,7 +306,7 @@ + + .B %util + .RS +-Percentage of CPU time during which I/O requests were issued to the device ++Percentage of elapsed time during which I/O requests were issued to the device + (bandwidth utilization for the device). Device saturation occurs when this + value is close to 100%. + .RE diff --git a/SOURCES/sysstat-10.1.5-overwrite-sa.patch b/SOURCES/sysstat-10.1.5-overwrite-sa.patch new file mode 100644 index 0000000..1b72d7b --- /dev/null +++ b/SOURCES/sysstat-10.1.5-overwrite-sa.patch @@ -0,0 +1,37 @@ +diff -ur sysstat-10.1.5.orig/sa1.in sysstat-10.1.5/sa1.in +--- sysstat-10.1.5.orig/sa1.in 2012-05-13 15:00:56.000000000 +0200 ++++ sysstat-10.1.5/sa1.in 2014-09-01 21:56:13.197869126 +0200 +@@ -10,15 +10,15 @@ + # Used only if ${SYSCONFIG_DIR}/sysstat doesn't exist! + HISTORY=0 + SADC_OPTIONS="" +- ++DDIR=@SA_DIR@ ++DATE=`date +%d` ++CURRENTFILE=sa${DATE} ++CURRENTDIR=`date +%Y%m` + SYSCONFIG_DIR=@SYSCONFIG_DIR@ ++umask 0022 + [ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat + if [ ${HISTORY} -gt 28 ] + then +- CURRENTDIR=`date +%Y%m` +- DATE=`date +%d` +- CURRENTFILE=sa${DATE} +- DDIR=@SA_DIR@ + cd ${DDIR} || exit 1 + [ -d ${CURRENTDIR} ] || mkdir -p ${CURRENTDIR} + # If ${CURRENTFILE} exists and is a regular file, then make sure +@@ -33,8 +33,11 @@ + # the (new) current file + rm -f ${CURRENTFILE} + ln -s ${CURRENTDIR}/${CURRENTFILE} ${CURRENTFILE} ++else ++ # If ${CURRENTFILE} exists, is a regular file and is from a previous ++ # month then delete it so that it is recreated by sadc afresh ++ [ -f ${CURRENTFILE} ] && [ "`date +%Y%m -r ${CURRENTFILE}`" -lt "${CURRENTDIR}" ] && rm -f ${CURRENTFILE} + fi +-umask 0022 + ENDIR=@SA_LIB_DIR@ + cd ${ENDIR} + [ "$1" = "--boot" ] && shift && BOOT=y || BOOT=n diff --git a/SOURCES/sysstat-10.1.5-sa2-xz.patch b/SOURCES/sysstat-10.1.5-sa2-xz.patch new file mode 100644 index 0000000..ea352d3 --- /dev/null +++ b/SOURCES/sysstat-10.1.5-sa2-xz.patch @@ -0,0 +1,12 @@ +diff -ur sysstat-10.1.5.orig/sa2.in sysstat-10.1.5/sa2.in +--- sysstat-10.1.5.orig/sa2.in 2012-03-15 16:48:56.000000000 +0100 ++++ sysstat-10.1.5/sa2.in 2014-09-01 22:10:39.901270008 +0200 +@@ -50,7 +50,7 @@ + cd ${ENDIR} + [ -L ${RPT} ] && rm -f ${RPT} + ${ENDIR}/sar $* -f ${DFILE} > ${RPT} +-find ${DDIR} \( -name 'sar??' -o -name 'sa??' -o -name 'sar??.gz' -o -name 'sa??.gz' -o -name 'sar??.bz2' -o -name 'sa??.bz2' \) \ ++find ${DDIR} \( -name 'sar??' -o -name 'sa??' -o -name 'sar??.xz' -o -name 'sa??.xz' -o -name 'sar??.gz' -o -name 'sa??.gz' -o -name 'sar??.bz2' -o -name 'sa??.bz2' \) \ + -mtime +"${HISTORY}" -exec rm -f {} \; + find ${DDIR} \( -name 'sar??' -o -name 'sa??' \) -type f -mtime +"${COMPRESSAFTER}" \ + -exec ${ZIP} {} \; > /dev/null 2>&1 diff --git a/SOURCES/sysstat-10.1.5-single-cpu-cifs.patch b/SOURCES/sysstat-10.1.5-single-cpu-cifs.patch new file mode 100644 index 0000000..a6c72a7 --- /dev/null +++ b/SOURCES/sysstat-10.1.5-single-cpu-cifs.patch @@ -0,0 +1,99 @@ +diff -upr sysstat-10.1.5.orig/cifsiostat.c sysstat-10.1.5/cifsiostat.c +--- sysstat-10.1.5.orig/cifsiostat.c 2013-03-23 17:31:46.000000000 +0100 ++++ sysstat-10.1.5/cifsiostat.c 2014-09-29 14:23:37.600574444 +0200 +@@ -43,7 +43,6 @@ + #define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ + char *sccsid(void) { return (SCCSID); } + +-unsigned long long uptime[2] = {0, 0}; + unsigned long long uptime0[2] = {0, 0}; + struct cifs_stats *st_cifs[2]; + struct io_hdr_stats *st_hdr_cifs; +@@ -474,13 +473,8 @@ void write_stats(int curr, struct tm *re + #endif + } + +- /* Interval is multiplied by the number of processors */ +- itv = get_interval(uptime[!curr], uptime[curr]); +- +- if (cpu_nr > 1) { +- /* On SMP machines, reduce itv to one processor (see note above) */ +- itv = get_interval(uptime0[!curr], uptime0[curr]); +- } ++ /* Interval of time, reduced to one processor */ ++ itv = get_interval(uptime0[!curr], uptime0[curr]); + + shi = st_hdr_cifs; + +@@ -527,15 +521,12 @@ void rw_io_stat_loop(long int count, str + setbuf(stdout, NULL); + + do { +- if (cpu_nr > 1) { +- /* +- * Read system uptime (only for SMP machines). +- * Init uptime0. So if /proc/uptime cannot fill it, +- * this will be done by /proc/stat. +- */ +- uptime0[curr] = 0; +- read_uptime(&(uptime0[curr])); +- } ++ /* Read system uptime (reduced to one processor) */ ++ uptime0[curr] = 0; ++ read_uptime(&(uptime0[curr])); ++ if (!uptime0[curr]) ++ /* Cannot read system uptime (/proc/uptime doesn't exist) */ ++ exit(2); + + /* Read CIFS stats */ + read_cifs_stat(curr); +diff -upr sysstat-10.1.5.orig/nfsiostat.c sysstat-10.1.5/nfsiostat.c +--- sysstat-10.1.5.orig/nfsiostat.c 2013-03-23 17:31:46.000000000 +0100 ++++ sysstat-10.1.5/nfsiostat.c 2014-09-29 14:23:37.601574440 +0200 +@@ -42,7 +42,6 @@ + #define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__ + char *sccsid(void) { return (SCCSID); } + +-unsigned long long uptime[2] = {0, 0}; + unsigned long long uptime0[2] = {0, 0}; + struct io_nfs_stats *st_ionfs[2]; + struct io_hdr_stats *st_hdr_ionfs; +@@ -541,13 +540,8 @@ void write_stats(int curr, struct tm *re + #endif + } + +- /* Interval is multiplied by the number of processors */ +- itv = get_interval(uptime[!curr], uptime[curr]); +- +- if (cpu_nr > 1) { +- /* On SMP machines, reduce itv to one processor (see note above) */ +- itv = get_interval(uptime0[!curr], uptime0[curr]); +- } ++ /* Interval of time, reduced to one processor */ ++ itv = get_interval(uptime0[!curr], uptime0[curr]); + + shi = st_hdr_ionfs; + +@@ -595,15 +589,13 @@ void rw_io_stat_loop(long int count, str + setbuf(stdout, NULL); + + do { +- if (cpu_nr > 1) { +- /* +- * Read system uptime (only for SMP machines). +- * Init uptime0. So if /proc/uptime cannot fill it, +- * this will be done by /proc/stat. +- */ +- uptime0[curr] = 0; +- read_uptime(&(uptime0[curr])); +- } ++ /* Read system uptime (reduced to one processor) */ ++ uptime0[curr] = 0; ++ read_uptime(&(uptime0[curr])); ++ if (!uptime0[curr]) ++ /* Cannot read system uptime (/proc/uptime doesn't exist) */ ++ exit(2); ++ + /* Read NFS directories stats */ + read_nfs_stat(curr); + diff --git a/SOURCES/sysstat-10.1.5-sysstat-5.patch b/SOURCES/sysstat-10.1.5-sysstat-5.patch new file mode 100644 index 0000000..0818849 --- /dev/null +++ b/SOURCES/sysstat-10.1.5-sysstat-5.patch @@ -0,0 +1,118 @@ +diff -ur sysstat-10.1.5.orig/man/sysstat.in sysstat-10.1.5/man/sysstat.in +--- sysstat-10.1.5.orig/man/sysstat.in 2010-09-22 22:07:29.000000000 +0200 ++++ sysstat-10.1.5/man/sysstat.in 2014-09-01 22:50:58.614499671 +0200 +@@ -11,17 +11,99 @@ + configure sysstat logging. + The variables and their meanings are: + .TP ++.B COMPRESSAFTER ++Number of days after which daily data files are to be compressed. ++The compression program is given in the ++.B ZIP ++variable. ++ ++.TP + .B HISTORY + The number of days during which a daily data file or a report + should be kept. Data files or reports older than this number of + days will be removed by the + .BR sa2 (8) + shell script. ++Data files and reports are normally saved in the @SA_DIR@ directory, ++under the name ++.IR saDD ++(for data files) or ++.IR sarDD ++(for reports), where the DD parameter indicates the current day. + +-.TP +-.B COMPRESSAFTER +-Number of days after which daily data files are to be compressed, +-either by gzip or bzip2. ++The number of files actually kept in the @SA_DIR@ directory may be ++slightly higher than the ++.B HISTORY ++value due to the way the ++.B sa2 ++script figures ++out which files are to be removed (see below "How the ++.BR sa2 (8) ++script applies ++.B HISTORY ++value"). Using a value of 28 keeps a whole month's worth of data. ++ ++How the ++.BR sa2 (8) ++script applies ++.B HISTORY ++value ++ ++The ++.B sa2 ++script uses the "find" command with the "-mtime" option to figure ++out which files are to be removed. The "find" command interprets this value ++as "N 24 hour periods", ignoring any fractional part. This means that the ++last modified time of a given sa[r]DD data or report file, using a ++.B HISTORY ++of 1, has to have been modified at least two days ago before it will be ++removed. And for a ++.B HISTORY ++of 28 that would mean 29 days ago. ++ ++To figure out how a ++.B HISTORY ++of 28 is applied in practice, we need to ++consider that the ++.B sa2 ++script that issues the "find" command to remove the ++old files typically runs just before mid-night on a given system, and since ++the first record from ++.B sadc ++can also be written to the previous day's data file ++(thereby moving its modification time up a bit), the ++.B sa2 ++script will leave ++30 files untouched. So for a setting of 28, and counting the data file of ++the current day, there will always be 31 files (or 30 files, depending on the ++number of days in a month) in the @SA_DIR@ directory during the majority ++of a given day. E.g.: ++ ++April 30th: 31 files (Apr 30th-1st, Mar 31th) ++.br ++May 1st: 30 files (May 1st, Apr 30th-2nd) ++ ++Yet we can note the following exceptions (as inspected at Noon of the given ++day): ++ ++February 28th: 31 files (Feb 28th-1st, Jan 31st, 30th & 29th) ++.br ++March 1st: 30 files (Mar 1st, Feb 28th-2nd, Jan 31st & 30th) ++.br ++March 2nd: 29 files (Mar 1st & 2nd, Feb 28th-3rd, Jan. 31st) ++.br ++March 3rd: 28 files (Mar 1st-3rd, Feb 28th-4th) ++.br ++March 4th - March 28th: 28 files ++.br ++March 29th: 29 files ++.br ++March 30th: 30 files ++.br ++March 31st: 31 files ++ ++(Determining the number of files in March on a leap year is left as an ++exercise for the reader). + + .TP + .B SADC_OPTIONS +@@ -34,6 +116,10 @@ + These options are used only when a new data file is created. They will be + ignored with an already existing one. + ++.TP ++.B ZIP ++Program used to compress data and report files. ++ + .SH FILES + .IR @SYSCONFIG_DIR@/sysstat + diff --git a/SOURCES/sysstat-10.1.5-zip-conf.patch b/SOURCES/sysstat-10.1.5-zip-conf.patch new file mode 100644 index 0000000..7e4f7e3 --- /dev/null +++ b/SOURCES/sysstat-10.1.5-zip-conf.patch @@ -0,0 +1,10 @@ +diff -ur sysstat-10.1.5.orig/sysstat.sysconfig.in sysstat-10.1.5/sysstat.sysconfig.in +--- sysstat-10.1.5.orig/sysstat.sysconfig.in 2012-05-13 15:00:39.000000000 +0200 ++++ sysstat-10.1.5/sysstat.sysconfig.in 2014-09-01 23:08:48.412640491 +0200 +@@ -12,3 +12,6 @@ + # which are used for the generation of log files. + SADC_OPTIONS="@COLLECT_ALL@" + ++# Compression program to use. ++ZIP="@ZIP@" ++ diff --git a/SPECS/sysstat.spec b/SPECS/sysstat.spec index d68475c..e2d90e2 100644 --- a/SPECS/sysstat.spec +++ b/SPECS/sysstat.spec @@ -1,13 +1,27 @@ Summary: Collection of performance monitoring tools for Linux Name: sysstat Version: 10.1.5 -Release: 4%{?dist} +Release: 7%{?dist} License: GPLv2+ Group: Applications/System URL: http://sebastien.godard.pagesperso-orange.fr/ Source: http://pagesperso-orange.fr/sebastien.godard/%{name}-%{version}.tar.bz2 Patch0: sysstat-10.0.0-makefile.patch +# fixes 1100365 +Patch1: sysstat-10.1.5-overwrite-sa.patch +# fixes 1097294 +Patch2: sysstat-10.1.5-sa2-xz.patch +# fixes 1128569 +Patch3: sysstat-10.1.5-dyn-tick.patch +# fixes 1110852 +Patch4: sysstat-10.1.5-sysstat-5.patch +# fixes 1102610 +Patch5: sysstat-10.1.5-zip-conf.patch +# fixes 1146081 +Patch6: sysstat-10.1.5-single-cpu-cifs.patch +# fixes 1162773 +Patch7: sysstat-10.1.5-elapsed-time.patch Requires: /etc/cron.d, fileutils, grep, sh-utils, textutils Requires(post): systemd, systemd-sysv @@ -37,6 +51,13 @@ The cifsiostat command reports I/O statistics for CIFS file systems. %prep %setup -q %patch0 -p1 -b .ls +%patch1 -p1 -b .overwrite-sa +%patch2 -p1 -b .sa2-xz +%patch3 -p1 -b .dyn-tick +%patch4 -p1 -b .sysstat-5 +%patch5 -p1 -b .zip-conf +%patch6 -p1 -b .single-cpu-cifs +%patch7 -p1 -b .elapsed-time iconv -f windows-1252 -t utf8 CREDITS > CREDITS.aux mv CREDITS.aux CREDITS @@ -85,7 +106,7 @@ fi %files -f %{name}.lang %doc CHANGES COPYING CREDITS README FAQ -%config(noreplace) %{_sysconfdir}/cron.d/sysstat +%config(noreplace) %attr(0600,-,-) %{_sysconfdir}/cron.d/sysstat %config(noreplace) %{_sysconfdir}/sysconfig/sysstat %config(noreplace) %{_sysconfdir}/sysconfig/sysstat.ioconf %{_unitdir}/sysstat.service @@ -97,6 +118,30 @@ fi %{_localstatedir}/log/sa %changelog +* Wed Nov 12 2014 Peter Schiffer - 10.1.5-7 +- resolves: #1162773 + fixed incorrect description of util field on iostat(1) and sar(1) man pages + +* Mon Sep 29 2014 Peter Schiffer - 10.1.5-6 +- resolves: #1146081 + fixed issue when cifsiostat and nfsiostat were reporting incorrect statistics + on a single CPU machines + +* Mon Sep 1 2014 Peter Schiffer - 10.1.5-5 +- resolves: #1100365 + fixed issue when sa data files weren't correctly overwritten in some cases +- resolves: #1097294 + count with xz compressed files as well in sa2 script +- resolves: #1097292 + fix file mode of sysstat cron file +- resolves: #1128569 + added workaround for dyn-tick kernel feature which makes /proc/stat file + unreliable under certain circumstances +- resolves: #1110852 + added better explanation of HISTORY setting to sysstat(5) man page +- resolves: #1102610 + added possibility to set compress method in /etc/sysconfig/sysstat file + * Fri Jan 24 2014 Daniel Mach - 10.1.5-4 - Mass rebuild 2014-01-24