From d1812840b7b57d24b963f18e30fd9a9ef5737872 Mon Sep 17 00:00:00 2001 From: Ivana Hutarova Varekova Date: Oct 07 2010 14:11:58 +0000 Subject: - improve sar thickless kernel support (fix the output per separate cpu "-P ALL" option ) --- diff --git a/sysstat-9.0.6.1-sar-tickless.patch b/sysstat-9.0.6.1-sar-tickless.patch index 79e9eba..c0a543d 100644 --- a/sysstat-9.0.6.1-sar-tickless.patch +++ b/sysstat-9.0.6.1-sar-tickless.patch @@ -1,7 +1,27 @@ -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 +diff -up sysstat-9.0.6.1/pr_stats.c.tl2 sysstat-9.0.6.1/pr_stats.c +--- sysstat-9.0.6.1/pr_stats.c.tl2 2009-09-12 20:59:04.000000000 +0200 ++++ sysstat-9.0.6.1/pr_stats.c 2010-10-07 16:05:51.000000000 +0200 +@@ -110,15 +110,50 @@ __print_funct_t print_cpu_stats(struct a + if (!g_itv) { + /* Current CPU is offline */ + printf(" 0.00 0.00 0.00" +- " 0.00 0.00 0.00"); ++ " 0.00 0.00"); + if (DISPLAY_CPU_ALL(a->opt_flags)) { + printf(" 0.00 0.00 0.00"); + } ++ 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 */ ++ printf(" 0.00"); ++ } else { ++ /* if the CPU is tickless then ++ there is no change in CPU values but the sum of ++ values is not null */ ++ printf(" 100.00"); ++ } + printf("\n"); continue; } } @@ -10,32 +30,31 @@ diff -up sysstat-9.0.6.1/pr_stats.c.pom sysstat-9.0.6.1/pr_stats.c + /* 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 { ++ /* cpu is offline */ ++ c_idle = 0; ++ } else { ++ 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 the CPU is tickless then + there is no change in CPU values but the sum of values is not null */ + c_idle = 100; -+ } -+ } else { ++ } else { + if (scc->cpu_idle < scp->cpu_idle) + c_idle = 0; -+ else ++ 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 +@@ -128,9 +163,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), @@ -46,7 +65,7 @@ diff -up sysstat-9.0.6.1/pr_stats.c.pom sysstat-9.0.6.1/pr_stats.c } 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 +@@ -144,9 +177,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), diff --git a/sysstat.spec b/sysstat.spec index b0a1b76..cc11b88 100644 --- a/sysstat.spec +++ b/sysstat.spec @@ -1,6 +1,6 @@ Name: sysstat Version: 9.0.6.1 -Release: 11%{?dist} +Release: 12%{?dist} Summary: The sar and iostat system monitoring commands License: GPLv2+ Group: Applications/System @@ -97,6 +97,10 @@ rm -rf %{buildroot} %{_localstatedir}/log/sa %changelog +* 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 ) + * Mon Oct 4 2010 Ivana Hutarova Varekova - 9.0.6.1-11 - resolves: #635646 test the output of localtime properly