| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

pfmlib.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2001-2007 Hewlett-Packard Development Company, L.P.
3 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22 #ifndef __PFMLIB_H__
23 #define __PFMLIB_H__
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 #include <inttypes.h>
29 #include <stdio.h>
30
31 #include <perfmon/pfmlib_comp.h>
32 #include <perfmon/pfmlib_os.h>
33
34 #define PFMLIB_VERSION ( 3 << 16 | 9 )
35 #define PFMLIB_MAJ_VERSION( v ) ( ( v ) >> 16 )
36 #define PFMLIB_MIN_VERSION( v ) ( (v)&0xffff )
37
38 /*
39 * Maximum number of PMCs/PMDs supported by the library (especially bitmasks)
40 */
41 #define PFMLIB_MAX_PMCS 512 /* maximum number of PMCS supported by the library */
42 #define PFMLIB_MAX_PMDS 512 /* maximum number of PMDS supported by the library */
43
44 /*
45 * privilege level mask (mask can be combined)
46 * The interpretation of the level is specific to each
47 * architecture. Checkout the architecture specific header
48 * file for more details.
49 */
50 #define PFM_PLM0 0x1 /* priv level 0 */
51 #define PFM_PLM1 0x2 /* priv level 1 */
52 #define PFM_PLM2 0x4 /* priv level 2 */
53 #define PFM_PLM3 0x8 /* priv level 3 */
54
55 /*
56 * type used to describe a set of bits in the mask (container type)
57 */
58 typedef unsigned long pfmlib_regmask_bits_t;
59
60 /*
61 * how many elements do we need to represent all the PMCs and PMDs (rounded up)
62 */
63 #if PFMLIB_MAX_PMCS > PFMLIB_MAX_PMDS
64 #define PFMLIB_REG_MAX PFMLIB_MAX_PMCS
65 #else
66 #define PFMLIB_REG_MAX PFMLIB_MAX_PMDS
67 #endif
68
69 #ifndef SWIG
70 #define __PFMLIB_REG_BV_BITS ( sizeof( pfmlib_regmask_bits_t ) << 3 )
71 #define PFMLIB_BVSIZE( x ) ( ( ( x ) + (__PFMLIB_REG_BV_BITS)-1 ) / __PFMLIB_REG_BV_BITS )
72 #define PFMLIB_REG_BV PFMLIB_BVSIZE( PFMLIB_REG_MAX )
73 #endif
74
75 typedef struct {
76 pfmlib_regmask_bits_t bits[PFMLIB_REG_BV];
77 } pfmlib_regmask_t;
78
79 #define PFMLIB_MAX_MASKS_PER_EVENT 48 /* maximum number of unit masks per event */
80
81 /*
82 * event definition for pfmlib_input_param_t
83 */
84 typedef struct {
85 unsigned int event; /* event descriptor */
86 unsigned int plm; /* event privilege level mask */
87 unsigned long flags; /* per-event flag */
88 unsigned int unit_masks[PFMLIB_MAX_MASKS_PER_EVENT]; /* unit-mask identifiers */
89 unsigned int num_masks; /* number of masks specified in 'unit_masks' */
90 unsigned long reserved[2]; /* for future use */
91 } pfmlib_event_t;
92
93 /*
94 * generic register definition
95 */
96 typedef struct {
97 unsigned long long reg_value; /* register value */
98 unsigned long long reg_addr; /* hardware register addr or index */
99 unsigned int reg_num; /* logical register index (perfmon2) */
100 unsigned int reg_reserved1; /* for future use */
101 unsigned long reg_alt_addr; /* alternate hw register addr of index */
102 } pfmlib_reg_t;
103
104 /*
105 * library generic input parameters for pfm_dispatch_event()
106 */
107 typedef struct {
108 unsigned int pfp_event_count; /* how many events specified (input) */
109 unsigned int pfp_dfl_plm; /* default priv level : used when event.plm==0 */
110 unsigned int pfp_flags; /* set of flags for all events used when event.flags==0*/
111 unsigned int reserved1; /* for future use */
112 pfmlib_event_t pfp_events[PFMLIB_MAX_PMCS]; /* event descriptions */
113 pfmlib_regmask_t pfp_unavail_pmcs; /* bitmask of unavailable PMC registers */
114 unsigned long reserved[6]; /* for future use */
115 } pfmlib_input_param_t;
116
117 /*
118 * pfp_flags possible values (apply to all events)
119 */
120 #define PFMLIB_PFP_SYSTEMWIDE 0x1 /* indicate monitors will be used in a system-wide session */
121
122 /*
123 * library generic output parameters for pfm_dispatch_event()
124 */
125 typedef struct {
126 unsigned int pfp_pmc_count; /* number of entries in pfp_pmcs */
127 unsigned int pfp_pmd_count; /* number of entries in pfp_pmds */
128 pfmlib_reg_t pfp_pmcs[PFMLIB_MAX_PMCS]; /* PMC registers number and values */
129 pfmlib_reg_t pfp_pmds[PFMLIB_MAX_PMDS]; /* PMD registers numbers */
130 unsigned long reserved[7]; /* for future use */
131 } pfmlib_output_param_t;
132
133 /*
134 * library configuration options
135 */
136 typedef struct {
137 unsigned int pfm_debug : 1; /* set in debug mode */
138 unsigned int pfm_verbose : 1; /* set in verbose mode */
139 unsigned int pfm_reserved : 30; /* for future use */
140 } pfmlib_options_t;
141
142 /*
143 * special data type for libpfm error value used to help
144 * with Python support and in particular for SWIG. By using
145 * a specific type we can detect library calls and trap errors
146 * in one SWIG statement as opposed to having to keep track of
147 * each call individually. Programs can use 'int' safely for
148 * the return value.
149 */
150 typedef int pfm_err_t; /* error if !PFMLIB_SUCCESS */
151
152 extern pfm_err_t pfm_set_options( pfmlib_options_t* opt );
153 extern pfm_err_t pfm_initialize( void );
154
155 extern pfm_err_t pfm_list_supported_pmus( int ( *pf )( const char* fmt, ... ) );
156 extern pfm_err_t pfm_get_pmu_name( char* name, int maxlen );
157 extern pfm_err_t pfm_get_pmu_type( int* type );
158 extern pfm_err_t pfm_get_pmu_name_bytype( int type, char* name, size_t maxlen );
159 extern pfm_err_t pfm_is_pmu_supported( int type );
160 extern pfm_err_t pfm_force_pmu( int type );
161
162 /*
163 * pfm_find_event_byname() is obsolete, use pfm_find_event
164 */
165 extern pfm_err_t pfm_find_event( const char* str, unsigned int* idx );
166 extern pfm_err_t pfm_find_event_byname( const char* name, unsigned int* idx );
167 extern pfm_err_t pfm_find_event_bycode( int code, unsigned int* idx );
168 extern pfm_err_t pfm_find_event_bycode_next( int code, unsigned int start, unsigned int* next );
169 extern pfm_err_t pfm_find_event_mask( unsigned int event_idx, const char* str, unsigned int* mask_idx );
170 extern pfm_err_t pfm_find_full_event( const char* str, pfmlib_event_t* e );
171
172 extern pfm_err_t pfm_get_max_event_name_len( size_t* len );
173
174 extern pfm_err_t pfm_get_num_events( unsigned int* count );
175 extern pfm_err_t pfm_get_num_event_masks( unsigned int event_idx, unsigned int* count );
176 extern pfm_err_t pfm_get_event_name( unsigned int idx, char* name, size_t maxlen );
177 extern pfm_err_t pfm_get_full_event_name( pfmlib_event_t* e, char* name, size_t maxlen );
178 extern pfm_err_t pfm_get_event_code( unsigned int idx, int* code );
179 extern pfm_err_t pfm_get_event_mask_code( unsigned int idx, unsigned int mask_idx, unsigned int* code );
180 extern pfm_err_t pfm_get_event_counters( unsigned int idx, pfmlib_regmask_t* counters );
181 extern pfm_err_t pfm_get_event_description( unsigned int idx, char** str );
182 extern pfm_err_t pfm_get_event_code_counter( unsigned int idx, unsigned int cnt, int* code );
183 extern pfm_err_t pfm_get_event_mask_name( unsigned int event_idx, unsigned int mask_idx, char* name, size_t maxlen );
184 extern pfm_err_t pfm_get_event_mask_description( unsigned int event_idx, unsigned int mask_idx, char** desc );
185
186 extern pfm_err_t pfm_dispatch_events( pfmlib_input_param_t* p, void* model_in, pfmlib_output_param_t* q,
187 void* model_out );
188
189 extern pfm_err_t pfm_get_impl_pmcs( pfmlib_regmask_t* impl_pmcs );
190 extern pfm_err_t pfm_get_impl_pmds( pfmlib_regmask_t* impl_pmds );
191 extern pfm_err_t pfm_get_impl_counters( pfmlib_regmask_t* impl_counters );
192 extern pfm_err_t pfm_get_num_pmds( unsigned int* num );
193 extern pfm_err_t pfm_get_num_pmcs( unsigned int* num );
194 extern pfm_err_t pfm_get_num_counters( unsigned int* num );
195
196 extern pfm_err_t pfm_get_hw_counter_width( unsigned int* width );
197 extern pfm_err_t pfm_get_version( unsigned int* version );
198 extern char* pfm_strerror( int code );
199 extern pfm_err_t pfm_get_cycle_event( pfmlib_event_t* e );
200 extern pfm_err_t pfm_get_inst_retired_event( pfmlib_event_t* e );
201
202 /*
203 * Supported PMU family
204 */
205 #define PFMLIB_NO_PMU -1 /* PMU unused (forced) */
206 #define PFMLIB_UNKNOWN_PMU 0 /* type not yet known (dynamic) */
207 #define PFMLIB_GEN_IA64_PMU 1 /* Intel IA-64 architected PMU */
208 #define PFMLIB_ITANIUM_PMU 2 /* Intel Itanium */
209 #define PFMLIB_ITANIUM2_PMU 3 /* Intel Itanium 2 */
210 #define PFMLIB_MONTECITO_PMU 4 /* Intel Dual-Core Itanium 2 9000 */
211 #define PFMLIB_AMD64_PMU 16 /* AMD AMD64 (K7, K8, Fam 10h) */
212 #define PFMLIB_GEN_IA32_PMU 63 /* Intel architectural PMU for X86 */
213 #define PFMLIB_I386_P6_PMU 32 /* Intel PIII (P6 core) */
214 #define PFMLIB_PENTIUM4_PMU 33 /* Intel Pentium4/Xeon/EM64T */
215 #define PFMLIB_COREDUO_PMU 34 /* Intel Core Duo/Core Solo */
216 #define PFMLIB_I386_PM_PMU 35 /* Intel Pentium M */
217 #define PFMLIB_CORE_PMU 36 /* obsolete, use PFMLIB_INTEL_CORE_PMU */
218 #define PFMLIB_INTEL_CORE_PMU 36 /* Intel Core */
219 #define PFMLIB_INTEL_PPRO_PMU 37 /* Intel Pentium Pro */
220 #define PFMLIB_INTEL_PII_PMU 38 /* Intel Pentium II */
221 #define PFMLIB_INTEL_ATOM_PMU 39 /* Intel Atom */
222 #define PFMLIB_INTEL_NHM_PMU 40 /* Intel Nehalem */
223 #define PFMLIB_INTEL_WSM_PMU 41 /* Intel Westmere */
224
225 #define PFMLIB_MIPS_20KC_PMU 64 /* MIPS 20KC */
226 #define PFMLIB_MIPS_24K_PMU 65 /* MIPS 24K */
227 #define PFMLIB_MIPS_25KF_PMU 66 /* MIPS 25KF */
228 #define PFMLIB_MIPS_34K_PMU 67 /* MIPS 34K */
229 #define PFMLIB_MIPS_5KC_PMU 68 /* MIPS 5KC */
230 #define PFMLIB_MIPS_74K_PMU 69 /* MIPS 74K */
231 #define PFMLIB_MIPS_R10000_PMU 70 /* MIPS R10000 */
232 #define PFMLIB_MIPS_R12000_PMU 71 /* MIPS R12000 */
233 #define PFMLIB_MIPS_RM7000_PMU 72 /* MIPS RM7000 */
234 #define PFMLIB_MIPS_RM9000_PMU 73 /* MIPS RM9000 */
235 #define PFMLIB_MIPS_SB1_PMU 74 /* MIPS SB1/SB1A */
236 #define PFMLIB_MIPS_VR5432_PMU 75 /* MIPS VR5432 */
237 #define PFMLIB_MIPS_VR5500_PMU 76 /* MIPS VR5500 */
238 #define PFMLIB_MIPS_ICE9A_PMU 77 /* SiCortex ICE9A */
239 #define PFMLIB_MIPS_ICE9B_PMU 78 /* SiCortex ICE9B */
240
241 #define PFMLIB_POWERPC_PMU 90 /* POWERPC */
242
243 #define PFMLIB_CRAYX2_PMU 96 /* Cray X2 */
244
245 #define PFMLIB_CELL_PMU 100 /* CELL */
246
247 #define PFMLIB_PPC970_PMU 110 /* IBM PowerPC 970(FX,GX) */
248 #define PFMLIB_PPC970MP_PMU 111 /* IBM PowerPC 970MP */
249 #define PFMLIB_POWER3_PMU 112 /* IBM POWER3 */
250 #define PFMLIB_POWER4_PMU 113 /* IBM POWER4 */
251 #define PFMLIB_POWER5_PMU 114 /* IBM POWER5 */
252 #define PFMLIB_POWER5p_PMU 115 /* IBM POWER5+ */
253 #define PFMLIB_POWER6_PMU 116 /* IBM POWER6 */
254 #define PFMLIB_POWER7_PMU 117 /* IBM POWER7 */
255
256 #define PFMLIB_SPARC_ULTRA12_PMU 130 /* UltraSPARC I, II, IIi, and IIe */
257 #define PFMLIB_SPARC_ULTRA3_PMU 131 /* UltraSPARC III */
258 #define PFMLIB_SPARC_ULTRA3I_PMU 132 /* UltraSPARC IIIi and IIIi+ */
259 #define PFMLIB_SPARC_ULTRA3PLUS_PMU 133 /* UltraSPARC III+ and IV */
260 #define PFMLIB_SPARC_ULTRA4PLUS_PMU 134 /* UltraSPARC IV+ */
261 #define PFMLIB_SPARC_NIAGARA1_PMU 135 /* Niagara-1 */
262 #define PFMLIB_SPARC_NIAGARA2_PMU 136 /* Niagara-2 */
263
264 /*
265 * pfmlib error codes
266 */
267 #define PFMLIB_SUCCESS 0 /* success */
268 #define PFMLIB_ERR_NOTSUPP -1 /* function not supported */
269 #define PFMLIB_ERR_INVAL -2 /* invalid parameters */
270 #define PFMLIB_ERR_NOINIT -3 /* library was not initialized */
271 #define PFMLIB_ERR_NOTFOUND -4 /* event not found */
272 #define PFMLIB_ERR_NOASSIGN -5 /* cannot assign events to counters */
273 #define PFMLIB_ERR_FULL -6 /* buffer is full or too small */
274 #define PFMLIB_ERR_EVTMANY -7 /* event used more than once */
275 #define PFMLIB_ERR_MAGIC -8 /* invalid library magic number */
276 #define PFMLIB_ERR_FEATCOMB -9 /* invalid combination of features */
277 #define PFMLIB_ERR_EVTSET -10 /* incompatible event sets */
278 #define PFMLIB_ERR_EVTINCOMP -11 /* incompatible event combination */
279 #define PFMLIB_ERR_TOOMANY -12 /* too many events or unit masks */
280
281 #define PFMLIB_ERR_IRRTOOBIG -13 /* code range too big */
282 #define PFMLIB_ERR_IRREMPTY -14 /* empty code range */
283 #define PFMLIB_ERR_IRRINVAL -15 /* invalid code range */
284 #define PFMLIB_ERR_IRRTOOMANY -16 /* too many code ranges */
285 #define PFMLIB_ERR_DRRINVAL -17 /* invalid data range */
286 #define PFMLIB_ERR_DRRTOOMANY -18 /* too many data ranges */
287 #define PFMLIB_ERR_BADHOST -19 /* not supported by host CPU */
288 #define PFMLIB_ERR_IRRALIGN -20 /* bad alignment for code range */
289 #define PFMLIB_ERR_IRRFLAGS -21 /* code range missing flags */
290 #define PFMLIB_ERR_UMASK -22 /* invalid or missing unit mask */
291 #define PFMLIB_ERR_NOMEM -23 /* out of memory */
292
293 #define __PFMLIB_REGMASK_EL( g ) ( ( g ) / __PFMLIB_REG_BV_BITS )
294 #define __PFMLIB_REGMASK_MASK( g ) ( ( (pfmlib_regmask_bits_t)1 ) << ( ( g ) % __PFMLIB_REG_BV_BITS ) )
295
296 static inline int pfm_regmask_isset( pfmlib_regmask_t* h, unsigned int b )
297 {
298 if ( b >= PFMLIB_REG_MAX ) return 0;
299 return ( h->bits[__PFMLIB_REGMASK_EL( b )] & __PFMLIB_REGMASK_MASK( b ) ) != 0;
300 }
301
302 static inline int pfm_regmask_set( pfmlib_regmask_t* h, unsigned int b )
303 {
304 if ( b >= PFMLIB_REG_MAX ) return PFMLIB_ERR_INVAL;
305
306 h->bits[__PFMLIB_REGMASK_EL( b )] |= __PFMLIB_REGMASK_MASK( b );
307
308 return PFMLIB_SUCCESS;
309 }
310
311 static inline int pfm_regmask_clr( pfmlib_regmask_t* h, unsigned int b )
312 {
313 if ( h == NULL || b >= PFMLIB_REG_MAX ) return PFMLIB_ERR_INVAL;
314
315 h->bits[__PFMLIB_REGMASK_EL( b )] &= ~__PFMLIB_REGMASK_MASK( b );
316
317 return PFMLIB_SUCCESS;
318 }
319
320 static inline int pfm_regmask_weight( pfmlib_regmask_t* h, unsigned int* w )
321 {
322 unsigned int pos;
323 unsigned int weight = 0;
324
325 if ( h == NULL || w == NULL ) return PFMLIB_ERR_INVAL;
326
327 for ( pos = 0; pos < PFMLIB_REG_BV; pos++ ) {
328 weight += (unsigned int)pfmlib_popcnt( h->bits[pos] );
329 }
330 *w = weight;
331 return PFMLIB_SUCCESS;
332 }
333
334 static inline int pfm_regmask_eq( pfmlib_regmask_t* h1, pfmlib_regmask_t* h2 )
335 {
336 unsigned int pos;
337
338 if ( h1 == NULL || h2 == NULL ) return 0;
339
340 for ( pos = 0; pos < PFMLIB_REG_BV; pos++ ) {
341 if ( h1->bits[pos] != h2->bits[pos] ) return 0;
342 }
343 return 1;
344 }
345
346 static inline int pfm_regmask_and( pfmlib_regmask_t* dst, pfmlib_regmask_t* h1, pfmlib_regmask_t* h2 )
347 {
348 unsigned int pos;
349 if ( dst == NULL || h1 == NULL || h2 == NULL ) return PFMLIB_ERR_INVAL;
350
351 for ( pos = 0; pos < PFMLIB_REG_BV; pos++ ) {
352 dst->bits[pos] = h1->bits[pos] & h2->bits[pos];
353 }
354 return PFMLIB_SUCCESS;
355 }
356
357 static inline int pfm_regmask_andnot( pfmlib_regmask_t* dst, pfmlib_regmask_t* h1, pfmlib_regmask_t* h2 )
358 {
359 unsigned int pos;
360 if ( dst == NULL || h1 == NULL || h2 == NULL ) return PFMLIB_ERR_INVAL;
361
362 for ( pos = 0; pos < PFMLIB_REG_BV; pos++ ) {
363 dst->bits[pos] = h1->bits[pos] & ~h2->bits[pos];
364 }
365 return PFMLIB_SUCCESS;
366 }
367
368 static inline int pfm_regmask_or( pfmlib_regmask_t* dst, pfmlib_regmask_t* h1, pfmlib_regmask_t* h2 )
369 {
370 unsigned int pos;
371 if ( dst == NULL || h1 == NULL || h2 == NULL ) return PFMLIB_ERR_INVAL;
372
373 for ( pos = 0; pos < PFMLIB_REG_BV; pos++ ) {
374 dst->bits[pos] = h1->bits[pos] | h2->bits[pos];
375 }
376 return PFMLIB_SUCCESS;
377 }
378
379 static inline int pfm_regmask_copy( pfmlib_regmask_t* dst, pfmlib_regmask_t* src )
380 {
381 unsigned int pos;
382 if ( dst == NULL || src == NULL ) return PFMLIB_ERR_INVAL;
383
384 for ( pos = 0; pos < PFMLIB_REG_BV; pos++ ) {
385 dst->bits[pos] = src->bits[pos];
386 }
387 return PFMLIB_SUCCESS;
388 }
389 static inline int pfm_regmask_not( pfmlib_regmask_t* dst )
390 {
391 unsigned int pos;
392 if ( dst == NULL ) return PFMLIB_ERR_INVAL;
393
394 for ( pos = 0; pos < PFMLIB_REG_BV; pos++ ) {
395 dst->bits[pos] = ~dst->bits[pos];
396 }
397 return PFMLIB_SUCCESS;
398 }
399
400 #ifdef __cplusplus /* extern C */
401 }
402 #endif
403
404 #endif /* __PFMLIB_H__ */
pfmlib_event_t
Definition: pfmlib.h:84
pfm_err_t
int pfm_err_t
Definition: pfmlib.h:150
pfm_get_cycle_event
pfm_err_t pfm_get_cycle_event(pfmlib_event_t *e)
pfmlib_event_t::plm
unsigned int plm
Definition: pfmlib.h:86
pfm_get_pmu_type
pfm_err_t pfm_get_pmu_type(int *type)
pfmlib_event_t::event
unsigned int event
Definition: pfmlib.h:85
pfmlib_input_param_t::reserved1
unsigned int reserved1
Definition: pfmlib.h:111
pfm_strerror
char * pfm_strerror(int code)
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
pfm_get_event_mask_code
pfm_err_t pfm_get_event_mask_code(unsigned int idx, unsigned int mask_idx, unsigned int *code)
pfmlib_reg_t::reg_alt_addr
unsigned long reg_alt_addr
Definition: pfmlib.h:101
pfmlib_reg_t
Definition: pfmlib.h:96
pfm_get_hw_counter_width
pfm_err_t pfm_get_hw_counter_width(unsigned int *width)
pfm_get_event_mask_description
pfm_err_t pfm_get_event_mask_description(unsigned int event_idx, unsigned int mask_idx, char **desc)
pfmlib_regmask_t
Definition: pfmlib.h:75
PFMLIB_MAX_MASKS_PER_EVENT
#define PFMLIB_MAX_MASKS_PER_EVENT
Definition: pfmlib.h:79
__PFMLIB_REGMASK_EL
#define __PFMLIB_REGMASK_EL(g)
Definition: pfmlib.h:293
PFMLIB_SUCCESS
#define PFMLIB_SUCCESS
Definition: pfmlib.h:267
PFMLIB_REG_MAX
#define PFMLIB_REG_MAX
Definition: pfmlib.h:66
pfmlib_input_param_t::pfp_dfl_plm
unsigned int pfp_dfl_plm
Definition: pfmlib.h:109
pfm_get_num_counters
pfm_err_t pfm_get_num_counters(unsigned int *num)
pfmlib_input_param_t
Definition: pfmlib.h:107
pfmlib_regmask_t::bits
pfmlib_regmask_bits_t bits[PFMLIB_REG_BV]
Definition: pfmlib.h:76
PFMLIB_MAX_PMDS
#define PFMLIB_MAX_PMDS
Definition: pfmlib.h:42
pfmlib_options_t
Definition: pfmlib.h:136
pfm_get_num_event_masks
pfm_err_t pfm_get_num_event_masks(unsigned int event_idx, unsigned int *count)
pfm_dispatch_events
pfm_err_t pfm_dispatch_events(pfmlib_input_param_t *p, void *model_in, pfmlib_output_param_t *q, void *model_out)
pfmlib_regmask_bits_t
unsigned long pfmlib_regmask_bits_t
Definition: pfmlib.h:58
pfmlib_output_param_t::pfp_pmc_count
unsigned int pfp_pmc_count
Definition: pfmlib.h:126
pfmlib_reg_t::reg_value
unsigned long long reg_value
Definition: pfmlib.h:97
pfm_get_max_event_name_len
pfm_err_t pfm_get_max_event_name_len(size_t *len)
pfmlib_output_param_t::pfp_pmd_count
unsigned int pfp_pmd_count
Definition: pfmlib.h:127
pfmlib_reg_t::reg_addr
unsigned long long reg_addr
Definition: pfmlib.h:98
pfm_find_event_mask
pfm_err_t pfm_find_event_mask(unsigned int event_idx, const char *str, unsigned int *mask_idx)
pfm_find_full_event
pfm_err_t pfm_find_full_event(const char *str, pfmlib_event_t *e)
pfm_get_num_pmds
pfm_err_t pfm_get_num_pmds(unsigned int *num)
pfm_list_supported_pmus
pfm_err_t pfm_list_supported_pmus(int(*pf)(const char *fmt,...))
pfm_find_event_byname
pfm_err_t pfm_find_event_byname(const char *name, unsigned int *idx)
pfm_get_event_description
pfm_err_t pfm_get_event_description(unsigned int idx, char **str)
pfm_get_event_code_counter
pfm_err_t pfm_get_event_code_counter(unsigned int idx, unsigned int cnt, int *code)
pfmlib_reg_t::reg_num
unsigned int reg_num
Definition: pfmlib.h:99
gaudirun.type
type
Definition: gaudirun.py:133
PFMLIB_MAX_PMCS
#define PFMLIB_MAX_PMCS
Definition: pfmlib.h:41
pfmlib_input_param_t::pfp_unavail_pmcs
pfmlib_regmask_t pfp_unavail_pmcs
Definition: pfmlib.h:113
pfm_get_event_name
pfm_err_t pfm_get_event_name(unsigned int idx, char *name, size_t maxlen)
pfmlib_reg_t::reg_reserved1
unsigned int reg_reserved1
Definition: pfmlib.h:100
IOTest.start
start
Definition: IOTest.py:99
pfm_is_pmu_supported
pfm_err_t pfm_is_pmu_supported(int type)
pfmlib_output_param_t
Definition: pfmlib.h:125
pfmlib_comp.h
pfm_initialize
pfm_err_t pfm_initialize(void)
pfm_find_event
pfm_err_t pfm_find_event(const char *str, unsigned int *idx)
pfmlib_event_t::flags
unsigned long flags
Definition: pfmlib.h:87
PFMLIB_REG_BV
#define PFMLIB_REG_BV
Definition: pfmlib.h:72
pfm_get_impl_pmcs
pfm_err_t pfm_get_impl_pmcs(pfmlib_regmask_t *impl_pmcs)
__PFMLIB_REGMASK_MASK
#define __PFMLIB_REGMASK_MASK(g)
Definition: pfmlib.h:294
pfm_get_event_counters
pfm_err_t pfm_get_event_counters(unsigned int idx, pfmlib_regmask_t *counters)
ReadAndWriteWhiteBoard.dst
dst
Definition: ReadAndWriteWhiteBoard.py:17
pfm_get_event_mask_name
pfm_err_t pfm_get_event_mask_name(unsigned int event_idx, unsigned int mask_idx, char *name, size_t maxlen)
pfm_get_inst_retired_event
pfm_err_t pfm_get_inst_retired_event(pfmlib_event_t *e)
PFMLIB_ERR_INVAL
#define PFMLIB_ERR_INVAL
Definition: pfmlib.h:269
pfm_find_event_bycode_next
pfm_err_t pfm_find_event_bycode_next(int code, unsigned int start, unsigned int *next)
pfm_get_num_pmcs
pfm_err_t pfm_get_num_pmcs(unsigned int *num)
pfm_get_event_code
pfm_err_t pfm_get_event_code(unsigned int idx, int *code)
pfmlib_event_t::num_masks
unsigned int num_masks
Definition: pfmlib.h:89
pfm_get_pmu_name
pfm_err_t pfm_get_pmu_name(char *name, int maxlen)
pfm_get_pmu_name_bytype
pfm_err_t pfm_get_pmu_name_bytype(int type, char *name, size_t maxlen)
pfm_get_full_event_name
pfm_err_t pfm_get_full_event_name(pfmlib_event_t *e, char *name, size_t maxlen)
pfm_get_version
pfm_err_t pfm_get_version(unsigned int *version)
pfmlib_input_param_t::pfp_flags
unsigned int pfp_flags
Definition: pfmlib.h:110
pfm_force_pmu
pfm_err_t pfm_force_pmu(int type)
pfm_get_impl_counters
pfm_err_t pfm_get_impl_counters(pfmlib_regmask_t *impl_counters)
pfm_get_impl_pmds
pfm_err_t pfm_get_impl_pmds(pfmlib_regmask_t *impl_pmds)
pfm_get_num_events
pfm_err_t pfm_get_num_events(unsigned int *count)
pfmlib_input_param_t::pfp_event_count
unsigned int pfp_event_count
Definition: pfmlib.h:108
pfmlib_os.h
pfm_set_options
pfm_err_t pfm_set_options(pfmlib_options_t *opt)
pfm_find_event_bycode
pfm_err_t pfm_find_event_bycode(int code, unsigned int *idx)