[sysstat] - fix the sar output on tickless kernel
Ivana Varekova
varekova at fedoraproject.org
Wed Sep 8 13:43:20 UTC 2010
commit 12d44c54f8b9c82c1352c6e6f3cd589b94babb74
Author: Ivana Hutarova Varekova <varekova at redhat.com>
Date: Wed Sep 8 15:46:28 2010 +0200
- fix the sar output on tickless kernel
sysstat-9.0.6.1-sar-tickless.patch | 59 ++++++++++++++++++++++++++++++++++++
sysstat.spec | 7 ++++-
2 files changed, 65 insertions(+), 1 deletions(-)
---
diff --git a/sysstat-9.0.6.1-sar-tickless.patch b/sysstat-9.0.6.1-sar-tickless.patch
new file mode 100644
index 0000000..79e9eba
--- /dev/null
+++ b/sysstat-9.0.6.1-sar-tickless.patch
@@ -0,0 +1,59 @@
+diff -up sysstat-9.0.6.1/pr_stats.c.pom sysstat-9.0.6.1/pr_stats.c
+--- sysstat-9.0.6.1/pr_stats.c.pom 2009-09-12 20:59:04.000000000 +0200
++++ sysstat-9.0.6.1/pr_stats.c 2010-09-08 15:39:20.000000000 +0200
+@@ -118,7 +118,32 @@ __print_funct_t print_cpu_stats(struct a
+ continue;
+ }
+ }
+-
++ float c_idle = 0;
++ /* set the idle value */
++ if (scc->cpu_user + scc->cpu_nice + scc->cpu_sys +
++ scc->cpu_iowait + scc->cpu_idle + scc->cpu_steal +
++ scc->cpu_hardirq + scc->cpu_softirq ==
++ scp->cpu_user + scp->cpu_nice + scp->cpu_sys +
++ scp->cpu_iowait + scp->cpu_idle + scp->cpu_steal +
++ scp->cpu_hardirq + scp->cpu_softirq) {
++
++ if (scc->cpu_user + scc->cpu_nice + scc->cpu_sys +
++ scc->cpu_iowait + scc->cpu_idle + scc->cpu_steal +
++ scc->cpu_hardirq + scc->cpu_softirq == 0) {
++ /* cpu is offline */
++ c_idle = 0;
++ } else {
++ /* if the CPU is tickless then
++ there is no change in CPU values but the sum of values is not null */
++ c_idle = 100;
++ }
++ } else {
++ if (scc->cpu_idle < scp->cpu_idle)
++ c_idle = 0;
++ else
++ c_idle = ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv);
++ }
++
+ if (DISPLAY_CPU_DEF(a->opt_flags)) {
+ printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f\n",
+ ll_sp_value(scp->cpu_user, scc->cpu_user, g_itv),
+@@ -128,9 +153,7 @@ __print_funct_t print_cpu_stats(struct a
+ g_itv),
+ ll_sp_value(scp->cpu_iowait, scc->cpu_iowait, g_itv),
+ ll_sp_value(scp->cpu_steal, scc->cpu_steal, g_itv),
+- scc->cpu_idle < scp->cpu_idle ?
+- 0.0 :
+- ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv));
++ c_idle);
+ }
+ else if (DISPLAY_CPU_ALL(a->opt_flags)) {
+ printf(" %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f"
+@@ -144,9 +167,7 @@ __print_funct_t print_cpu_stats(struct a
+ ll_sp_value(scp->cpu_hardirq, scc->cpu_hardirq, g_itv),
+ ll_sp_value(scp->cpu_softirq, scc->cpu_softirq, g_itv),
+ ll_sp_value(scp->cpu_guest, scc->cpu_guest, g_itv),
+- scc->cpu_idle < scp->cpu_idle ?
+- 0.0 :
+- ll_sp_value(scp->cpu_idle, scc->cpu_idle, g_itv));
++ c_idle);
+ }
+ }
+ }
diff --git a/sysstat.spec b/sysstat.spec
index 84f47b4..f8a4c5a 100644
--- a/sysstat.spec
+++ b/sysstat.spec
@@ -1,6 +1,6 @@
Name: sysstat
Version: 9.0.6.1
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: The sar and iostat system monitoring commands
License: GPLv2+
Group: Applications/System
@@ -15,6 +15,7 @@ Patch2: sysstat-9.0.4-init_script_lsb.patch
Patch3: sysstat-9.0.6.1-tickless.patch
Patch4: sysstat-9.0.6.1-sec.patch
Patch5: sysstat-9.0.6.1-mp_isag.patch
+Patch6: sysstat-9.0.6.1-sar-tickless.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -36,6 +37,7 @@ activity.
%patch3 -p1 -b .tl
%patch4 -p1 -b .sec
%patch5 -p1 -b .isag
+%patch6 -p1 -b .tl2
iconv -f windows-1252 -t utf8 CREDITS > CREDITS.aux
mv CREDITS.aux CREDITS
@@ -87,6 +89,9 @@ rm -rf %{buildroot}
%{_localstatedir}/log/sa
%changelog
+* Wed Sep 8 2010 Ivana Hutarova Varekova <varekova at redhat.com> - 9.0.6.1-6
+- fix the sar output on tickless kernel
+
* Fri Aug 13 2010 Ivana Hutarova Varekova <varekova at redhat.com> - 9.0.6.1-5
- remove bogus links description
More information about the scm-commits
mailing list