PAPI
7.1.0.0
Loading...
Searching...
No Matches
pfmlib_montecito_priv.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005-2006 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
* This file is part of libpfm, a performance monitoring support library for
23
* applications on Linux.
24
*/
25
#ifndef __PFMLIB_MONTECITO_PRIV_H__
26
#define __PFMLIB_MONTECITO_PRIV_H__
27
28
/*
29
* Event type definitions
30
*
31
* The virtual events are not really defined in the specs but are an artifact used
32
* to quickly and easily setup EAR and/or BTB. The event type encodes the exact feature
33
* which must be configured in combination with a counting monitor.
34
* For instance, DATA_EAR_CACHE_LAT4 is a virtual D-EAR cache event. If the user
35
* requests this event, this will configure a counting monitor to count DATA_EAR_EVENTS
36
* and PMC11 will be configured for cache mode. The latency is encoded in the umask, here
37
* it would correspond to 4 cycles.
38
*
39
*/
40
#define PFMLIB_MONT_EVENT_NORMAL 0x0
/* standard counter */
41
#define PFMLIB_MONT_EVENT_ETB 0x1
/* virtual event used with ETB configuration */
42
#define PFMLIB_MONT_EVENT_IEAR_TLB 0x2
/* virtual event used for I-EAR TLB configuration */
43
#define PFMLIB_MONT_EVENT_IEAR_CACHE 0x3
/* virtual event used for I-EAR cache configuration */
44
#define PFMLIB_MONT_EVENT_DEAR_TLB 0x4
/* virtual event used for D-EAR TLB configuration */
45
#define PFMLIB_MONT_EVENT_DEAR_CACHE 0x5
/* virtual event used for D-EAR cache configuration */
46
#define PFMLIB_MONT_EVENT_DEAR_ALAT 0x6
/* virtual event used for D-EAR ALAT configuration */
47
48
#define event_is_ear(e) ((e)->pme_type >= PFMLIB_MONT_EVENT_IEAR_TLB &&(e)->pme_type <= PFMLIB_MONT_EVENT_DEAR_ALAT)
49
#define event_is_iear(e) ((e)->pme_type == PFMLIB_MONT_EVENT_IEAR_TLB || (e)->pme_type == PFMLIB_MONT_EVENT_IEAR_CACHE)
50
#define event_is_dear(e) ((e)->pme_type >= PFMLIB_MONT_EVENT_DEAR_TLB && (e)->pme_type <= PFMLIB_MONT_EVENT_DEAR_ALAT)
51
#define event_is_ear_cache(e) ((e)->pme_type == PFMLIB_MONT_EVENT_DEAR_CACHE || (e)->pme_type == PFMLIB_MONT_EVENT_IEAR_CACHE)
52
#define event_is_ear_tlb(e) ((e)->pme_type == PFMLIB_MONT_EVENT_IEAR_TLB || (e)->pme_type == PFMLIB_MONT_EVENT_DEAR_TLB)
53
#define event_is_ear_alat(e) ((e)->pme_type == PFMLIB_MONT_EVENT_DEAR_ALAT)
54
#define event_is_etb(e) ((e)->pme_type == PFMLIB_MONT_EVENT_ETB)
55
56
/*
57
* Itanium encoding structure
58
* (code must be first 8 bits)
59
*/
60
typedef
struct
{
61
unsigned
long
pme_code
:8;
/* major event code */
62
unsigned
long
pme_type
:3;
/* see definitions above */
63
unsigned
long
pme_caf
:2;
/* Active, Floating, Causal, Self-Floating */
64
unsigned
long
pme_ig1
:3;
/* ignored */
65
unsigned
long
pme_umask
:16;
/* unit mask*/
66
unsigned
long
pme_ig
:32;
/* ignored */
67
}
pme_mont_entry_code_t
;
68
69
typedef
union
{
70
unsigned
long
pme_vcode
;
71
pme_mont_entry_code_t
pme_mont_code
;
/* must not be larger than vcode */
72
}
pme_mont_code_t
;
73
74
typedef
union
{
75
unsigned
long
qual
;
/* generic qualifier */
76
struct
{
77
unsigned
long
pme_iar
:1;
/* instruction address range supported */
78
unsigned
long
pme_opm
:1;
/* opcode match supported */
79
unsigned
long
pme_dar
:1;
/* data address range supported */
80
unsigned
long
pme_all
:1;
/* supports all_thrd=1 */
81
unsigned
long
pme_mesi
:1;
/* event supports MESI */
82
unsigned
long
pme_res1
:11;
/* reserved */
83
unsigned
long
pme_group
:3;
/* event group */
84
unsigned
long
pme_set
:4;
/* event set*/
85
unsigned
long
pme_res2
:41;
/* reserved */
86
} pme_qual;
87
}
pme_mont_qualifiers_t
;
88
89
typedef
struct
{
90
char
*
pme_name
;
91
pme_mont_code_t
pme_entry_code
;
92
unsigned
long
pme_counters
;
/* supported counters */
93
unsigned
int
pme_maxincr
;
94
pme_mont_qualifiers_t
pme_qualifiers
;
95
char
*
pme_desc
;
/* text description of the event */
96
}
pme_mont_entry_t
;
97
98
99
/*
100
* We embed the umask value into the event code. Because it really is
101
* like a subevent.
102
* pme_code:
103
* - lower 16 bits: major event code
104
* - upper 16 bits: unit mask
105
*/
106
#define pme_code pme_entry_code.pme_mont_code.pme_code
107
#define pme_umask pme_entry_code.pme_mont_code.pme_umask
108
#define pme_used pme_qualifiers.pme_qual_struct.pme_used
109
#define pme_type pme_entry_code.pme_mont_code.pme_type
110
#define pme_caf pme_entry_code.pme_mont_code.pme_caf
111
112
#define event_opcm_ok(e) ((e)->pme_qualifiers.pme_qual.pme_opm==1)
113
#define event_iarr_ok(e) ((e)->pme_qualifiers.pme_qual.pme_iar==1)
114
#define event_darr_ok(e) ((e)->pme_qualifiers.pme_qual.pme_dar==1)
115
#define event_all_ok(e) ((e)->pme_qualifiers.pme_qual.pme_all==1)
116
#define event_mesi_ok(e) ((e)->pme_qualifiers.pme_qual.pme_mesi==1)
117
118
#endif
/* __PFMLIB_MONTECITO_PRIV_H__ */
pme_mont_entry_code_t
Definition:
pfmlib_montecito_priv.h:60
pme_mont_entry_code_t::pme_ig1
unsigned long pme_ig1
Definition:
pfmlib_montecito_priv.h:64
pme_mont_entry_code_t::pme_umask
unsigned long pme_umask
Definition:
pfmlib_montecito_priv.h:65
pme_mont_entry_code_t::pme_code
unsigned long pme_code
Definition:
pfmlib_montecito_priv.h:61
pme_mont_entry_code_t::pme_type
unsigned long pme_type
Definition:
pfmlib_montecito_priv.h:62
pme_mont_entry_code_t::pme_ig
unsigned long pme_ig
Definition:
pfmlib_montecito_priv.h:66
pme_mont_entry_code_t::pme_caf
unsigned long pme_caf
Definition:
pfmlib_montecito_priv.h:63
pme_mont_entry_t
Definition:
pfmlib_montecito_priv.h:89
pme_mont_entry_t::pme_entry_code
pme_mont_code_t pme_entry_code
Definition:
pfmlib_montecito_priv.h:91
pme_mont_entry_t::pme_counters
unsigned long pme_counters
Definition:
pfmlib_montecito_priv.h:92
pme_mont_entry_t::pme_maxincr
unsigned int pme_maxincr
Definition:
pfmlib_montecito_priv.h:93
pme_mont_entry_t::pme_name
char * pme_name
Definition:
pfmlib_montecito_priv.h:90
pme_mont_entry_t::pme_desc
char * pme_desc
Definition:
pfmlib_montecito_priv.h:95
pme_mont_entry_t::pme_qualifiers
pme_mont_qualifiers_t pme_qualifiers
Definition:
pfmlib_montecito_priv.h:94
pme_mont_code_t
Definition:
pfmlib_montecito_priv.h:69
pme_mont_code_t::pme_mont_code
pme_mont_entry_code_t pme_mont_code
Definition:
pfmlib_montecito_priv.h:71
pme_mont_code_t::pme_vcode
unsigned long pme_vcode
Definition:
pfmlib_montecito_priv.h:70
pme_mont_qualifiers_t
Definition:
pfmlib_montecito_priv.h:74
pme_mont_qualifiers_t::pme_opm
unsigned long pme_opm
Definition:
pfmlib_montecito_priv.h:78
pme_mont_qualifiers_t::pme_iar
unsigned long pme_iar
Definition:
pfmlib_montecito_priv.h:77
pme_mont_qualifiers_t::qual
unsigned long qual
Definition:
pfmlib_montecito_priv.h:75
pme_mont_qualifiers_t::pme_set
unsigned long pme_set
Definition:
pfmlib_montecito_priv.h:84
pme_mont_qualifiers_t::pme_all
unsigned long pme_all
Definition:
pfmlib_montecito_priv.h:80
pme_mont_qualifiers_t::pme_mesi
unsigned long pme_mesi
Definition:
pfmlib_montecito_priv.h:81
pme_mont_qualifiers_t::pme_dar
unsigned long pme_dar
Definition:
pfmlib_montecito_priv.h:79
pme_mont_qualifiers_t::pme_group
unsigned long pme_group
Definition:
pfmlib_montecito_priv.h:83
pme_mont_qualifiers_t::pme_res1
unsigned long pme_res1
Definition:
pfmlib_montecito_priv.h:82
pme_mont_qualifiers_t::pme_res2
unsigned long pme_res2
Definition:
pfmlib_montecito_priv.h:85
src
libperfnec
lib
pfmlib_montecito_priv.h
Generated on Wed Dec 20 2023 18:12:52 for PAPI by
1.9.6