PM: remember when each process was started

Change-Id: I176f01681ebe758b03b635f2b5ecc8f083710bb4
This commit is contained in:
David van Moolenbroek 2015-11-02 17:45:28 +00:00 committed by Lionel Sambuc
parent 89926a4cc3
commit 58be976d3b
2 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,7 @@ int do_fork()
rmc->mp_endpoint = child_ep; /* passed back by VM */
for (i = 0; i < NR_ITIMERS; i++)
rmc->mp_interval[i] = 0; /* reset timer intervals */
rmc->mp_started = getticks(); /* remember start time, for ps(1) */
/* Find a free pid for the child and put it in the table. */
new_pid = get_free_pid();
@ -200,6 +201,7 @@ int do_srv_fork()
rmc->mp_effgid = m_in.m_lsys_pm_srv_fork.gid;
for (i = 0; i < NR_ITIMERS; i++)
rmc->mp_interval[i] = 0; /* reset timer intervals */
rmc->mp_started = getticks(); /* remember start time, for ps(1) */
/* Find a free pid for the child and put it in the table. */
new_pid = get_free_pid();

View File

@ -55,6 +55,7 @@ EXTERN struct mproc {
vir_bytes mp_sigreturn; /* address of C library __sigreturn function */
minix_timer_t mp_timer; /* watchdog timer for alarm(2), setitimer(2) */
clock_t mp_interval[NR_ITIMERS]; /* setitimer(2) repetition intervals */
clock_t mp_started; /* when the process was started, for ps(1) */
unsigned mp_flags; /* flag bits */
unsigned mp_trace_flags; /* trace options */