1 .\" Copyright (c) 2007-2008 Joseph Koshy. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" This software is provided by Joseph Koshy ``as is'' and
13 .\" any express or implied warranties, including, but not limited to, the
14 .\" implied warranties of merchantability and fitness for a particular purpose
15 .\" are disclaimed. in no event shall Joseph Koshy be liable
16 .\" for any direct, indirect, incidental, special, exemplary, or consequential
17 .\" damages (including, but not limited to, procurement of substitute goods
18 .\" or services; loss of use, data, or profits; or business interruption)
19 .\" however caused and on any theory of liability, whether in contract, strict
20 .\" liability, or tort (including negligence or otherwise) arising in any way
21 .\" out of the use of this software, even if advised of the possibility of
26 .Dd September 22, 2008
28 .Dt PMC_CAPABILITIES 3
30 .Nm pmc_capabilities ,
36 .Nd retrieve information about performance monitoring counters
42 .Fn pmc_capabilities "pmc_id_t pmc" "uint32_t *caps"
44 .Fn pmc_cpuinfo "const struct pmc_cpuinfo **cpu_info"
48 .Fn pmc_npmc "int cpu"
50 .Fn pmc_pmcinfo "int cpu" "struct pmc_pmcinfo **pmc_info"
52 .Fn pmc_width "pmc_id_t pmc" "uint32_t *width"
54 These functions retrieve information about performance monitoring
59 retrieves the hardware capabilities of a PMC.
62 is a PMC handle obtained by a prior call to
64 The function sets argument
66 to a bit mask of capabilities supported by the PMC denoted by
69 PMC capabilities are described in
74 retrieves information about the CPUs in the system.
77 will be set to point to an internal structure with information about
79 The caller should not free this pointer value.
80 This structure has the following fields:
81 .Bl -tag -width "pm_classes" -offset indent -compact
83 Specifies the CPU type.
85 Specifies the number of CPUs in the system.
87 Specifies the number of PMC rows per CPU.
89 Specifies the number of distinct classes of PMCs in the system.
92 .Vt "struct pmc_classinfo"
93 descriptors describing the properties of each class of PMCs
99 is a convenience function that returns the maximum CPU number in
101 On systems that support sparsely numbered CPUs, not all CPUs may
102 be physically present.
103 Applications need to be prepared to deal with nonexistent CPUs.
107 is a convenience function that returns the number of PMCs available
108 in the CPU specified by argument
113 returns information about the current state of the PMC hardware
114 in the CPU specified by argument
116 The location specified by argument
118 is set to point an array of
119 .Vt "struct pmc_info"
120 structures each describing the state of one PMC in the CPU.
121 These structure contain the following fields:
122 .Bl -tag -width pm_ownerpid -offset indent -compact
124 A human readable name for the PMC.
126 The PMC class for the PMC.
128 Non-zero if the PMC is enabled.
130 The disposition of the PMC row for this PMC.
131 Row dispositions are documented in
134 If the hardware is in use, the process id of the owner of the PMC.
136 The PMC mode as described in
139 If the hardware is in use, the PMC event being measured.
141 If the hardware is in use, the flags associated with the PMC.
143 For sampling PMCs, the reload count associated with the PMC.
148 is used to retrieve the width in bits of the hardware counters
149 associated with a PMC.
152 is a PMC handle obtained by a prior call to
154 The function sets the location pointed to by argument
156 to the width of the physical counters associated with PMC
163 returns a positive integer if successful; otherwise the value -1 is
164 returned and the global variable
166 is set to indicate the error.
169 .Fn pmc_capabilities ,
174 return 0 if successful; otherwise the value -1 is returned and the
177 is set to indicate the error.
181 may fail with the following errors:
184 The argument to the function was invalid.
192 may fail with the following errors:
197 to initialize the PMC library had failed.
202 may fail with the following errors:
211 specified a disabled or absent CPU.
216 may fail with the following errors:
219 The argument to the function was invalid.
224 .Xr pmc_get_driver_stats 3 ,
225 .Xr pmc_name_of_capability 3 ,
226 .Xr pmc_name_of_cputype 3 ,
227 .Xr pmc_name_of_class 3 ,
228 .Xr pmc_name_of_event 3 ,
229 .Xr pmc_name_of_mode 3 ,