From: David van Moolenbroek Date: Mon, 2 Nov 2015 17:45:28 +0000 (+0000) Subject: PM: remember when each process was started X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=58be976d3bffc1f69caa9e0e10313a1592db003f;p=minix.git PM: remember when each process was started Change-Id: I176f01681ebe758b03b635f2b5ecc8f083710bb4 --- diff --git a/minix/servers/pm/forkexit.c b/minix/servers/pm/forkexit.c index d4394c994..bacff3510 100644 --- a/minix/servers/pm/forkexit.c +++ b/minix/servers/pm/forkexit.c @@ -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(); diff --git a/minix/servers/pm/mproc.h b/minix/servers/pm/mproc.h index 6cfc099f1..f88944470 100644 --- a/minix/servers/pm/mproc.h +++ b/minix/servers/pm/mproc.h @@ -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 */