uint16_t u_euid;
uint16_t u_egid;
char u_name[8]; /* Name invoked with */
- clock_t u_utime; /* Elapsed ticks in user mode */
- clock_t u_stime; /* Ticks in system mode */
- clock_t u_cutime; /* Total childrens ticks */
- clock_t u_cstime;
- clock_t u_time; /* Start time */
/* This section is not written out except as padding */
uint8_t u_files[UFTSIZE]; /* Process file table: indices into open file table, or NO_FILE. */
udata.u_ptab = p;
- memset(&udata.u_utime, 0, 4 * sizeof(clock_t)); /* Clear tick counters */
+ memset(&p->p_utime, 0, 4 * sizeof(clock_t)); /* Clear tick counters */
- rdtime32(&udata.u_time);
+ rdtime32(&p->p_time);
if (udata.u_cwd)
i_ref(udata.u_cwd);
if (udata.u_root)
and half of another.. */
if (!inswap && udata.u_ptab->p_status == P_RUNNING) {
if (udata.u_insys)
- udata.u_stime++;
+ udata.u_ptab->p_stime++;
else
- udata.u_utime++;
+ udata.u_ptab->p_utime++;
}
/* Do once-per-decisecond things - this doesn't work out well on
sync_clock(); /* Not that these values will be wildly accurate! */
- udata.u_utime += udata.u_cutime;
- udata.u_stime += udata.u_cstime;
- memcpy(&(udata.u_ptab->p_priority), &udata.u_utime,
- 2 * sizeof(clock_t));
-
for (p = ptab; p < ptab_end; ++p) {
if (p->p_status == P_EMPTY || p == udata.u_ptab)
continue;
udata.u_cwd = i_ref(root);
udata.u_root = i_ref(root);
- rdtime32(&udata.u_time);
+ rdtime32(&udata.u_ptab->p_time);
exec_or_die();
}
irq = di();
- uput(&udata.u_utime, buf, 4 * sizeof(clock_t));
+ uput(&udata.u_ptab->p_utime, buf, 4 * sizeof(clock_t));
uput(&ticks, buf + 4 * sizeof(clock_t),
sizeof(clock_t));
retval = p->p_pid;
p->p_status = P_EMPTY;
- /* Add in child's time info. It was stored on top */
- /* of p_priority in the childs process table entry. */
- /* FIXME: make these a union so we don't do type
- punning and break strict aliasing */
- udata.u_cutime += ((clock_t *)&p->p_priority)[0];
- udata.u_cstime += ((clock_t *)&p->p_priority)[1];
+ /* Add in child's cumulative time info */
+ udata.u_ptab->p_cutime += p->p_utime + p->p_cutime;
+ udata.u_ptab->p_cstime += p->p_stime + p->p_cstime;
return retval;
}
if (p->p_event && (options & WUNTRACED)) {