Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_acct.c
Show First 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | acct_process(struct thread *td) | ||||
bcopy(p->p_comm, acct.ac_comm, sizeof acct.ac_comm); | bcopy(p->p_comm, acct.ac_comm, sizeof acct.ac_comm); | ||||
/* (3) The amount of user and system time that was used */ | /* (3) The amount of user and system time that was used */ | ||||
rufetchcalc(p, &ru, &ut, &st); | rufetchcalc(p, &ru, &ut, &st); | ||||
acct.ac_utime = encode_timeval(ut); | acct.ac_utime = encode_timeval(ut); | ||||
acct.ac_stime = encode_timeval(st); | acct.ac_stime = encode_timeval(st); | ||||
/* (4) The elapsed time the command ran (and its starting time) */ | /* (4) The elapsed time the command ran (and its starting time) */ | ||||
tmp = boottime; | getboottime(&tmp); | ||||
timevaladd(&tmp, &p->p_stats->p_start); | timevaladd(&tmp, &p->p_stats->p_start); | ||||
acct.ac_btime = tmp.tv_sec; | acct.ac_btime = tmp.tv_sec; | ||||
microuptime(&tmp); | microuptime(&tmp); | ||||
timevalsub(&tmp, &p->p_stats->p_start); | timevalsub(&tmp, &p->p_stats->p_start); | ||||
acct.ac_etime = encode_timeval(tmp); | acct.ac_etime = encode_timeval(tmp); | ||||
/* (5) The average amount of memory used */ | /* (5) The average amount of memory used */ | ||||
tmp = ut; | tmp = ut; | ||||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |