From 67ba6f6a2f27bfdcf3f1c4fff0a03a9e7cc6d839 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:48:16 +0000 Subject: import sysstat-10.1.5-13.el7 --- diff --git a/SOURCES/0001-pidstat-Display-stats-since-boot-time-for-a-list-of-.patch b/SOURCES/0001-pidstat-Display-stats-since-boot-time-for-a-list-of-.patch new file mode 100644 index 0000000..662c6a1 --- /dev/null +++ b/SOURCES/0001-pidstat-Display-stats-since-boot-time-for-a-list-of-.patch @@ -0,0 +1,52 @@ +From b4cad00cfb3086490261db7202de8ed846e79344 Mon Sep 17 00:00:00 2001 +From: Sebastien GODARD +Date: Wed, 2 Oct 2013 09:55:38 +0200 +Subject: [PATCH] pidstat: Display stats since boot time for a list of given + processes + +pidstat displays statistics since system startup when the interval and +count parameters are not set on the command line (eg. entering "pidstat +-d" will display I/O statistics for all processes that have had I/O +activity since boot time). But pidstat couldn't display those stats when +some PID numbers were entered on the command line (eg. "pidstat -d -p +1234" to display I/O stats since system startup for process 1234). +This patch makes it possible now. + +Signed-off-by: Sebastien GODARD +(cherry picked from commit 18c7a03f52826942a720b2a0cc32e1f074784c6a) + +Resolves: #1448489 +--- + pidstat.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/pidstat.c b/pidstat.c +index 3bb98f2..85d4d98 100644 +--- a/pidstat.c ++++ b/pidstat.c +@@ -1048,10 +1048,18 @@ int get_pid_to_display(int prev, int curr, int p, unsigned int activity, + + else if (DISPLAY_PID(pidflag)) { + *pstp = st_pid_list[prev] + p; +- +- if (!(*pstp)->pid) +- /* PID no longer exists */ +- return 0; ++ if (!(*pstp)->pid) { ++ if (interval) ++ /* PID no longer exists */ ++ return 0; ++ else { ++ /* ++ * If interval is null, then we are trying to ++ * display stats for a given process since boot time. ++ */ ++ *pstp = &st_pid_null; ++ } ++ } + } + + if (COMMAND_STRING(pidflag)) { +-- +2.13.6 + diff --git a/SOURCES/0001-sar-Improve-cpuinfo-read-for-POWER-architecture.patch b/SOURCES/0001-sar-Improve-cpuinfo-read-for-POWER-architecture.patch new file mode 100644 index 0000000..97556de --- /dev/null +++ b/SOURCES/0001-sar-Improve-cpuinfo-read-for-POWER-architecture.patch @@ -0,0 +1,47 @@ +From 81ef06797b16d08a4558a41891b9d9421a0a96f8 Mon Sep 17 00:00:00 2001 +From: Breno Leitao +Date: Mon, 31 Oct 2016 09:23:59 -0400 +Subject: [PATCH] sar: Improve cpuinfo read for POWER architecture + +Currently CPU frequency is not being read properly on POWER archicture. +It shows the frequency as: + # sar -m CPU 1 5 +... + 06:30:28 AM CPU MHz + 06:30:36 AM all 0.00 + +This is caused because /proc/cpuinfo is differently between Intel and +POWER. +This patch simply fix the parsing function (read_cpuinfo). + +Signed-off-by: Breno Leitao + +Resolves: #1440000 +--- + rd_stats.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/rd_stats.c b/rd_stats.c +index dafd975..d8c337a 100644 +--- a/rd_stats.c ++++ b/rd_stats.c +@@ -1625,10 +1625,12 @@ void read_cpuinfo(struct stats_pwr_cpufreq *st_pwr_cpufreq, int nbr) + if (!strncmp(line, "processor\t", 10)) { + sscanf(strchr(line, ':') + 1, "%d", &proc_nb); + } +- +- else if (!strncmp(line, "cpu MHz\t", 8)) { +- sscanf(strchr(line, ':') + 1, "%u.%u", &ifreq, &dfreq); +- ++ ++ /* Entry in /proc/cpuinfo is different between Intel and Power architectures */ ++ else if (!strncmp(line, "cpu MHz\t", 8) || ++ !strncmp(line, "clock\t", 6)) { ++ sscanf(strchr(line, ':') + 1, "%u.%u", &ifreq, &dfreq); ++ + if (proc_nb < (nbr - 1)) { + /* Save current CPU frequency */ + st_pwr_cpufreq_i = st_pwr_cpufreq + proc_nb + 1; +-- +2.13.6 + diff --git a/SPECS/sysstat.spec b/SPECS/sysstat.spec index 483042e..fe0d710 100644 --- a/SPECS/sysstat.spec +++ b/SPECS/sysstat.spec @@ -1,7 +1,7 @@ Summary: Collection of performance monitoring tools for Linux Name: sysstat Version: 10.1.5 -Release: 12%{?dist} +Release: 13%{?dist} License: GPLv2+ Group: Applications/System URL: http://sebastien.godard.pagesperso-orange.fr/ @@ -36,6 +36,10 @@ Patch12: sysstat-10.1.5-nfsiostat.patch Patch13: sysstat-10.1.5-tapestat.patch # fixes 1381128 Patch14: 0001-sar-make-buffers-that-hold-timestamps-bigger.patch +# fixes 1448489 +Patch15: 0001-pidstat-Display-stats-since-boot-time-for-a-list-of-.patch +# fixes 1440000 +Patch16: 0001-sar-Improve-cpuinfo-read-for-POWER-architecture.patch Requires: /etc/cron.d, fileutils, grep, sh-utils, textutils Requires(post): systemd, systemd-sysv @@ -80,6 +84,9 @@ The cifsiostat command reports I/O statistics for CIFS file systems. %patch12 -p1 -b .nfsiostat %patch13 -p1 -b .tapestat %patch14 -p1 -b .korean +%patch15 -p1 -b .pidstat +%patch16 -p1 -b .power + iconv -f windows-1252 -t utf8 CREDITS > CREDITS.aux mv CREDITS.aux CREDITS @@ -140,6 +147,10 @@ fi %{_localstatedir}/log/sa %changelog +* Wed Nov 08 2017 Michal Sekletar - 10.1.5-13 +- fix output of pidstat -p $PID (#1448489) +- improve reading of /proc/cpuinfo on Power (#1440000) + * Wed Mar 29 2017 Michal Sekletar - 10.1.5-12 - sar: output timestamps when running with ko_KR.UTF-8 locale (#1381128)