summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a44d70c)
raw | patch | inline | side by side (parent: a44d70c)
author | Xavier G <xavier@kindwolf.org> | |
Sat, 23 Sep 2017 17:38:30 +0000 (19:38 +0200) | ||
committer | Xavier G <xavier@kindwolf.org> | |
Sat, 23 Sep 2017 17:38:30 +0000 (19:38 +0200) |
src/cpu.c | patch | blob | history |
diff --git a/src/cpu.c b/src/cpu.c
index cdacf4297d651c88b1253578c731b94845ccb0a0..b62679bcb69f8d50575b48ed39986bfe6ce8625b 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
char *fields[11];
int numfields;
- long long user_value, nice_value, value;
if ((fh = fopen("/proc/stat", "r")) == NULL) {
char errbuf[1024];
cpu = atoi(fields[0] + 3);
/* Do not stage User and Nice immediately: we may need to alter them later: */
- user_value = atoll(fields[1]);
- nice_value = atoll(fields[2]);
+ long long user_value = atoll(fields[1]);
+ long long nice_value = atoll(fields[2]);
cpu_stage(cpu, COLLECTD_CPU_STATE_SYSTEM, (derive_t)atoll(fields[3]), now);
cpu_stage(cpu, COLLECTD_CPU_STATE_IDLE, (derive_t)atoll(fields[4]), now);
if (numfields >= 10) { /* Guest (since Linux 2.6.24) */
if (report_guest) {
- value = atoll(fields[9]);
+ long long value = atoll(fields[9]);
cpu_stage(cpu, COLLECTD_CPU_STATE_GUEST,
(derive_t)value, now);
/* Guest is included in User; optionally subtract Guest from
if (numfields >= 11) { /* Guest_nice (since Linux 2.6.33) */
if (report_guest) {
- value = atoll(fields[10]);
+ long long value = atoll(fields[10]);
cpu_stage(cpu, COLLECTD_CPU_STATE_GUEST_NICE,
(derive_t)value, now);
/* Guest_nice is included in Nice; optionally subtract