ARGSUSED*/
| 627 | |
| 628 | /* ARGSUSED*/ |
| 629 | static void |
| 630 | proc0_post(void *dummy __unused) |
| 631 | { |
| 632 | struct proc *p; |
| 633 | struct rusage ru; |
| 634 | struct thread *td; |
| 635 | |
| 636 | /* |
| 637 | * Now we can look at the time, having had a chance to verify the |
| 638 | * time from the filesystem. Pretend that proc0 started now. |
| 639 | */ |
| 640 | sx_slock(&allproc_lock); |
| 641 | FOREACH_PROC_IN_SYSTEM(p) { |
| 642 | PROC_LOCK(p); |
| 643 | if (p->p_state == PRS_NEW) { |
| 644 | PROC_UNLOCK(p); |
| 645 | continue; |
| 646 | } |
| 647 | microuptime(&p->p_stats->p_start); |
| 648 | PROC_STATLOCK(p); |
| 649 | rufetch(p, &ru); /* Clears thread stats */ |
| 650 | p->p_rux.rux_runtime = 0; |
| 651 | p->p_rux.rux_uticks = 0; |
| 652 | p->p_rux.rux_sticks = 0; |
| 653 | p->p_rux.rux_iticks = 0; |
| 654 | PROC_STATUNLOCK(p); |
| 655 | FOREACH_THREAD_IN_PROC(p, td) { |
| 656 | td->td_runtime = 0; |
| 657 | } |
| 658 | PROC_UNLOCK(p); |
| 659 | } |
| 660 | sx_sunlock(&allproc_lock); |
| 661 | PCPU_SET(switchtime, cpu_ticks()); |
| 662 | PCPU_SET(switchticks, ticks); |
| 663 | } |
| 664 | SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL); |
| 665 | |
| 666 | /* |
nothing calls this directly
no test coverage detected