display: add CPU usage item to display
Calculation formula of CPU usage:
cpu_time = (utime_now + stime_now) - (utime_pre + stime_pre);
CPU usage = cpu_time / time_interval;
Get utime and stime from /proc/qemupid/stat, then we can get cpu_time
by calculate variation of these value over time.
And time_interval represent cpu time interval between two data acquisition.
Signed-off-by: NJiajun Chen <1250062498@qq.com>
Showing
想要评论请 注册 或 登录