7

android /proc/stat cpu stats not monotonic

view full story
linux-howto

http://stackoverflow.com – I'm using /proc/stat to calculate system cpu usage. Lately, I've been occasionally seeing strange events where the cpu line entries aren't monotonic. e.g. /proc/stat might have cpu 41593 1901 39537 2874843 3341 3 111 0 0 0 cpu0 24588 639 29028 672989 2235 3 88 0 0 0 cpu1 10323 628 6695 726111 621 0 9 0 0 0 cpu2 4112 382 2487 736482 296 0 6 0 0 0 cpu3 2570 252 1327 739261 189 0 8 0 0 0 one time, and then a second later it says cpu 41618 1907 39560 2174971 3310 3 111 0 0 0 cpu0 24612 643 29048 673043 2235 3 88 0 0 0 cpu1 10324 630 6698 26185 590 0 9 0 0 0 cpu2 4112 382 2487 736482 296 0 6 (HowTos)