34 #ifndef PERFMON_TYPES_H 35 #define PERFMON_TYPES_H 40 #include <perfgroup.h> 42 #define MAX_EVENT_OPTIONS NUM_EVENT_OPTIONS 102 #define EVENT_OPTION_NONE_MASK 0x0ULL 104 #define OPTIONS_TYPE_MASK(type) \ 105 (((type == EVENT_OPTION_NONE)||(type >= NUM_EVENT_OPTIONS)) ? \ 106 EVENT_OPTION_NONE_MASK : \ 111 #define EVENT_OPTION_OPCODE_MASK (1ULL<<EVENT_OPTION_OPCODE) 112 #define EVENT_OPTION_MATCH0_MASK (1ULL<<EVENT_OPTION_MATCH0) 113 #define EVENT_OPTION_MATCH1_MASK (1ULL<<EVENT_OPTION_MATCH1) 114 #define EVENT_OPTION_MATCH2_MASK (1ULL<<EVENT_OPTION_MATCH2) 115 #define EVENT_OPTION_MATCH3_MASK (1ULL<<EVENT_OPTION_MATCH3) 116 #define EVENT_OPTION_MASK0_MASK (1ULL<<EVENT_OPTION_MASK0) 117 #define EVENT_OPTION_MASK1_MASK (1ULL<<EVENT_OPTION_MASK1) 118 #define EVENT_OPTION_MASK2_MASK (1ULL<<EVENT_OPTION_MASK2) 119 #define EVENT_OPTION_MASK3_MASK (1ULL<<EVENT_OPTION_MASK3) 120 #define EVENT_OPTION_NID_MASK (1ULL<<EVENT_OPTION_NID) 121 #define EVENT_OPTION_TID_MASK (1ULL<<EVENT_OPTION_TID) 122 #define EVENT_OPTION_STATE_MASK (1ULL<<EVENT_OPTION_STATE) 123 #define EVENT_OPTION_EDGE_MASK (1ULL<<EVENT_OPTION_EDGE) 124 #define EVENT_OPTION_THRESHOLD_MASK (1ULL<<EVENT_OPTION_THRESHOLD) 125 #define EVENT_OPTION_INVERT_MASK (1ULL<<EVENT_OPTION_INVERT) 126 #define EVENT_OPTION_COUNT_KERNEL_MASK (1ULL<<EVENT_OPTION_COUNT_KERNEL) 127 #define EVENT_OPTION_ANYTHREAD_MASK (1ULL<<EVENT_OPTION_ANYTHREAD) 128 #define EVENT_OPTION_OCCUPANCY_MASK (1ULL<<EVENT_OPTION_OCCUPANCY) 129 #define EVENT_OPTION_OCCUPANCY_FILTER_MASK (1ULL<<EVENT_OPTION_OCCUPANCY_FILTER) 130 #define EVENT_OPTION_OCCUPANCY_EDGE_MASK (1ULL<<EVENT_OPTION_OCCUPANCY_EDGE) 131 #define EVENT_OPTION_OCCUPANCY_INVERT_MASK (1ULL<<EVENT_OPTION_OCCUPANCY_INVERT) 132 #define EVENT_OPTION_IN_TRANS_MASK (1ULL<<EVENT_OPTION_IN_TRANS) 133 #define EVENT_OPTION_IN_TRANS_ABORT_MASK (1ULL<<EVENT_OPTION_IN_TRANS_ABORT) 218 __uint128_t regTypeMask;
256 extern int perfmon_numCounters;
257 extern int perfmon_numCoreCounters;
258 extern int perfmon_numUncoreCounters;
259 extern int perfmon_numArchEvents;
Set Thread ID.
Definition: perfmon_types.h:69
Not configured, not started and not stopped.
Definition: perfmon_types.h:90
double rdtscTime
Evaluation of the Time information in seconds.
Definition: perfmon_types.h:215
Mask1 register.
Definition: perfmon_types.h:65
RegisterIndex index
Index of the counter register in the counter map.
Definition: perfmon_types.h:201
Invert filter for occupancy counting.
Definition: perfmon_types.h:79
Count events that aborted during transactions.
Definition: perfmon_types.h:81
int numberOfEvents
Number of eventSets in events.
Definition: perfmon_types.h:212
EventOptionType type
Type of the option.
Definition: perfmon_types.h:154
uint64_t optionMask
Bitmask for fast check of set options.
Definition: perfmon_types.h:173
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:235
const char * name
Name of the event.
Definition: perfmon_types.h:166
Match3 register.
Definition: perfmon_types.h:63
uint64_t regTypeMask
Bitmask for easy checks which types are included in the eventSet.
Definition: perfmon_types.h:220
double fullResult
Aggregated measurement result.
Definition: perfmon_types.h:190
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:1022
uint8_t numberOfOptions
Number of options for the event.
Definition: perfmon_types.h:172
PerfmonEventSetEntry * events
List of eventSets.
Definition: perfmon_types.h:213
uint64_t startData
Start data from the counter.
Definition: perfmon_types.h:187
int id
Offset in higher level control register, e.g. position of enable bit.
Definition: perfmon_types.h:185
uint8_t cfgBits
Misc configuration bits.
Definition: perfmon_types.h:170
Structure specifying event/counter options and their value.
Definition: perfmon_types.h:153
Increment occupancy counter at detection of an edge.
Definition: perfmon_types.h:78
TimerData timer
Time information how long the counters were running.
Definition: perfmon_types.h:214
int init
Flag if corresponding control register is set up properly.
Definition: perfmon_types.h:184
PerfmonEvent event
Event configuration.
Definition: perfmon_types.h:200
Also count events when in kernel space.
Definition: perfmon_types.h:74
Structure specifying an performance monitoring event.
Definition: perfmon_types.h:199
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:216
EventOptionType
Enum of possible event and counter options.
Definition: perfmon_types.h:57
int processorId
Real HW thread ID.
Definition: perfmon_types.h:144
PerfmonThread * threads
List of threads.
Definition: perfmon_types.h:238
uint64_t counterData
Intermediate data from the counters.
Definition: perfmon_types.h:188
double lastResult
Last measurement result.
Definition: perfmon_types.h:189
GroupInfo group
Structure holding the performance group information.
Definition: perfmon_types.h:223
Match opcode.
Definition: perfmon_types.h:59
int numberOfThreads
Amount of threads in threads.
Definition: perfmon_types.h:237
int thread_id
Thread ID how it is used internally.
Definition: perfmon_types.h:143
uint64_t cmask
Misc mask bits.
Definition: perfmon_types.h:171
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:142
Mask3 register.
Definition: perfmon_types.h:67
The event set hold by group is configured.
Definition: perfmon_types.h:91
Match0 register.
Definition: perfmon_types.h:60
const char * limit
Valid counters for the event.
Definition: perfmon_types.h:167
Mask0 register.
Definition: perfmon_types.h:64
Amount of defined options.
Definition: perfmon_types.h:82
Increment only if exceeding threshold.
Definition: perfmon_types.h:72
uint16_t eventId
ID of the event.
Definition: perfmon_types.h:168
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:203
Structure specifying all performance monitoring event groups.
Definition: perfmon_types.h:232
Structure specifying an performance monitoring event group.
Definition: perfmon_types.h:211
int numberOfActiveGroups
Amount of added eventSets. Only those eventSets can be accessed in groups.
Definition: perfmon_types.h:234
RegisterType type
Type of the counter register and event.
Definition: perfmon_types.h:202
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:186
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 value
Value of the option.
Definition: perfmon_types.h:155
Increment counter at each edge.
Definition: perfmon_types.h:71
Structure specifying an performance monitoring event.
Definition: perfmon_types.h:165
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:236
GroupState
Enum of possible states of an event group.
Definition: perfmon_types.h:89
PciDevice * pci_devices
List of PCI devices available for the current architecture.
int numberOfGroups
List length of groups.
Definition: perfmon_types.h:233
Structure describing performance monitoring counter data.
Definition: perfmon_types.h:183
Mask2 register.
Definition: perfmon_types.h:66
uint8_t umask
Most events need to specify a mask to limit counting.
Definition: perfmon_types.h:169
GroupState state
Current state of the event group (configured, started, none)
Definition: perfmon_types.h:222
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:92