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

Function perfmon_start

freebsd/i386/i386/perfmon.c:174–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174int
175perfmon_start(int pmc)
176{
177 register_t saveintr;
178
179 if (pmc < 0 || pmc >= NPMC)
180 return EINVAL;
181
182 if (perfmon_inuse & (1 << pmc)) {
183 saveintr = intr_disable();
184 ctl_shadow[pmc] |= (PMCF_EN << 16);
185 wrmsr(msr_pmc[pmc], pmc_shadow[pmc]);
186 writectl(pmc);
187 intr_restore(saveintr);
188 return 0;
189 }
190 return EBUSY;
191}
192
193int
194perfmon_stop(int pmc)

Callers 2

startguprofFunction · 0.85
perfmon_ioctlFunction · 0.85

Calls 3

intr_disableFunction · 0.50
wrmsrFunction · 0.50
intr_restoreFunction · 0.50

Tested by

no test coverage detected