* Start profiling on a process. * * Kernel profiling passes proc0 which never exits and hence * keeps the profile clock running constantly. */
| 589 | * keeps the profile clock running constantly. |
| 590 | */ |
| 591 | void |
| 592 | startprofclock(struct proc *p) |
| 593 | { |
| 594 | |
| 595 | PROC_LOCK_ASSERT(p, MA_OWNED); |
| 596 | if (p->p_flag & P_STOPPROF) |
| 597 | return; |
| 598 | if ((p->p_flag & P_PROFIL) == 0) { |
| 599 | p->p_flag |= P_PROFIL; |
| 600 | mtx_lock(&time_lock); |
| 601 | if (++profprocs == 1) |
| 602 | cpu_startprofclock(); |
| 603 | mtx_unlock(&time_lock); |
| 604 | } |
| 605 | } |
| 606 | |
| 607 | /* |
| 608 | * Stop profiling on a process. |
no test coverage detected