34 #ifndef PERFMON_TYPES_H 35 #define PERFMON_TYPES_H 40 #include <perfgroup.h> 42 #define MAX_EVENT_OPTIONS NUM_EVENT_OPTIONS 82 #ifdef LIKWID_USE_PERFEVENT 83 EVENT_OPTION_PERF_PID,
84 EVENT_OPTION_PERF_FLAGS,
106 #define EVENT_OPTION_NONE_MASK 0x0ULL 108 #define OPTIONS_TYPE_MASK(type) \ 109 (((type == EVENT_OPTION_NONE)||(type >= NUM_EVENT_OPTIONS)) ? \ 110 EVENT_OPTION_NONE_MASK : \ 115 #define EVENT_OPTION_OPCODE_MASK (1ULL<<EVENT_OPTION_OPCODE) 116 #define EVENT_OPTION_MATCH0_MASK (1ULL<<EVENT_OPTION_MATCH0) 117 #define EVENT_OPTION_MATCH1_MASK (1ULL<<EVENT_OPTION_MATCH1) 118 #define EVENT_OPTION_MATCH2_MASK (1ULL<<EVENT_OPTION_MATCH2) 119 #define EVENT_OPTION_MATCH3_MASK (1ULL<<EVENT_OPTION_MATCH3) 120 #define EVENT_OPTION_MASK0_MASK (1ULL<<EVENT_OPTION_MASK0) 121 #define EVENT_OPTION_MASK1_MASK (1ULL<<EVENT_OPTION_MASK1) 122 #define EVENT_OPTION_MASK2_MASK (1ULL<<EVENT_OPTION_MASK2) 123 #define EVENT_OPTION_MASK3_MASK (1ULL<<EVENT_OPTION_MASK3) 124 #define EVENT_OPTION_NID_MASK (1ULL<<EVENT_OPTION_NID) 125 #define EVENT_OPTION_TID_MASK (1ULL<<EVENT_OPTION_TID) 126 #define EVENT_OPTION_STATE_MASK (1ULL<<EVENT_OPTION_STATE) 127 #define EVENT_OPTION_EDGE_MASK (1ULL<<EVENT_OPTION_EDGE) 128 #define EVENT_OPTION_THRESHOLD_MASK (1ULL<<EVENT_OPTION_THRESHOLD) 129 #define EVENT_OPTION_INVERT_MASK (1ULL<<EVENT_OPTION_INVERT) 130 #define EVENT_OPTION_COUNT_KERNEL_MASK (1ULL<<EVENT_OPTION_COUNT_KERNEL) 131 #define EVENT_OPTION_ANYTHREAD_MASK (1ULL<<EVENT_OPTION_ANYTHREAD) 132 #define EVENT_OPTION_OCCUPANCY_MASK (1ULL<<EVENT_OPTION_OCCUPANCY) 133 #define EVENT_OPTION_OCCUPANCY_FILTER_MASK (1ULL<<EVENT_OPTION_OCCUPANCY_FILTER) 134 #define EVENT_OPTION_OCCUPANCY_EDGE_MASK (1ULL<<EVENT_OPTION_OCCUPANCY_EDGE) 135 #define EVENT_OPTION_OCCUPANCY_INVERT_MASK (1ULL<<EVENT_OPTION_OCCUPANCY_INVERT) 136 #define EVENT_OPTION_IN_TRANS_MASK (1ULL<<EVENT_OPTION_IN_TRANS) 137 #define EVENT_OPTION_IN_TRANS_ABORT_MASK (1ULL<<EVENT_OPTION_IN_TRANS_ABORT) 259 extern int perfmon_numCounters;
260 extern int perfmon_numCoreCounters;
261 extern int perfmon_numUncoreCounters;
262 extern int perfmon_numArchEvents;
Set Thread ID.
Definition: perfmon_types.h:69
Not configured, not started and not stopped.
Definition: perfmon_types.h:94
double rdtscTime
Evaluation of the Time information in seconds.
Definition: perfmon_types.h:219
Mask1 register.
Definition: perfmon_types.h:65
RegisterIndex index
Index of the counter register in the counter map.
Definition: perfmon_types.h:205
Invert filter for occupancy counting.
Definition: perfmon_types.h:79
Count events that aborted during transactions.
Definition: perfmon_types.h:81
uint64_t regTypeMask1
Bitmask1 for easy checks which types are included in the eventSet.
Definition: perfmon_types.h:221
int numberOfEvents
Number of eventSets in events.
Definition: perfmon_types.h:216
EventOptionType type
Type of the option.
Definition: perfmon_types.h:158
uint64_t optionMask
Bitmask for fast check of set options.
Definition: perfmon_types.h:177
Count events during transactions.
Definition: perfmon_types.h:80
PerfmonEvent * eventHash
List of events available for the current architecture.
int activeGroup
Currently active eventSet.
Definition: perfmon_types.h:238
const char * name
Name of the event.
Definition: perfmon_types.h:170
Match3 register.
Definition: perfmon_types.h:63
double fullResult
Aggregated measurement result.
Definition: perfmon_types.h:194
Match1 register.
Definition: perfmon_types.h:61
Increment counter at events of all HW threads in the core.
Definition: perfmon_types.h:75
Struct defining the start and stop time of a time interval.
Definition: likwid.h:1034
uint8_t numberOfOptions
Number of options for the event.
Definition: perfmon_types.h:176
PerfmonEventSetEntry * events
List of eventSets.
Definition: perfmon_types.h:217
uint64_t startData
Start data from the counter.
Definition: perfmon_types.h:191
int id
Offset in higher level control register, e.g. position of enable bit.
Definition: perfmon_types.h:189
uint8_t cfgBits
Misc configuration bits.
Definition: perfmon_types.h:174
Structure specifying event/counter options and their value.
Definition: perfmon_types.h:157
Increment occupancy counter at detection of an edge.
Definition: perfmon_types.h:78
uint64_t regTypeMask3
Bitmask3 for easy checks which types are included in the eventSet.
Definition: perfmon_types.h:223
TimerData timer
Time information how long the counters were running.
Definition: perfmon_types.h:218
int init
Flag if corresponding control register is set up properly.
Definition: perfmon_types.h:188
PerfmonEvent event
Event configuration.
Definition: perfmon_types.h:204
Also count events when in kernel space.
Definition: perfmon_types.h:74
Structure specifying an performance monitoring event.
Definition: perfmon_types.h:203
char * eventOptionTypeName[NUM_EVENT_OPTIONS]
List of option names.
double runTime
Sum of all time information in seconds that the group was running.
Definition: perfmon_types.h:220
EventOptionType
Enum of possible event and counter options.
Definition: perfmon_types.h:57
int processorId
Real HW thread ID.
Definition: perfmon_types.h:148
PerfmonThread * threads
List of threads.
Definition: perfmon_types.h:241
uint64_t counterData
Intermediate data from the counters.
Definition: perfmon_types.h:192
double lastResult
Last measurement result.
Definition: perfmon_types.h:193
GroupInfo group
Structure holding the performance group information.
Definition: perfmon_types.h:226
Match opcode.
Definition: perfmon_types.h:59
int numberOfThreads
Amount of threads in threads.
Definition: perfmon_types.h:240
int thread_id
Thread ID how it is used internally.
Definition: perfmon_types.h:147
uint64_t cmask
Misc mask bits.
Definition: perfmon_types.h:175
No option, used as False value.
Definition: perfmon_types.h:58
Match for state.
Definition: perfmon_types.h:70
Structure specifying thread to CPU relation.
Definition: perfmon_types.h:146
Mask3 register.
Definition: perfmon_types.h:67
The event set hold by group is configured.
Definition: perfmon_types.h:95
Match0 register.
Definition: perfmon_types.h:60
const char * limit
Valid counters for the event.
Definition: perfmon_types.h:171
Mask0 register.
Definition: perfmon_types.h:64
Amount of defined options.
Definition: perfmon_types.h:86
Increment only if exceeding threshold.
Definition: perfmon_types.h:72
uint16_t eventId
ID of the event.
Definition: perfmon_types.h:172
Set NUMA node ID.
Definition: perfmon_types.h:68
PerfmonCounter * threadCounter
List of counter data for each thread, list length is numberOfThreads in PerfmonGroupSet.
Definition: perfmon_types.h:207
Structure specifying all performance monitoring event groups.
Definition: perfmon_types.h:235
Structure specifying an performance monitoring event group.
Definition: perfmon_types.h:215
int numberOfActiveGroups
Amount of added eventSets. Only those eventSets can be accessed in groups.
Definition: perfmon_types.h:237
RegisterType type
Type of the counter register and event.
Definition: perfmon_types.h:206
Invert behavior of EVENT_OPTION_THRESHOLD, hence increment only below threshold.
Definition: perfmon_types.h:73
int overflows
Amount of overflows.
Definition: perfmon_types.h:190
BoxMap * box_map
List of boxes with name, config register, counter registers and if needed PCI device. Mainly used in Uncore handling but also core-local counters are defined as a box.
uint64_t regTypeMask2
Bitmask2 for easy checks which types are included in the eventSet.
Definition: perfmon_types.h:222
uint64_t value
Value of the option.
Definition: perfmon_types.h:159
Increment counter at each edge.
Definition: perfmon_types.h:71
Structure specifying an performance monitoring event.
Definition: perfmon_types.h:169
RegisterMap * counter_map
List of counter with name, config register, counter registers and if needed PCI device.
Match2 register.
Definition: perfmon_types.h:62
PerfmonEventSet * groups
List of eventSets.
Definition: perfmon_types.h:239
uint64_t regTypeMask4
Bitmask4 for easy checks which types are included in the eventSet.
Definition: perfmon_types.h:224
GroupState
Enum of possible states of an event group.
Definition: perfmon_types.h:93
PciDevice * pci_devices
List of PCI devices available for the current architecture.
int numberOfGroups
List length of groups.
Definition: perfmon_types.h:236
Structure describing performance monitoring counter data.
Definition: perfmon_types.h:187
Mask2 register.
Definition: perfmon_types.h:66
uint8_t umask
Most events need to specify a mask to limit counting.
Definition: perfmon_types.h:173
GroupState state
Current state of the event group (configured, started, none)
Definition: perfmon_types.h:225
Filter for occupancy counting.
Definition: perfmon_types.h:77
Count occupancy not occurrences.
Definition: perfmon_types.h:76
The event set hold by group is current running.
Definition: perfmon_types.h:96