From eff579fcf2cc51c7b1ec49462dba34dfad76d67c Mon Sep 17 00:00:00 2001 From: Ivana Hutarova Varekova Date: Mon, 22 Nov 2010 14:48:20 +0100 Subject: [PATCH] - Resolves: #642280 sar -u overflow problem - thanks Michal Srb --- sysstat-9.0.4-cpu.patch | 22 ++++++++++++++++++++++ sysstat.spec | 9 ++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 sysstat-9.0.4-cpu.patch diff --git a/sysstat-9.0.4-cpu.patch b/sysstat-9.0.4-cpu.patch new file mode 100644 index 0000000..65c0d13 --- /dev/null +++ b/sysstat-9.0.4-cpu.patch @@ -0,0 +1,22 @@ +diff -up sysstat-9.0.4/mpstat.c.pom sysstat-9.0.4/mpstat.c +--- sysstat-9.0.4/mpstat.c.pom 2010-11-10 11:58:55.000000000 +0100 ++++ sysstat-9.0.4/mpstat.c 2010-11-10 11:58:30.000000000 +0100 +@@ -271,6 +271,9 @@ void write_stats_core(int prev, int curr + + /* Recalculate itv for current proc */ + pc_itv = get_per_cpu_interval(scc, scp); ++ if ((scc->cpu_user - scc->cpu_guest) < (scp->cpu_user - scp->cpu_guest)) ++ pc_itv = pc_itv + (scp->cpu_user - scp->cpu_guest) - ++ (scc->cpu_user - scc->cpu_guest); + + /* if the CPU is offline it is omited from /proc/stat + so the sum of all values is zero */ +@@ -291,6 +294,8 @@ void write_stats_core(int prev, int curr + else { + printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f" + " %6.2f %6.2f %6.2f\n", ++ (scc->cpu_user - scc->cpu_guest) < (scp->cpu_user - scp->cpu_guest) ? ++ 0.0 : + ll_sp_value(scp->cpu_user - scp->cpu_guest, + scc->cpu_user - scc->cpu_guest, + pc_itv), diff --git a/sysstat.spec b/sysstat.spec index cc11b88..6480afa 100644 --- a/sysstat.spec +++ b/sysstat.spec @@ -1,6 +1,6 @@ Name: sysstat Version: 9.0.6.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: The sar and iostat system monitoring commands License: GPLv2+ Group: Applications/System @@ -20,6 +20,8 @@ Patch7: sysstat-9.0.6.1-config.patch Patch8: sysstat-9.0.6.1-mandir.patch Patch9: sysstat-9.0.6.1-sadc_opt.patch Patch10: sysstat-9.0.6.1-localtime.patch +# fixes #643380 +Patch11: sysstat-9.0.4-cpu.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -47,6 +49,7 @@ activity. %patch8 -p1 -b .mandir %patch9 -p1 -b .opt %patch10 -p1 -b .loc +%patch11 -p1 -b .cpu iconv -f windows-1252 -t utf8 CREDITS > CREDITS.aux mv CREDITS.aux CREDITS @@ -97,6 +100,10 @@ rm -rf %{buildroot} %{_localstatedir}/log/sa %changelog +* Mon Nov 22 2010 Ivana Hutarova Varekova - 9.0.6.1-13 +- Resolves: #642280 + sar -u overflow problem - thanks Michal Srb + * Thu Oct 7 2010 Ivana Hutarova Varekova - 9.0.6.1-12 - improve sar thickless kernel support (fix the output per separate cpu "-P ALL" option )