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

Function perfmon_read

freebsd/i386/i386/perfmon.c:212–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212int
213perfmon_read(int pmc, quad_t *val)
214{
215 if (pmc < 0 || pmc >= NPMC)
216 return EINVAL;
217
218 if (perfmon_inuse & (1 << pmc)) {
219 if (ctl_shadow[pmc] & (PMCF_EN << 16))
220 *val = rdmsr(msr_pmc[pmc]) & 0xffffffffffULL;
221 else
222 *val = pmc_shadow[pmc];
223 return 0;
224 }
225
226 return EBUSY;
227}
228
229int
230perfmon_reset(int pmc)

Callers 2

cputimeFunction · 0.85
perfmon_ioctlFunction · 0.85

Calls 1

rdmsrFunction · 0.50

Tested by

no test coverage detected