1ebccf1e3SJoseph Koshy.\" Copyright (c) 2003-2005 Joseph Koshy 2ebccf1e3SJoseph Koshy.\" All rights reserved. 3ebccf1e3SJoseph Koshy.\" 4ebccf1e3SJoseph Koshy.\" Redistribution and use in source and binary forms, with or without 5ebccf1e3SJoseph Koshy.\" modification, are permitted provided that the following conditions 6ebccf1e3SJoseph Koshy.\" are met: 7ebccf1e3SJoseph Koshy.\" 1. Redistributions of source code must retain the above copyright 8ebccf1e3SJoseph Koshy.\" notice, this list of conditions and the following disclaimer. 9ebccf1e3SJoseph Koshy.\" 2. Redistributions in binary form must reproduce the above copyright 10ebccf1e3SJoseph Koshy.\" notice, this list of conditions and the following disclaimer in the 11ebccf1e3SJoseph Koshy.\" documentation and/or other materials provided with the distribution. 12ebccf1e3SJoseph Koshy.\" 13ebccf1e3SJoseph Koshy.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14ebccf1e3SJoseph Koshy.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15ebccf1e3SJoseph Koshy.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16ebccf1e3SJoseph Koshy.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17ebccf1e3SJoseph Koshy.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18ebccf1e3SJoseph Koshy.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19ebccf1e3SJoseph Koshy.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20ebccf1e3SJoseph Koshy.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21ebccf1e3SJoseph Koshy.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22ebccf1e3SJoseph Koshy.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23ebccf1e3SJoseph Koshy.\" SUCH DAMAGE. 24ebccf1e3SJoseph Koshy.\" 25ebccf1e3SJoseph Koshy.\" $FreeBSD$ 26ebccf1e3SJoseph Koshy.\" 27ebccf1e3SJoseph Koshy.Dd Apr 15, 2005 28ebccf1e3SJoseph Koshy.Dt HWPMC 4 29ebccf1e3SJoseph Koshy.Os 30ebccf1e3SJoseph Koshy.Sh NAME 31ebccf1e3SJoseph Koshy.Nm hwpmc 32ebccf1e3SJoseph Koshy.Nd Hardware performance monitoring counter support 33ebccf1e3SJoseph Koshy.Sh SYNOPSIS 34ebccf1e3SJoseph Koshy.Cd options PMC_HOOKS 35ebccf1e3SJoseph Koshy.br 36ebccf1e3SJoseph Koshy.Cd device hwpmc 37ebccf1e3SJoseph Koshy.Sh DESCRIPTION 38ebccf1e3SJoseph KoshyThe 39ebccf1e3SJoseph Koshy.Nm 40ebccf1e3SJoseph Koshydriver virtualizes the hardware performance monitoring facilities in 41ebccf1e3SJoseph Koshymodern CPUs and provides support for using these facilities from 42ebccf1e3SJoseph Koshyuser level processes. 43ebccf1e3SJoseph Koshy.Pp 44ebccf1e3SJoseph KoshyThe driver supports multi-processor systems. 45ebccf1e3SJoseph Koshy.Pp 46ebccf1e3SJoseph KoshyPMCs are allocated using the 47ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCALLOCATE 48ebccf1e3SJoseph Koshyrequest. 49ebccf1e3SJoseph KoshyA successful 50ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCALLOCATE 51ebccf1e3SJoseph Koshyrequest will return an integer handle (typically a small integer) to 52ebccf1e3SJoseph Koshythe requesting process. 53ebccf1e3SJoseph KoshySubsequent operations on the allocated PMC use this handle to denote 54ebccf1e3SJoseph Koshythe specific PMC. 55ebccf1e3SJoseph KoshyA process that has successfully allocated a PMC is termed an 56ebccf1e3SJoseph Koshy.Dq "owner process" . 57ebccf1e3SJoseph Koshy.Pp 58ebccf1e3SJoseph KoshyPMCs may be allocated to operate in process-private or in system-wide 59ebccf1e3SJoseph Koshymodes. 60ebccf1e3SJoseph Koshy.Bl -hang -width "XXXXXXXXXXXXXXX" 61ebccf1e3SJoseph Koshy.It Em Process-private 62ebccf1e3SJoseph KoshyIn process-private mode, a PMC is active only when a thread belonging 63ebccf1e3SJoseph Koshyto a process it is attached to is scheduled on a CPU. 64ebccf1e3SJoseph Koshy.It Em System-wide 65ebccf1e3SJoseph KoshyIn system-wide mode a PMC operates independently of processes and 66ebccf1e3SJoseph Koshymeasures hardware events for the system as a whole. 67ebccf1e3SJoseph Koshy.El 68ebccf1e3SJoseph Koshy.Pp 69ebccf1e3SJoseph KoshyThe 70ebccf1e3SJoseph Koshy.Nm 71ebccf1e3SJoseph Koshydriver supports the use of hardware PMCs for counting or for 72ebccf1e3SJoseph Koshysampling: 73ebccf1e3SJoseph Koshy.Bl -hang -width "XXXXXXXXX" 74ebccf1e3SJoseph Koshy.It Em Counting 75ebccf1e3SJoseph KoshyIn counting modes, the PMCs count hardware events. 76ebccf1e3SJoseph KoshyThese counts are retrievable using the 77ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCREAD 78ebccf1e3SJoseph Koshysystem call on all architectures, though some architectures like the 79ebccf1e3SJoseph Koshyx86 and amd64 offer faster methods of reading these counts. 80ebccf1e3SJoseph Koshy.It Em Sampling 81ebccf1e3SJoseph KoshyIn sampling modes, where PMCs are configured to sample the CPU 82ebccf1e3SJoseph Koshyinstruction pointer after a configurable number of hardware events 83ebccf1e3SJoseph Koshyhave been observed. 84ebccf1e3SJoseph KoshyThese instruction pointer samples are directed to a log file for 85ebccf1e3SJoseph Koshysubsequent analysis. 86ebccf1e3SJoseph Koshy.El 87ebccf1e3SJoseph Koshy.Pp 88ebccf1e3SJoseph KoshyThese modes of operation are orthogonal; a PMC may be configured to 89ebccf1e3SJoseph Koshyoperate in one of four modes: 90ebccf1e3SJoseph Koshy.Bl -tag -width indent 91ebccf1e3SJoseph Koshy.It Process-private, counting 92ebccf1e3SJoseph KoshyThese PMCs count hardware events whenever a thread in their attached process is 93ebccf1e3SJoseph Koshyscheduled on a CPU. 94ebccf1e3SJoseph KoshyThese PMCs normally count from zero, but the initial count may be 95ebccf1e3SJoseph Koshyset using the 96ebccf1e3SJoseph Koshy.Ic PMC_OP_SETCOUNT 97ebccf1e3SJoseph Koshyoperation. 98ebccf1e3SJoseph KoshyApplications can read the value of the PMC anytime using the 99ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCRW 100ebccf1e3SJoseph Koshyoperation. 101ebccf1e3SJoseph Koshy.It Process-private, sampling 102ebccf1e3SJoseph KoshyThese PMCs sample the target processes instruction pointer after they 103ebccf1e3SJoseph Koshyhave seen the configured number of hardware events. 104ebccf1e3SJoseph KoshyThe PMCs only count events when a thread belonging to their attached 105ebccf1e3SJoseph Koshyprocess is active. 106ebccf1e3SJoseph KoshyThe desired frequency of sampling is set using the 107ebccf1e3SJoseph Koshy.Ic PMC_OP_SETCOUNT 108ebccf1e3SJoseph Koshyoperation prior to starting the PMC. 109ebccf1e3SJoseph KoshyLog files are configured using the 110ebccf1e3SJoseph Koshy.Ic PMC_OP_CONFIGURELOG 111ebccf1e3SJoseph Koshyoperation. 112ebccf1e3SJoseph Koshy.It System-wide, counting 113ebccf1e3SJoseph KoshyThese PMCs count hardware events seen by them independent of the 114ebccf1e3SJoseph Koshyprocesses that are executing. 115ebccf1e3SJoseph KoshyThe current count on these PMCs can be read using the 116ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCRW 117ebccf1e3SJoseph Koshyrequest. 118ebccf1e3SJoseph KoshyThese PMCs normally count from zero, but the initial count may be 119ebccf1e3SJoseph Koshyset using the 120ebccf1e3SJoseph Koshy.Ic PMC_OP_SETCOUNT 121ebccf1e3SJoseph Koshyoperation. 122ebccf1e3SJoseph Koshy.It System-wide, sampling 123ebccf1e3SJoseph KoshyThese PMCs will periodically sample the instruction pointer of the CPU 124ebccf1e3SJoseph Koshythey are allocated on, and will write the sample to a log for further 125ebccf1e3SJoseph Koshyprocessing. 126ebccf1e3SJoseph KoshyThe desired frequency of sampling is set using the 127ebccf1e3SJoseph Koshy.Ic PMC_OP_SETCOUNT 128ebccf1e3SJoseph Koshyoperation prior to starting the PMC. 129ebccf1e3SJoseph KoshyLog files are configured using the 130ebccf1e3SJoseph Koshy.Ic PMC_OP_CONFIGURELOG 131ebccf1e3SJoseph Koshyoperation. 132ebccf1e3SJoseph Koshy.Pp 133ebccf1e3SJoseph KoshySystem-wide statistical sampling can only be enabled by a process with 134ebccf1e3SJoseph Koshysuper-user privileges. 135ebccf1e3SJoseph Koshy.El 136ebccf1e3SJoseph Koshy.Pp 137ebccf1e3SJoseph KoshyProcesses are allowed to allocate as many PMCs are the hardware and 138ebccf1e3SJoseph Koshycurrent operating conditions permit. 139ebccf1e3SJoseph KoshyProcesses may mix allocations of system-wide and process-private 140ebccf1e3SJoseph KoshyPMCs. 141ebccf1e3SJoseph KoshyMultiple processes are allowed to be concurrently using the facilities 142ebccf1e3SJoseph Koshyof the 143ebccf1e3SJoseph Koshy.Nm 144ebccf1e3SJoseph Koshydriver. 145ebccf1e3SJoseph Koshy.Pp 146ebccf1e3SJoseph KoshyAllocated PMCs are started using the 147ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCSTART 148ebccf1e3SJoseph Koshyoperation, and stopped using the 149ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCSTOP 150ebccf1e3SJoseph Koshyoperation. 151ebccf1e3SJoseph KoshyStopping and starting a PMC is permitted at any time the owner process 152ebccf1e3SJoseph Koshyhas a valid handle to the PMC. 153ebccf1e3SJoseph Koshy.Pp 154ebccf1e3SJoseph KoshyProcess-private PMCs need to be attached to a target process before 155ebccf1e3SJoseph Koshythey can be used. 156ebccf1e3SJoseph KoshyAttaching a process to a PMC is done using the 157ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCATTACH 158ebccf1e3SJoseph Koshyoperation. 159ebccf1e3SJoseph KoshyAn already attached PMC may be detached from its target process 160ebccf1e3SJoseph Koshyusing the converse 161ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCDETACH 162ebccf1e3SJoseph Koshyoperation. 163ebccf1e3SJoseph KoshyIssuing an 164ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCSTART 165ebccf1e3SJoseph Koshyoperation on an as yet unattached PMC will cause it to be attached 166ebccf1e3SJoseph Koshyto its owner process. 167ebccf1e3SJoseph KoshyThe following rules determine whether a given process may attach 168ebccf1e3SJoseph Koshya PMC to another target process: 169ebccf1e3SJoseph Koshy.Bl -bullet -compact 170ebccf1e3SJoseph Koshy.It 171ebccf1e3SJoseph KoshyA non-jailed process with super-user privileges is allowed to attach 172ebccf1e3SJoseph Koshyto any other process in the system. 173ebccf1e3SJoseph Koshy.It 174ebccf1e3SJoseph KoshyOther processes are only allowed to attach to targets that they would 175ebccf1e3SJoseph Koshybe able to attach to for debugging (as determined by 176ebccf1e3SJoseph Koshy.Xr p_candebug 9 ) . 177ebccf1e3SJoseph Koshy.El 178ebccf1e3SJoseph Koshy.Pp 179ebccf1e3SJoseph KoshyPMCs are released using 180ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCRELEASE . 181ebccf1e3SJoseph KoshyAfter a successful 182ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCRELEASE 183ebccf1e3SJoseph Koshyoperation the handle to the PMC will become invalid. 184ebccf1e3SJoseph Koshy.Ss MODIFIER FLAGS 185ebccf1e3SJoseph KoshyThe 186ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCALLOCATE 187ebccf1e3SJoseph Koshyoperation supports the following flags that modify the behavior 188ebccf1e3SJoseph Koshyof an allocated PMC: 189f263522aSJoseph Koshy.Bl -tag -width indent -compact 190ebccf1e3SJoseph Koshy.It Dv PMC_F_DESCENDANTS 191f263522aSJoseph KoshyThis modifier is valid only for a PMC being allocated in process-private 192ebccf1e3SJoseph Koshymode. 193ebccf1e3SJoseph KoshyIt signifies that the PMC will track hardware events for its 194ebccf1e3SJoseph Koshytarget process and the target's current and future descendants. 195f263522aSJoseph Koshy.It Dv PMC_F_KGMON 196f263522aSJoseph KoshyThis modifier is valid only for a PMC being allocated in system-wide 197f263522aSJoseph Koshysampling mode. 198f263522aSJoseph KoshyIt signifies that the PMC's sampling interrupt is to be used to drive 199f263522aSJoseph Koshykernel profiling via 200f263522aSJoseph Koshy.Xr kgmon 8 . 201f263522aSJoseph Koshy.It Dv PMC_F_LOG_PROCCSW 202f263522aSJoseph KoshyThis modifier is valid only for a PMC being allocated in process-private 203f263522aSJoseph Koshymode. 204f263522aSJoseph KoshyWhen this modifier is present, at every process context switch time, 205f263522aSJoseph Koshy.Nm 206f263522aSJoseph Koshywill append a record containing the count of the hardware events 207f263522aSJoseph Koshyseen by the process to the configured log file. 208f263522aSJoseph Koshy.It Dv PMC_F_LOG_PROCEXIT 209f263522aSJoseph KoshyThis modifier is valid only for a PMC being allocated in process-private 210f263522aSJoseph Koshymode. 211f263522aSJoseph KoshyWith this modifier present, 212f263522aSJoseph Koshy.Nm 213f263522aSJoseph Koshywill maintain per-process counts for each target process attached to 214f263522aSJoseph Koshya PMC. 215f263522aSJoseph KoshyAt process exit time, a record containing the target process' pid and 216f263522aSJoseph Koshythe accumulated per-process count for that process will be written to the 217f263522aSJoseph Koshyconfigured log file. 218ebccf1e3SJoseph Koshy.El 219f263522aSJoseph KoshyModifiers 220f263522aSJoseph Koshy.Dv PMC_F_LOG_PROCEXIT 221f263522aSJoseph Koshyand 222f263522aSJoseph Koshy.Dv PMC_F_LOG_PROCCSW 223f263522aSJoseph Koshymay be used in combination with modifier 224f263522aSJoseph Koshy.Dv PMC_F_DESCENDANTS 225f263522aSJoseph Koshyto track the behaviour of complex pipelines of processes. 226ebccf1e3SJoseph Koshy.Ss SIGNALS 227ebccf1e3SJoseph KoshyThe 228ebccf1e3SJoseph Koshy.Nm 229ebccf1e3SJoseph Koshydriver may deliver signals to processes that have allocated PMCs: 230f263522aSJoseph Koshy.Bl -tag -width "XXXXXXXX" -compact 231ebccf1e3SJoseph Koshy.It Bq SIGIO 232ebccf1e3SJoseph KoshyA 233ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCRW 234ebccf1e3SJoseph Koshyoperation was attempted on a process-private PMC that does not have 235ebccf1e3SJoseph Koshyattached target processes. 236ebccf1e3SJoseph Koshy.It Bq SIGBUS 237ebccf1e3SJoseph KoshyThe 238ebccf1e3SJoseph Koshy.Nm 239ebccf1e3SJoseph Koshydriver is being unloaded from the kernel. 240ebccf1e3SJoseph Koshy.El 241ebccf1e3SJoseph Koshy.Sh PROGRAMMING API 242ebccf1e3SJoseph KoshyThe recommended way for application programs to use the facilities of 243ebccf1e3SJoseph Koshythe 244ebccf1e3SJoseph Koshy.Nm 245ebccf1e3SJoseph Koshydriver is using the API provided by the library 246ebccf1e3SJoseph Koshy.Xr pmc 3 . 247ebccf1e3SJoseph Koshy.Pp 248ebccf1e3SJoseph KoshyThe 249ebccf1e3SJoseph Koshy.Nm 250ebccf1e3SJoseph Koshydriver operates using a system call number that is dynamically 251ebccf1e3SJoseph Koshyallotted to it when it is loaded into the kernel. 252ebccf1e3SJoseph Koshy.Pp 253ebccf1e3SJoseph KoshyThe 254ebccf1e3SJoseph Koshy.Nm 255ebccf1e3SJoseph Koshydriver supports the following operations: 256ebccf1e3SJoseph Koshy.Bl -tag -width indent 257ebccf1e3SJoseph Koshy.It Ic PMC_OP_CONFIGURELOG 258ebccf1e3SJoseph KoshyConfigure a log file for sampling mode PMCs. 259f263522aSJoseph Koshy.It Ic PMC_OP_FLUSHLOG 260f263522aSJoseph KoshyTransfer buffered log data inside 261f263522aSJoseph Koshy.Nm 262f263522aSJoseph Koshyto a configured output file. 263f263522aSJoseph KoshyThis operation returns to the caller after the write operation 264f263522aSJoseph Koshyhas returned. 265ebccf1e3SJoseph Koshy.It Ic PMC_OP_GETCPUINFO 266ebccf1e3SJoseph KoshyRetrieve information about the number of CPUs on the system and 267ebccf1e3SJoseph Koshythe number of hardware performance monitoring counters available per-CPU. 268ebccf1e3SJoseph Koshy.It Ic PMC_OP_GETDRIVERSTATS 269ebccf1e3SJoseph KoshyRetrieve module statistics (for analyzing the behavior of 270ebccf1e3SJoseph Koshy.Nm 271ebccf1e3SJoseph Koshyitself). 272ebccf1e3SJoseph Koshy.It Ic PMC_OP_GETMODULEVERSION 273ebccf1e3SJoseph KoshyRetrieve the version number of API. 274ebccf1e3SJoseph Koshy.It Ic PMC_OP_GETPMCINFO 275ebccf1e3SJoseph KoshyRetrieve information about the current state of the PMCs on a 276ebccf1e3SJoseph Koshygiven CPU. 277ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCADMIN 278ebccf1e3SJoseph KoshySet the administrative state (i.e., whether enabled or disabled) for 279ebccf1e3SJoseph Koshythe hardware PMCs managed by the 280ebccf1e3SJoseph Koshy.Nm 281ebccf1e3SJoseph Koshydriver. 282ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCALLOCATE 283ebccf1e3SJoseph KoshyAllocate and configure a PMC. 284ebccf1e3SJoseph KoshyOn successful allocation, a handle to the PMC (a small integer) 285ebccf1e3SJoseph Koshyis returned. 286ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCATTACH 287ebccf1e3SJoseph KoshyAttach a process mode PMC to a target process. 288ebccf1e3SJoseph KoshyThe PMC will be active whenever a thread in the target process is 289ebccf1e3SJoseph Koshyscheduled on a CPU. 290ebccf1e3SJoseph Koshy.Pp 291ebccf1e3SJoseph KoshyIf the 292ebccf1e3SJoseph Koshy.Dv PMC_F_DESCENDANTS 293ebccf1e3SJoseph Koshyflag had been specified at PMC allocation time, then the PMC is 294ebccf1e3SJoseph Koshyattached to all current and future descendants of the target process. 295ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCDETACH 296ebccf1e3SJoseph KoshyDetach a PMC from its target process. 297ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCRELEASE 298ebccf1e3SJoseph KoshyRelease a PMC. 299ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCRW 300ebccf1e3SJoseph KoshyRead and write a PMC. 301ebccf1e3SJoseph KoshyThis operation is valid only for PMCs configured in counting modes. 302ebccf1e3SJoseph Koshy.It Ic PMC_OP_SETCOUNT 303ebccf1e3SJoseph KoshySet the initial count (for counting mode PMCs) or the desired sampling 304ebccf1e3SJoseph Koshyrate (for sampling mode PMCs). 305ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCSTART 306ebccf1e3SJoseph KoshyStart a PMC. 307ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCSTOP 308ebccf1e3SJoseph KoshyStop a PMC. 309ebccf1e3SJoseph Koshy.It Ic PMC_OP_WRITELOG 310ebccf1e3SJoseph KoshyInsert a timestamped user record into the log file. 311ebccf1e3SJoseph Koshy.El 312ebccf1e3SJoseph Koshy.Ss i386 SPECIFIC API 313ebccf1e3SJoseph KoshySome i386 family CPUs support the RDPMC instruction which allows a 314ebccf1e3SJoseph Koshyuser process to read a PMC value without needing to invoke a 315ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCRW 316ebccf1e3SJoseph Koshyoperation. 317ebccf1e3SJoseph KoshyOn such CPUs, the machine address associated with an allocated PMC is 318ebccf1e3SJoseph Koshyretrievable using the 319ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCX86GETMSR 320ebccf1e3SJoseph Koshysystem call. 321ebccf1e3SJoseph Koshy.Bl -tag -width indent 322ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCX86GETMSR 323ebccf1e3SJoseph KoshyRetrieve the MSR (machine specific register) number associated with 324ebccf1e3SJoseph Koshythe given PMC handle. 325ebccf1e3SJoseph Koshy.Pp 326c5153e19SJoseph KoshyThe PMC needs to be in process-private mode and allocated without the 327c5153e19SJoseph Koshy.Va PMC_F_DESCENDANTS 328c5153e19SJoseph Koshymodifier flag, and should be attached only to its owner process at the 329c5153e19SJoseph Koshytime of the call. 330ebccf1e3SJoseph Koshy.El 331ebccf1e3SJoseph Koshy.Ss amd64 SPECIFIC API 332ebccf1e3SJoseph KoshyAMD64 cpus support the RDPMC instruction which allows a 333ebccf1e3SJoseph Koshyuser process to read a PMC value without needing to invoke a 334ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCRW 335ebccf1e3SJoseph Koshyoperation. 336ebccf1e3SJoseph KoshyThe machine address associated with an allocated PMC is 337ebccf1e3SJoseph Koshyretrievable using the 338ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCX86GETMSR 339ebccf1e3SJoseph Koshysystem call. 340ebccf1e3SJoseph Koshy.Bl -tag -width indent 341ebccf1e3SJoseph Koshy.It Ic PMC_OP_PMCX86GETMSR 342ebccf1e3SJoseph KoshyRetrieve the MSR (machine specific register) number associated with 343ebccf1e3SJoseph Koshythe given PMC handle. 344ebccf1e3SJoseph Koshy.Pp 345c5153e19SJoseph KoshyThe PMC needs to be in process-private mode and allocated without the 346c5153e19SJoseph Koshy.Va PMC_F_DESCENDANTS 347c5153e19SJoseph Koshymodifier flag, and should be attached only to its owner process at the 348c5153e19SJoseph Koshytime of the call. 349ebccf1e3SJoseph Koshy.El 350ebccf1e3SJoseph Koshy.Sh SYSCTL TUNABLES 351ebccf1e3SJoseph KoshyThe behavior of 352ebccf1e3SJoseph Koshy.Nm 353ebccf1e3SJoseph Koshyis influenced by the following 354ebccf1e3SJoseph Koshy.Xr sysctl 8 355f263522aSJoseph Koshyand 356f263522aSJoseph Koshy.Xr loader 8 357ebccf1e3SJoseph Koshytunables: 358ebccf1e3SJoseph Koshy.Bl -tag -width indent 359f263522aSJoseph Koshy.It Va kern.hwpmc.debugflags Pq string, read-write 360ebccf1e3SJoseph Koshy(Only available if the 361ebccf1e3SJoseph Koshy.Nm 362ebccf1e3SJoseph Koshydriver was compiled with 363ebccf1e3SJoseph Koshy.Fl DDEBUG ) . 364ebccf1e3SJoseph KoshyControl the verbosity of debug messages from the 365ebccf1e3SJoseph Koshy.Nm 366ebccf1e3SJoseph Koshydriver. 367f263522aSJoseph Koshy.It Va kern.hwpmc.hashsize Pq integer, read-only 368ebccf1e3SJoseph KoshyThe number of rows in the hash-tables used to keep track of owner and 369ebccf1e3SJoseph Koshytarget processes. 370f263522aSJoseph KoshyThe default is 16. 371f263522aSJoseph Koshy.It Va kern.hwpmc.logbuffersize Pq integer, read-only 372f263522aSJoseph KoshyThe size in kilobytes of each log buffer used by 373f263522aSJoseph Koshy.Nm Ap s 374f263522aSJoseph Koshylogging function. 375f263522aSJoseph KoshyThe default buffers size is 4KB. 376f263522aSJoseph Koshy.It Va kern.hwpmc.mtxpoolsize Pq integer, read-only 377ebccf1e3SJoseph KoshyThe size of the spin mutex pool used by the PMC driver. 378f263522aSJoseph KoshyThe default is 32. 379f263522aSJoseph Koshy.It Va kern.hwpmc.nbuffers Pq integer, read-only 380f263522aSJoseph KoshyThe number of log buffers used by 381f263522aSJoseph Koshy.Nm 382f263522aSJoseph Koshyfor logging. 383f263522aSJoseph KoshyThe default is 16. 384f263522aSJoseph Koshy.It Va kern.hwpmc.nsamples Pq integer, read-only 385f263522aSJoseph KoshyThe number of entries in the per-cpu ring buffer used during sampling. 386f263522aSJoseph KoshyThe default is 16. 387f263522aSJoseph Koshy.It Va security.bsd.unprivileged_syspmcs Pq boolean, read-write 388ebccf1e3SJoseph KoshyIf set to non-zero, allow unprivileged processes to allocate system-wide 389ebccf1e3SJoseph KoshyPMCs. 390ebccf1e3SJoseph KoshyThe default value is 0. 391f263522aSJoseph Koshy.It Va security.bsd.unprivileged_proc_debug Pq boolean, read-write 392ebccf1e3SJoseph KoshyIf set to 0, the 393ebccf1e3SJoseph Koshy.Nm 394f263522aSJoseph Koshydriver will only allow privileged processes to attach PMCs to other 395ebccf1e3SJoseph Koshyprocesses. 396ebccf1e3SJoseph Koshy.El 397ebccf1e3SJoseph Koshy.Pp 398ebccf1e3SJoseph KoshyThese variables may be set in the kernel environment using 399ebccf1e3SJoseph Koshy.Xr kenv 1 400ebccf1e3SJoseph Koshybefore 401ebccf1e3SJoseph Koshy.Nm 402ebccf1e3SJoseph Koshyis loaded. 403ebccf1e3SJoseph Koshy.Sh SECURITY CONSIDERATIONS 404ebccf1e3SJoseph KoshyPMCs may be used to monitor the actual behaviour of the system on hardware. 405ebccf1e3SJoseph KoshyIn situations where this constitutes an undesirable information leak, 406ebccf1e3SJoseph Koshythe following options are available: 407ebccf1e3SJoseph Koshy.Bl -enum 408ebccf1e3SJoseph Koshy.It 409ebccf1e3SJoseph KoshySet the 410ebccf1e3SJoseph Koshy.Xr sysctl 8 411ebccf1e3SJoseph Koshytunable 412ebccf1e3SJoseph Koshy.Va "security.bsd.unprivileged_syspmcs" 413ebccf1e3SJoseph Koshyto 0. 414ebccf1e3SJoseph KoshyThis ensures that unprivileged processes cannot allocate system-wide 415ebccf1e3SJoseph KoshyPMCs and thus cannot observe the hardware behavior of the system 416ebccf1e3SJoseph Koshyas a whole. 417ebccf1e3SJoseph KoshyThis tunable may also be set at boot time using 418ebccf1e3SJoseph Koshy.Xr loader 8 , 419ebccf1e3SJoseph Koshyor with 420ebccf1e3SJoseph Koshy.Xr kenv 1 421ebccf1e3SJoseph Koshyprior to loading the 422ebccf1e3SJoseph Koshy.Nm 423ebccf1e3SJoseph Koshydriver into the kernel. 424ebccf1e3SJoseph Koshy.It 425ebccf1e3SJoseph KoshySet the 426ebccf1e3SJoseph Koshy.Xr sysctl 8 427ebccf1e3SJoseph Koshytunable 428ebccf1e3SJoseph Koshy.Va "security.bsd.unprivileged_proc_debug" 429ebccf1e3SJoseph Koshyto 0. 430ebccf1e3SJoseph KoshyThis will ensure that an unprivileged process cannot attach a PMC 431ebccf1e3SJoseph Koshyto any process other than itself and thus cannot observe the hardware 432ebccf1e3SJoseph Koshybehavior of other processes with the same credentials. 433ebccf1e3SJoseph Koshy.El 434ebccf1e3SJoseph Koshy.Pp 435ebccf1e3SJoseph KoshySystem administrators should note that on IA-32 platforms 436ebccf1e3SJoseph Koshy.Fx 437ebccf1e3SJoseph Koshymakes the content of the IA-32 TSC counter available to all processes 438ebccf1e3SJoseph Koshyvia the RDTSC instruction. 439ebccf1e3SJoseph Koshy.Sh IMPLEMENTATION NOTES 440f263522aSJoseph Koshy.Ss SMP Symmetry 441f263522aSJoseph KoshyThe kernel driver requires all physical CPUs in an SMP system to have 442f263522aSJoseph Koshyidentical performance monitoring counter hardware. 443ebccf1e3SJoseph Koshy.Ss i386 TSC Handling 444ebccf1e3SJoseph KoshyHistorically, on the x86 architecture, 445ebccf1e3SJoseph Koshy.Fx 446ebccf1e3SJoseph Koshyhas permitted user processes running at a processor CPL of 3 to 447ebccf1e3SJoseph Koshyread the TSC using the RDTSC instruction. 448ebccf1e3SJoseph KoshyThe 449ebccf1e3SJoseph Koshy.Nm 450ebccf1e3SJoseph Koshydriver preserves this semantic. 451ebccf1e3SJoseph Koshy.Ss Intel P4/HTT Handling 452ebccf1e3SJoseph KoshyOn CPUs with HTT support, Intel P4 PMCs are capable of qualifying 453ebccf1e3SJoseph Koshyonly a subset of hardware events on a per-logical CPU basis. 454ebccf1e3SJoseph KoshyConsequently, if HTT is enabled on a system with Intel Pentium P4 455ebccf1e3SJoseph KoshyPMCs, then the 456ebccf1e3SJoseph Koshy.Nm 457ebccf1e3SJoseph Koshydriver will reject allocation requests for process-private PMCs that 458ebccf1e3SJoseph Koshyrequest counting of hardware events that cannot be counted separately 459ebccf1e3SJoseph Koshyfor each logical CPU. 460f263522aSJoseph Koshy.Ss Intel Pentium-Pro Handling 461f263522aSJoseph KoshyWriting a value to the PMC MSRs found ing Intel Pentium-Pro style PMCs 462f263522aSJoseph Koshy(found in 463f263522aSJoseph Koshy.Tn "Intel Pentium Pro" , 464f263522aSJoseph Koshy.Tn "Pentium II" , 465f263522aSJoseph Koshy.Tn "Pentium III" , 466f263522aSJoseph Koshy.Tn "Pentium M" 467f263522aSJoseph Koshyand 468f263522aSJoseph Koshy.Tn "Celeron" 469f263522aSJoseph Koshyprocessors) will replicate bit 31 of the 470f263522aSJoseph Koshyvalue being written into the upper 8 bits of the MSR, 471f263522aSJoseph Koshybringing down the usable width of these PMCs to 31 bits. 472f263522aSJoseph KoshyFor process-virtual PMCs, the 473f263522aSJoseph Koshy.Nm 474f263522aSJoseph Koshydriver implements a workaround in software and makes the corrected 64 475f263522aSJoseph Koshybit count available via the 476f263522aSJoseph Koshy.Ic PMC_OP_RW 477f263522aSJoseph Koshyoperation. 478f263522aSJoseph KoshyProcesses that intend to use RDPMC instructions directly or 479f263522aSJoseph Koshythat intend to write values larger than 2^31 into these PMCs with 480f263522aSJoseph Koshy.Ic PMC_OP_RW 481f263522aSJoseph Koshyneed to be aware of this hardware limitation. 482f263522aSJoseph Koshy.Sh DIAGNOSTICS 483f263522aSJoseph Koshy.Bl -diag 484f263522aSJoseph Koshy.It hwpmc: tunable hashsize=%d must be greater than zero. 485f263522aSJoseph KoshyA negative value was supplied for tunable 486f263522aSJoseph Koshy.Va kern.hwpmc.hashsize . 487f263522aSJoseph Koshy.It hwpmc: tunable logbuffersize=%d must be greater than zero. 488f263522aSJoseph KoshyA negative value was supplied for tunable 489f263522aSJoseph Koshy.Va kern.hwpmc.logbuffersize . 490f263522aSJoseph Koshy.It hwpmc: tunable nlogbuffers=%d must be greater than zero. 491f263522aSJoseph KoshyA negative value was supplied for tunable 492f263522aSJoseph Koshy.Va kern.hwpmc.nlogbuffers . 493f263522aSJoseph Koshy.It hwpmc: tunable nsamples=%d out of range. 494f263522aSJoseph KoshyThe value for tunable 495f263522aSJoseph Koshy.Va kern.hwpmc.nsamples 496f263522aSJoseph Koshywas negative or greater than 65535. 497f263522aSJoseph Koshy.El 498ebccf1e3SJoseph Koshy.Sh ERRORS 499ebccf1e3SJoseph KoshyAn command issued to the 500ebccf1e3SJoseph Koshy.Nm 501ebccf1e3SJoseph Koshydriver may fail with the following errors: 502ebccf1e3SJoseph Koshy.Bl -tag -width Er 503ebccf1e3SJoseph Koshy.It Bq Er EBUSY 504ebccf1e3SJoseph KoshyAn 505ebccf1e3SJoseph Koshy.Ic OP_CONFIGURELOG 506ebccf1e3SJoseph Koshyoperation was requested while an existing log was active. 507ebccf1e3SJoseph Koshy.It Bq Er EBUSY 508ebccf1e3SJoseph KoshyA 509ebccf1e3SJoseph Koshy.Ic DISABLE 510ebccf1e3SJoseph Koshyoperation was requested using the 511ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCADMIN 512ebccf1e3SJoseph Koshyrequest for a set of hardware resources currently in use for 513ebccf1e3SJoseph Koshyprocess-private PMCs. 514ebccf1e3SJoseph Koshy.It Bq Er EBUSY 515ebccf1e3SJoseph KoshyA 516ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCADMIN 517ebccf1e3SJoseph Koshyoperation was requested on an active system mode PMC. 518ebccf1e3SJoseph Koshy.It Bq Er EBUSY 519ebccf1e3SJoseph KoshyA 520ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCATTACH 521ebccf1e3SJoseph Koshyoperation was requested for a target process that already had another 522ebccf1e3SJoseph KoshyPMC using the same hardware resources attached to it. 523ebccf1e3SJoseph Koshy.It Bq Er EBUSY 524ebccf1e3SJoseph KoshyAn 525ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCRW 526ebccf1e3SJoseph Koshyrequest writing a new value was issued on a PMC that was active. 527ebccf1e3SJoseph Koshy.It Bq Er EBUSY 528ebccf1e3SJoseph KoshyAn 529ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCSETCOUNT 530ebccf1e3SJoseph Koshyrequest was issued on a PMC that was active. 531ebccf1e3SJoseph Koshy.It Bq Er EEXIST 532ebccf1e3SJoseph KoshyA 533ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCATTACH 534ebccf1e3SJoseph Koshyrequest was reissued for a target process that already is the target 535ebccf1e3SJoseph Koshyof this PMC. 536ebccf1e3SJoseph Koshy.It Bq Er EFAULT 537ebccf1e3SJoseph KoshyA bad address was passed in to the driver. 538ebccf1e3SJoseph Koshy.It Bq Er EINVAL 539ebccf1e3SJoseph KoshyA process specified an invalid PMC handle. 540ebccf1e3SJoseph Koshy.It Bq Er EINVAL 541ebccf1e3SJoseph KoshyAn invalid CPU number was passed in for an 542ebccf1e3SJoseph Koshy.Ic PMC_OP_GETPMCINFO 543ebccf1e3SJoseph Koshyoperation. 544ebccf1e3SJoseph Koshy.It Bq Er EINVAL 545ebccf1e3SJoseph KoshyAn invalid CPU number was passed in for an 546ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCADMIN 547ebccf1e3SJoseph Koshyoperation. 548ebccf1e3SJoseph Koshy.It Bq Er EINVAL 549ebccf1e3SJoseph KoshyAn invalid operation request was passed in for an 550ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCADMIN 551ebccf1e3SJoseph Koshyoperation. 552ebccf1e3SJoseph Koshy.It Bq Er EINVAL 553ebccf1e3SJoseph KoshyAn invalid PMC id was passed in for an 554ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCADMIN 555ebccf1e3SJoseph Koshyoperation. 556ebccf1e3SJoseph Koshy.It Bq Er EINVAL 557ebccf1e3SJoseph KoshyA suitable PMC matching the parameters passed in to a 558ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCALLOCATE 559ebccf1e3SJoseph Koshyrequest could not be allocated. 560ebccf1e3SJoseph Koshy.It Bq Er EINVAL 561ebccf1e3SJoseph KoshyAn invalid PMC mode was requested during a 562ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCALLOCATE 563ebccf1e3SJoseph Koshyrequest. 564ebccf1e3SJoseph Koshy.It Bq Er EINVAL 565ebccf1e3SJoseph KoshyAn invalid CPU number was specified during a 566ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCALLOCATE 567ebccf1e3SJoseph Koshyrequest. 568ebccf1e3SJoseph Koshy.It Bq Er EINVAL 569ebccf1e3SJoseph KoshyA cpu other than 570ebccf1e3SJoseph Koshy.Li PMC_CPU_ANY 571ebccf1e3SJoseph Koshywas specified in a 572ebccf1e3SJoseph Koshy.Ic PMC_OP_ALLOCATE 573ebccf1e3SJoseph Koshyrequest for a process-private PMC. 574ebccf1e3SJoseph Koshy.It Bq Er EINVAL 575ebccf1e3SJoseph KoshyA cpu number of 576ebccf1e3SJoseph Koshy.Li PMC_CPU_ANY 577ebccf1e3SJoseph Koshywas specified in a 578ebccf1e3SJoseph Koshy.Ic PMC_OP_ALLOCATE 579ebccf1e3SJoseph Koshyrequest for a system-wide PMC. 580ebccf1e3SJoseph Koshy.It Bq Er EINVAL 581ebccf1e3SJoseph KoshyThe 582ebccf1e3SJoseph Koshy.Ar pm_flags 583ebccf1e3SJoseph Koshyargument to an 584ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCALLOCATE 585ebccf1e3SJoseph Koshyrequest contained unknown flags. 586ebccf1e3SJoseph Koshy.It Bq Er EINVAL 587ebccf1e3SJoseph KoshyA PMC allocated for system-wide operation was specified with a 588ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCATTACH 589ebccf1e3SJoseph Koshyrequest. 590ebccf1e3SJoseph Koshy.It Bq Er EINVAL 591ebccf1e3SJoseph KoshyThe 592ebccf1e3SJoseph Koshy.Ar pm_pid 593ebccf1e3SJoseph Koshyargument to a 594ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCATTACH 595ebccf1e3SJoseph Koshyrequest specified an illegal process id. 596ebccf1e3SJoseph Koshy.It Bq Er EINVAL 597ebccf1e3SJoseph KoshyA 598ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCDETACH 599ebccf1e3SJoseph Koshyrequest was issued for a PMC not attached to the target process. 600ebccf1e3SJoseph Koshy.It Bq Er EINVAL 601ebccf1e3SJoseph KoshyArgument 602ebccf1e3SJoseph Koshy.Ar pm_flags 603ebccf1e3SJoseph Koshyto a 604ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCRW 605ebccf1e3SJoseph Koshyrequest contained illegal flags. 606ebccf1e3SJoseph Koshy.It Bq Er EINVAL 607ebccf1e3SJoseph KoshyA 608ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCX86GETMSR 609c5153e19SJoseph Koshyoperation was requested for a PMC not in process-virtual mode, or 610c5153e19SJoseph Koshyfor a PMC that is not solely attached to its owner process, or for 611c5153e19SJoseph Koshya PMC that was allocated with flag 612c5153e19SJoseph Koshy.Va PMC_F_DESCENDANTS . 613ebccf1e3SJoseph Koshy.It Bq Er EINVAL 614ebccf1e3SJoseph Koshy(On Intel Pentium 4 CPUs with HTT support) An allocation request for 615ebccf1e3SJoseph Koshya process-private PMC was issued for an event that does not support 616ebccf1e3SJoseph Koshycounting on a per-logical CPU basis. 617ebccf1e3SJoseph Koshy.It Bq Er ENOMEM 618ebccf1e3SJoseph KoshyThe system was not able to allocate kernel memory. 619ebccf1e3SJoseph Koshy.It Bq Er ENOSYS 620ebccf1e3SJoseph Koshy(i386 architectures) A 621ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCX86GETMSR 622ebccf1e3SJoseph Koshyoperation was requested for hardware that does not support reading 623ebccf1e3SJoseph KoshyPMCs directly with the RDPMC instruction. 624ebccf1e3SJoseph Koshy.It Bq Er ENXIO 625ebccf1e3SJoseph KoshyAn 626ebccf1e3SJoseph Koshy.Ic OP_GETPMCINFO 627ebccf1e3SJoseph Koshyoperation was requested for a disabled CPU. 628ebccf1e3SJoseph Koshy.It Bq Er ENXIO 629ebccf1e3SJoseph KoshyA system-wide PMC on a disabled CPU was requested to be allocated with 630ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCALLOCATE . 631ebccf1e3SJoseph Koshy.It Bq Er ENXIO 632ebccf1e3SJoseph KoshyA 633ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCSTART 634ebccf1e3SJoseph Koshyor 635ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCSTOP 636ebccf1e3SJoseph Koshyrequest was issued for a system-wide PMC that was allocated on a 637ebccf1e3SJoseph Koshycurrently disabled CPU. 638ebccf1e3SJoseph Koshy.It Bq Er EPERM 639ebccf1e3SJoseph KoshyAn 640ebccf1e3SJoseph Koshy.Ic OP_PMCADMIN 641ebccf1e3SJoseph Koshyrequest was issued by a process without super-user 642ebccf1e3SJoseph Koshyprivilege or by a jailed super-user process. 643ebccf1e3SJoseph Koshy.It Bq Er EPERM 644ebccf1e3SJoseph KoshyAn 645ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCATTACH 646ebccf1e3SJoseph Koshyoperation was issued for a target process that the current process 647ebccf1e3SJoseph Koshydoes not have permission to attach to. 648c5153e19SJoseph Koshy.It Bq Er EPERM 649c5153e19SJoseph Koshy.Pq "i386 and amd64 architectures" 650c5153e19SJoseph KoshyAn 651c5153e19SJoseph Koshy.Ic PMC_OP_PMCATTACH 652c5153e19SJoseph Koshyoperation was issued on a PMC whose MSR has been retrieved using 653c5153e19SJoseph Koshy.Ic PMC_OP_PMCX86GETMSR . 654ebccf1e3SJoseph Koshy.It Bq Er ESRCH 655f263522aSJoseph KoshyA process issued a PMC operation request without having allocated any 656f263522aSJoseph KoshyPMCs. 657f263522aSJoseph Koshy.It Bq Er ESRCH 658f263522aSJoseph KoshyA process issued a PMC operation request after the PMC was detached 659f263522aSJoseph Koshyfrom all of its target processes. 660ebccf1e3SJoseph Koshy.It Bq Er ESRCH 661ebccf1e3SJoseph KoshyA 662ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCATTACH 663ebccf1e3SJoseph Koshyrequest specified a non-existent process id. 664ebccf1e3SJoseph Koshy.It Bq Er ESRCH 665ebccf1e3SJoseph KoshyThe target process for a 666ebccf1e3SJoseph Koshy.Ic PMC_OP_PMCDETACH 667ebccf1e3SJoseph Koshyoperation is not being monitored by the 668ebccf1e3SJoseph Koshy.Nm 669ebccf1e3SJoseph Koshydriver. 670ebccf1e3SJoseph Koshy.El 671ebccf1e3SJoseph Koshy.Sh BUGS 672ebccf1e3SJoseph KoshyThe driver samples the state of the kernel's logical processor support 673ebccf1e3SJoseph Koshyat the time of initialization (i.e., at module load time). 674ebccf1e3SJoseph KoshyOn CPUs supporting logical processors, the driver could misbehave if 675ebccf1e3SJoseph Koshylogical processors are subsequently enabled or disabled while the 676ebccf1e3SJoseph Koshydriver is active. 677ebccf1e3SJoseph Koshy.Sh SEE ALSO 678ebccf1e3SJoseph Koshy.Xr kenv 1 , 679ebccf1e3SJoseph Koshy.Xr pmc 3 , 680f263522aSJoseph Koshy.Xr kgmon 8 , 681ebccf1e3SJoseph Koshy.Xr kldload 8 , 682ebccf1e3SJoseph Koshy.Xr pmccontrol 8 , 683ebccf1e3SJoseph Koshy.Xr pmcstat 8 , 684ebccf1e3SJoseph Koshy.Xr sysctl 8 , 685ebccf1e3SJoseph Koshy.Xr p_candebug 9 686