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

Function perfmon_setup

freebsd/i386/i386/perfmon.c:128–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128int
129perfmon_setup(int pmc, unsigned int control)
130{
131 register_t saveintr;
132
133 if (pmc < 0 || pmc >= NPMC)
134 return EINVAL;
135
136 perfmon_inuse |= (1 << pmc);
137 control &= ~(PMCF_SYS_FLAGS << 16);
138 saveintr = intr_disable();
139 ctl_shadow[pmc] = control;
140 writectl(pmc);
141 wrmsr(msr_pmc[pmc], pmc_shadow[pmc] = 0);
142 intr_restore(saveintr);
143 return 0;
144}
145
146int
147perfmon_get(int pmc, unsigned int *control)

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