diff options
author | Lennart Weller <lhw@ring0.de> | 2016-04-21 12:27:29 +0000 |
---|---|---|
committer | Lennart Weller <lhw@ring0.de> | 2016-04-21 12:27:29 +0000 |
commit | 30b94862648cdbf4f537337d2e2f01c369a9dee9 (patch) | |
tree | f0219dd8bd744fc09899bd0266402e05a4bff854 /src/proc_stat.c | |
parent | Imported Upstream version 1.0.0 (diff) | |
download | netdata-30b94862648cdbf4f537337d2e2f01c369a9dee9.tar.xz netdata-30b94862648cdbf4f537337d2e2f01c369a9dee9.zip |
Imported Upstream version 1.1.0upstream/1.1.0
Diffstat (limited to 'src/proc_stat.c')
-rw-r--r--[-rwxr-xr-x] | src/proc_stat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/proc_stat.c b/src/proc_stat.c index 3d090ed71..47f994b52 100755..100644 --- a/src/proc_stat.c +++ b/src/proc_stat.c @@ -47,8 +47,8 @@ int do_proc_stat(int update_every, unsigned long long dt) { for(l = 0; l < lines ;l++) { if(strncmp(procfile_lineword(ff, l, 0), "cpu", 3) == 0) { words = procfile_linewords(ff, l); - if(words < 10) { - error("Cannot read /proc/stat cpu line. Expected 10 params, read %d.", words); + if(words < 9) { + error("Cannot read /proc/stat cpu line. Expected 9 params, read %d.", words); continue; } @@ -64,7 +64,7 @@ int do_proc_stat(int update_every, unsigned long long dt) { irq = strtoull(procfile_lineword(ff, l, 6), NULL, 10); softirq = strtoull(procfile_lineword(ff, l, 7), NULL, 10); steal = strtoull(procfile_lineword(ff, l, 8), NULL, 10); - guest = strtoull(procfile_lineword(ff, l, 9), NULL, 10); + if(words >= 10) guest = strtoull(procfile_lineword(ff, l, 9), NULL, 10); if(words >= 11) guest_nice = strtoull(procfile_lineword(ff, l, 10), NULL, 10); char *title = "Core utilization"; |