Kernel: fix getrusage microsecond computation
Change-Id: I5e443ddbed1bcd49ed81721afda3aa3c1880ad52
This commit is contained in:
parent
87d31b0645
commit
83a31a3592
1 changed files with 2 additions and 2 deletions
|
@ -205,10 +205,10 @@ int do_getinfo(struct proc * caller, message * m_ptr)
|
||||||
memset(&r_usage, 0, sizeof(r_usage));
|
memset(&r_usage, 0, sizeof(r_usage));
|
||||||
usec = target->p_user_time * 1000000 / system_hz;
|
usec = target->p_user_time * 1000000 / system_hz;
|
||||||
r_usage.ru_utime.tv_sec = usec / 1000000;
|
r_usage.ru_utime.tv_sec = usec / 1000000;
|
||||||
r_usage.ru_utime.tv_usec = usec % 100000;
|
r_usage.ru_utime.tv_usec = usec % 1000000;
|
||||||
usec = target->p_sys_time * 1000000 / system_hz;
|
usec = target->p_sys_time * 1000000 / system_hz;
|
||||||
r_usage.ru_stime.tv_sec = usec / 1000000;
|
r_usage.ru_stime.tv_sec = usec / 1000000;
|
||||||
r_usage.ru_stime.tv_usec = usec % 100000;
|
r_usage.ru_stime.tv_usec = usec % 1000000;
|
||||||
r_usage.ru_nsignals = target->p_signal_received;
|
r_usage.ru_nsignals = target->p_signal_received;
|
||||||
src_vir = (vir_bytes) &r_usage;
|
src_vir = (vir_bytes) &r_usage;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue