MCPcopy Create free account
hub / github.com/F-Stack/f-stack / startprofclock

Function startprofclock

freebsd/kern/kern_clock.c:591–605  ·  view source on GitHub ↗

* Start profiling on a process. * * Kernel profiling passes proc0 which never exits and hence * keeps the profile clock running constantly. */

Source from the content-addressed store, hash-verified

589 * keeps the profile clock running constantly.
590 */
591void
592startprofclock(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.

Callers 3

do_forkFunction · 0.85
sysctl_kern_profFunction · 0.85
sys_profilFunction · 0.85

Calls 3

cpu_startprofclockFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected