[SIGAR-106] rename cpu steal -> stolen
This commit is contained in:
1 parent
87b194fbb1
commit
51dd062f7e
13 files changed
+26
-25
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
+5
-5
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user