diff options
author | Lennart Weller <lhw@ring0.de> | 2016-04-21 12:27:39 +0000 |
---|---|---|
committer | Lennart Weller <lhw@ring0.de> | 2016-04-21 12:27:39 +0000 |
commit | edff5c9db775e6e4318f3ad007df78ecae456190 (patch) | |
tree | 3677e5fcbccc776c77dd0451e5be4711068bff46 /src/proc_stat.c | |
parent | Add postrm and TODO, update service (diff) | |
parent | Imported Upstream version 1.1.0 (diff) | |
download | netdata-edff5c9db775e6e4318f3ad007df78ecae456190.tar.xz netdata-edff5c9db775e6e4318f3ad007df78ecae456190.zip |
Merge tag 'upstream/1.1.0'
Upstream version 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"; |