From 51dd062f7eb14d886c174707b99ca80d65c1e2dc Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 28 May 2008 18:14:00 +0000 Subject: [PATCH] [SIGAR-106] rename cpu steal -> stolen --- bindings/SigarWrapper.pm | 4 ++-- bindings/java/src/org/hyperic/sigar/CpuPerc.java | 6 +++--- bindings/java/src/org/hyperic/sigar/cmd/CpuInfo.java | 2 +- bindings/java/src/org/hyperic/sigar/test/TestCpu.java | 4 ++-- exp/sizeof.c | 3 ++- include/sigar.h | 2 +- include/sigar_format.h | 2 +- src/os/aix/aix_sigar.c | 4 ++-- src/os/darwin/darwin_sigar.c | 6 +++--- src/os/hpux/hpux_sigar.c | 2 +- src/os/linux/linux_sigar.c | 4 ++-- src/os/osf1/osf1_sigar.c | 2 +- src/sigar_format.c | 10 +++++----- 13 files changed, 26 insertions(+), 25 deletions(-) diff --git a/bindings/SigarWrapper.pm b/bindings/SigarWrapper.pm index 00dc9fea..0db4e804 100644 --- a/bindings/SigarWrapper.pm +++ b/bindings/SigarWrapper.pm @@ -453,7 +453,7 @@ use vars qw(%classes %cmds); plat => 'L' }, { - name => 'steal', type => 'Long', + name => 'stolen', type => 'Long', desc => 'Total system cpu involuntary wait time', plat => 'L' }, @@ -500,7 +500,7 @@ use vars qw(%classes %cmds); plat => 'L' }, { - name => 'steal', type => 'Double', + name => 'stolen', type => 'Double', desc => 'Percent system cpu involuntary wait time', plat => 'L' }, diff --git a/bindings/java/src/org/hyperic/sigar/CpuPerc.java b/bindings/java/src/org/hyperic/sigar/CpuPerc.java index 5942e281..c2877288 100644 --- a/bindings/java/src/org/hyperic/sigar/CpuPerc.java +++ b/bindings/java/src/org/hyperic/sigar/CpuPerc.java @@ -32,7 +32,7 @@ public class CpuPerc implements java.io.Serializable { private double wait; private double irq; private double softIrq; - private double steal; + private double stolen; private double combined; CpuPerc() {} @@ -85,8 +85,8 @@ public class CpuPerc implements java.io.Serializable { return this.softIrq; } - public double getSteal() { - return this.steal; + public double getStolen() { + return this.stolen; } /** diff --git a/bindings/java/src/org/hyperic/sigar/cmd/CpuInfo.java b/bindings/java/src/org/hyperic/sigar/cmd/CpuInfo.java index 36c6bf3d..21c3dbf2 100644 --- a/bindings/java/src/org/hyperic/sigar/cmd/CpuInfo.java +++ b/bindings/java/src/org/hyperic/sigar/cmd/CpuInfo.java @@ -52,7 +52,7 @@ public class CpuInfo extends SigarCommandBase { println("Irq Time......" + CpuPerc.format(cpu.getIrq())); if (SigarLoader.IS_LINUX) { println("SoftIrq Time.." + CpuPerc.format(cpu.getSoftIrq())); - println("Steal Time...." + CpuPerc.format(cpu.getSteal())); + println("Stolen Time...." + CpuPerc.format(cpu.getStolen())); } println(""); } diff --git a/bindings/java/src/org/hyperic/sigar/test/TestCpu.java b/bindings/java/src/org/hyperic/sigar/test/TestCpu.java index 3e4e90d3..c0bb3c32 100644 --- a/bindings/java/src/org/hyperic/sigar/test/TestCpu.java +++ b/bindings/java/src/org/hyperic/sigar/test/TestCpu.java @@ -49,8 +49,8 @@ public class TestCpu extends SigarTestCase { traceln("SIrq.." + cpu.getSoftIrq()); assertTrue(cpu.getSoftIrq() >= 0); - traceln("Stl..." + cpu.getSteal()); - assertTrue(cpu.getSteal() >= 0); + traceln("Stl..." + cpu.getStolen()); + assertTrue(cpu.getStolen() >= 0); traceln("Total.." + cpu.getTotal()); assertTrue(cpu.getTotal() > 0); diff --git a/exp/sizeof.c b/exp/sizeof.c index 3a117670..a143797c 100644 --- a/exp/sizeof.c +++ b/exp/sizeof.c @@ -2,7 +2,7 @@ #!perl -l use Config; my $prg = "$0.out"; -my $cmd = "$Config{cc} -Wall -D$^O -o $prg $0; ./$prg; rm $prg"; +my $cmd = "gcc -Wall -D$^O -o $prg $0; ./$prg; rm $prg"; print $cmd; system $cmd; __END__ */ @@ -32,6 +32,7 @@ static sizeof_info_t sizeof_info[] = { SIZEOF_INFO(vminfo_t), SIZEOF_INFO(cpu_stat_t), SIZEOF_INFO(cpu_vminfo_t), + SIZEOF_INFO(cpu_sys_stats_t), SIZEOF_INFO(kstat_io_t), /* procfs */ SIZEOF_INFO(psinfo_t), diff --git a/include/sigar.h b/include/sigar.h index f266ebf5..8d1d533e 100644 --- a/include/sigar.h +++ b/include/sigar.h @@ -167,7 +167,7 @@ typedef struct { wait, irq, soft_irq, - steal, + stolen, total; } sigar_cpu_t; diff --git a/include/sigar_format.h b/include/sigar_format.h index a6b8719e..620a8a21 100644 --- a/include/sigar_format.h +++ b/include/sigar_format.h @@ -27,7 +27,7 @@ typedef struct { double wait; double irq; double soft_irq; - double steal; + double stolen; double combined; } sigar_cpu_perc_t; diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index 98ae5ee9..a97da2c0 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -719,7 +719,7 @@ int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) cpu->wait = SIGAR_TICK2MSEC(cpu_data.wait); cpu->irq = 0; /*N/A*/ cpu->soft_irq = 0; /*N/A*/ - cpu->steal = 0; /*N/A*/ + cpu->stolen = 0; /*N/A*/ cpu->total = cpu->user + cpu->sys + cpu->idle + cpu->wait; return SIGAR_OK; } @@ -741,7 +741,7 @@ int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) cpu->wait = SIGAR_TICK2MSEC(data.cpu[CPU_WAIT]); cpu->irq = 0; /*N/A*/ cpu->soft_irq = 0; /*N/A*/ - cpu->steal = 0; /*N/A*/ + cpu->stolen = 0; /*N/A*/ cpu->total = cpu->user + cpu->sys + cpu->idle + cpu->wait; return SIGAR_OK; diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 90609efa..c62c6a81 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -636,7 +636,7 @@ int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) cpu->wait = 0; /*N/A*/ cpu->irq = 0; /*N/A*/ cpu->soft_irq = 0; /*N/A*/ - cpu->steal = 0; /*N/A*/ + cpu->stolen = 0; /*N/A*/ cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle; #elif defined(__FreeBSD__) || (__OpenBSD__) || defined(__NetBSD__) @@ -671,7 +671,7 @@ int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) cpu->wait = 0; /*N/A*/ cpu->irq = SIGAR_TICK2MSEC(cp_time[CP_INTR]); cpu->soft_irq = 0; /*N/A*/ - cpu->steal = 0; /*N/A*/ + cpu->stolen = 0; /*N/A*/ cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle + cpu->irq; #endif @@ -712,7 +712,7 @@ int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist) cpu->wait = 0; /*N/A*/ cpu->irq = 0; /*N/A*/ cpu->soft_irq = 0; /*N/A*/ - cpu->steal = 0; /*N/A*/ + cpu->stolen = 0; /*N/A*/ cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle; } diff --git a/src/os/hpux/hpux_sigar.c b/src/os/hpux/hpux_sigar.c index 48773f76..3f20d762 100644 --- a/src/os/hpux/hpux_sigar.c +++ b/src/os/hpux/hpux_sigar.c @@ -140,7 +140,7 @@ static void get_cpu_metrics(sigar_t *sigar, cpu->irq = SIGAR_TICK2MSEC(cpu_time[CP_INTR]); cpu->soft_irq = 0; /*N/A*/ - cpu->steal = 0; /*N/A*/ + cpu->stolen = 0; /*N/A*/ cpu->total = cpu->user + cpu->sys + cpu->nice + cpu->idle + cpu->wait + cpu->irq; diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c index b20f6913..471648b1 100644 --- a/src/os/linux/linux_sigar.c +++ b/src/os/linux/linux_sigar.c @@ -416,11 +416,11 @@ static void get_cpu_metrics(sigar_t *sigar, sigar_cpu_t *cpu, char *line) } if (*ptr == ' ') { /* 2.6.11+ kernels only */ - cpu->steal += SIGAR_TICK2MSEC(sigar_strtoull(ptr)); + cpu->stolen += SIGAR_TICK2MSEC(sigar_strtoull(ptr)); } cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle + - cpu->wait + cpu->irq + cpu->soft_irq + cpu->steal; + cpu->wait + cpu->irq + cpu->soft_irq + cpu->stolen; } int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) diff --git a/src/os/osf1/osf1_sigar.c b/src/os/osf1/osf1_sigar.c index e2756c98..04fb3e92 100644 --- a/src/os/osf1/osf1_sigar.c +++ b/src/os/osf1/osf1_sigar.c @@ -106,7 +106,7 @@ int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) cpu->wait = 0; /*N/A?*/ cpu->irq = 0; /*N/A*/ cpu->soft_irq = 0; /*N/A*/ - cpu->steal = 0; /*N/A*/ + cpu->stolen = 0; /*N/A*/ cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle + cpu->wait; return SIGAR_OK; diff --git a/src/sigar_format.c b/src/sigar_format.c index d5872279..cbbb0385 100644 --- a/src/sigar_format.c +++ b/src/sigar_format.c @@ -611,7 +611,7 @@ SIGAR_DECLARE(int) sigar_cpu_perc_calculate(sigar_cpu_t *prev, sigar_cpu_perc_t *perc) { double diff_user, diff_sys, diff_nice, diff_idle; - double diff_wait, diff_irq, diff_soft_irq, diff_steal; + double diff_wait, diff_irq, diff_soft_irq, diff_stolen; double diff_total; diff_user = (sigar_int64_t)(curr->user - prev->user); @@ -621,7 +621,7 @@ SIGAR_DECLARE(int) sigar_cpu_perc_calculate(sigar_cpu_t *prev, diff_wait = (sigar_int64_t)(curr->wait - prev->wait); diff_irq = (sigar_int64_t)(curr->irq - prev->irq); diff_soft_irq = (sigar_int64_t)(curr->soft_irq - prev->soft_irq); - diff_steal = (sigar_int64_t)(curr->steal - prev->steal); + diff_stolen = (sigar_int64_t)(curr->stolen - prev->stolen); diff_user = diff_user < 0 ? 0 : diff_user; diff_sys = diff_sys < 0 ? 0 : diff_sys; @@ -630,12 +630,12 @@ SIGAR_DECLARE(int) sigar_cpu_perc_calculate(sigar_cpu_t *prev, diff_wait = diff_wait < 0 ? 0 : diff_wait; diff_irq = diff_irq < 0 ? 0 : diff_irq; diff_soft_irq = diff_soft_irq < 0 ? 0 : diff_soft_irq; - diff_steal = diff_steal < 0 ? 0 : diff_steal; + diff_stolen = diff_stolen < 0 ? 0 : diff_stolen; diff_total = diff_user + diff_sys + diff_nice + diff_idle + diff_wait + diff_irq + diff_soft_irq + - diff_steal; + diff_stolen; perc->user = diff_user / diff_total; perc->sys = diff_sys / diff_total; @@ -644,7 +644,7 @@ SIGAR_DECLARE(int) sigar_cpu_perc_calculate(sigar_cpu_t *prev, perc->wait = diff_wait / diff_total; perc->irq = diff_irq / diff_total; perc->soft_irq = diff_soft_irq / diff_total; - perc->steal = diff_steal / diff_total; + perc->stolen = diff_stolen / diff_total; perc->combined = perc->user + perc->sys + perc->nice + perc->wait;