resource: system: Calculate average cpu utilization with per-cpu stat
In a situation where the number of online cpus is dynamically changed,
measuring the total system cpu usage by using the sum of the online
cpus usage time located at the top of '/proc/stat' will result in
inaccurate results. For example, suppose that the number of online
cpus changed from 2 to 1 between two time intervals. In this case, the
sum of the cpu time measured later is rather reduced than the sum of
the cpu time measured first, and if the cpu usage rate is calculated
using the difference between these two cpu times, a negative result
will come out. To prevent this situation, the average usage is
calculated by summing the usage time of each CPU; assuming that the
usage rate is 0% for offline CPUs.
Change-Id: I93e4561f525b54488df46bf0f895fa76b3b710ca
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>