![]() |
LIKWID
|
Classes | |
struct | PerfmonCounter |
Structure describing performance monitoring counter data. More... | |
struct | PerfmonEvent |
Structure specifying an performance monitoring event. More... | |
struct | PerfmonEventOption |
Structure specifying event/counter options and their value. More... | |
struct | PerfmonEventSet |
Structure specifying an performance monitoring event group. More... | |
struct | PerfmonEventSetEntry |
Structure specifying an performance monitoring event. More... | |
struct | PerfmonGroupSet |
Structure specifying all performance monitoring event groups. More... | |
struct | PerfmonThread |
Structure specifying thread to CPU relation. More... | |
Macros | |
#define | EVENT_OPTION_NONE_MASK 0x0ULL |
Bitmask with no event/counter option set. | |
#define | OPTIONS_TYPE_MASK(type) |
Define for easily creating an bitmask of all configured event/counter options. More... | |
Enumerations | |
enum | EventOptionType { EVENT_OPTION_NONE = 0, EVENT_OPTION_OPCODE, EVENT_OPTION_MATCH0, EVENT_OPTION_MATCH1, EVENT_OPTION_MATCH2, EVENT_OPTION_MATCH3, EVENT_OPTION_MASK0, EVENT_OPTION_MASK1, EVENT_OPTION_MASK2, EVENT_OPTION_MASK3, EVENT_OPTION_NID, EVENT_OPTION_TID, EVENT_OPTION_STATE, EVENT_OPTION_EDGE, EVENT_OPTION_THRESHOLD, EVENT_OPTION_INVERT, EVENT_OPTION_COUNT_KERNEL, EVENT_OPTION_ANYTHREAD, EVENT_OPTION_OCCUPANCY, EVENT_OPTION_OCCUPANCY_FILTER, EVENT_OPTION_OCCUPANCY_EDGE, EVENT_OPTION_OCCUPANCY_INVERT, EVENT_OPTION_IN_TRANS, EVENT_OPTION_IN_TRANS_ABORT, NUM_EVENT_OPTIONS } |
Enum of possible event and counter options. More... | |
enum | GroupState { STATE_NONE = 0, STATE_SETUP, STATE_START } |
Enum of possible states of an event group. More... | |
Functions | |
int | perfmon_addEventSet (const char *eventCString) __attribute__((visibility("default"))) |
Add an event string to LIKWID. More... | |
void | perfmon_check_counter_map (int cpu_id) __attribute__((visibility("default"))) |
Check the performance monitoring maps whether counters and events are available. More... | |
void | perfmon_destroyMarkerResults () __attribute__((visibility("default"))) |
Free space for read in Marker API file. | |
void | perfmon_finalize (void) __attribute__((visibility("default"))) |
Close the perfomance monitoring facility of LIKWID. More... | |
char * | perfmon_getCounterName (int groupId, int eventId) __attribute__((visibility("default"))) |
Get the counter name of the specified group and event. More... | |
int | perfmon_getCountOfRegion (int region, int thread) __attribute__((visibility("default"))) |
Get the call count of a region for a thread. More... | |
int | perfmon_getCpulistOfRegion (int region, int count, int *cpulist) __attribute__((visibility("default"))) |
Get the cpulist of a region. More... | |
char * | perfmon_getEventName (int groupId, int eventId) __attribute__((visibility("default"))) |
Get the event name of the specified group and event. More... | |
int | perfmon_getEventsOfRegion (int region) __attribute__((visibility("default"))) |
Get the number of events of a region. More... | |
char * | perfmon_getGroupInfoLong (int groupId) __attribute__((visibility("default"))) |
Get the long descriptive string of the specified group. More... | |
char * | perfmon_getGroupInfoShort (int groupId) __attribute__((visibility("default"))) |
Get the short informational string of the specified group. More... | |
char * | perfmon_getGroupName (int groupId) __attribute__((visibility("default"))) |
Get the name group. More... | |
int | perfmon_getGroupOfRegion (int region) __attribute__((visibility("default"))) |
Get the groupID of a region. More... | |
int | perfmon_getGroups (char ***groups, char ***shortinfos, char ***longinfos) __attribute__((visibility("default"))) |
Get all groups. More... | |
int | perfmon_getIdOfActiveGroup (void) __attribute__((visibility("default"))) |
Get the ID of the currently set up event group. More... | |
double | perfmon_getLastMetric (int groupId, int metricId, int threadId) __attribute__((visibility("default"))) |
Get the last metric result of the specified group, counter and thread. More... | |
double | perfmon_getLastResult (int groupId, int eventId, int threadId) __attribute__((visibility("default"))) |
Get the last results of the specified group, counter and thread. More... | |
double | perfmon_getLastTimeOfGroup (int groupId) __attribute__((visibility("default"))) |
Get the last measurement time a group. More... | |
double | perfmon_getMetric (int groupId, int metricId, int threadId) __attribute__((visibility("default"))) |
Get the metric result of the specified group, counter and thread. More... | |
char * | perfmon_getMetricName (int groupId, int metricId) __attribute__((visibility("default"))) |
Get the metric name of the specified group and metric. More... | |
double | perfmon_getMetricOfRegionThread (int region, int metricId, int threadId) __attribute__((visibility("default"))) |
Get the metric result of a region for a metric and thread. More... | |
int | perfmon_getMetricsOfRegion (int region) __attribute__((visibility("default"))) |
Get the number of metrics of a region. More... | |
int | perfmon_getNumberOfEvents (int groupId) __attribute__((visibility("default"))) |
Get the number of configured eventSets in group. More... | |
int | perfmon_getNumberOfGroups (void) __attribute__((visibility("default"))) |
Get the number of configured event groups. More... | |
int | perfmon_getNumberOfMetrics (int groupId) __attribute__((visibility("default"))) |
Get the number of configured metrics for group. More... | |
int | perfmon_getNumberOfRegions () __attribute__((visibility("default"))) |
Get the number of regions listed in Marker API result file. More... | |
int | perfmon_getNumberOfThreads (void) __attribute__((visibility("default"))) |
Get the number of threads specified at perfmon_init() More... | |
double | perfmon_getResult (int groupId, int eventId, int threadId) __attribute__((visibility("default"))) |
Get the results of the specified group, counter and thread. More... | |
double | perfmon_getResultOfRegionThread (int region, int event, int thread) __attribute__((visibility("default"))) |
Get the event result of a region for an event and thread. More... | |
char * | perfmon_getTagOfRegion (int region) __attribute__((visibility("default"))) |
Get the tag of a region. More... | |
int | perfmon_getThreadsOfRegion (int region) __attribute__((visibility("default"))) |
Get the number of threads of a region. More... | |
double | perfmon_getTimeOfGroup (int groupId) __attribute__((visibility("default"))) |
Get the accumulated measurement time a group. More... | |
double | perfmon_getTimeOfRegion (int region, int thread) __attribute__((visibility("default"))) |
Get the accumulated measurement time of a region for a thread. More... | |
int | perfmon_init (int nrThreads, const int *threadsToCpu) __attribute__((visibility("default"))) |
Initialize performance monitoring facility. More... | |
void | perfmon_init_maps (void) __attribute__((visibility("default"))) |
Initialize performance monitoring maps. More... | |
int | perfmon_readCounters (void) __attribute__((visibility("default"))) |
Read the performance monitoring counters on all CPUs. More... | |
int | perfmon_readCountersCpu (int cpu_id) __attribute__((visibility("default"))) |
Read the performance monitoring counters on one CPU. More... | |
int | perfmon_readGroupCounters (int groupId) __attribute__((visibility("default"))) |
Read the performance monitoring counters of all threads in a group. More... | |
int | perfmon_readGroupThreadCounters (int groupId, int threadId) __attribute__((visibility("default"))) |
Read the performance monitoring counters of on thread in a group. More... | |
int | perfmon_readMarkerFile (const char *filename) __attribute__((visibility("default"))) |
Read the output file of the Marker API. More... | |
void | perfmon_returnGroups (int nrgroups, char **groups, char **shortinfos, char **longinfos) __attribute__((visibility("default"))) |
Free all group information. More... | |
int | perfmon_setupCounters (int groupId) __attribute__((visibility("default"))) |
Setup all performance monitoring counters of an eventSet. More... | |
void | perfmon_setVerbosity (int verbose) __attribute__((visibility("default"))) |
Set verbosity of LIKWID library. More... | |
int | perfmon_startCounters (void) __attribute__((visibility("default"))) |
Start performance monitoring counters. More... | |
int | perfmon_stopCounters (void) __attribute__((visibility("default"))) |
Stop performance monitoring counters. More... | |
int | perfmon_switchActiveGroup (int new_group) __attribute__((visibility("default"))) |
Switch the active eventSet to a new one. More... | |
Variables | |
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. | |
RegisterMap * | counter_map |
List of counter with name, config register, counter registers and if needed PCI device. | |
PerfmonEvent * | eventHash |
List of events available for the current architecture. | |
char * | eventOptionTypeName [NUM_EVENT_OPTIONS] |
List of option names. More... | |
PciDevice * | pci_devices |
List of PCI devices available for the current architecture. | |
#define OPTIONS_TYPE_MASK | ( | type | ) |
Define for easily creating an bitmask of all configured event/counter options.
enum EventOptionType |
Enum of possible event and counter options.
List of internally used IDs for all event and counter options that are supported by LIKWID.
enum GroupState |
int perfmon_addEventSet | ( | const char * | eventCString | ) |
Add an event string to LIKWID.
A event string looks like Eventname:Countername(:Option1:Option2:...),... The eventname, countername and options are checked if they are available.
[in] | eventCString | Event string |
void perfmon_check_counter_map | ( | int | cpu_id | ) |
Check the performance monitoring maps whether counters and events are available.
Checks each counter and event in the performance monitoring maps for their availibility on the current system. topology_init(), numa_init() and perfmon_init_maps() must be called before calling perfmon_check_counter_map().
void perfmon_finalize | ( | void | ) |
Close the perfomance monitoring facility of LIKWID.
Deallocates all internal data that is used during performance monitoring. Also the counter values are not accessible after this function.
char* perfmon_getCounterName | ( | int | groupId, |
int | eventId | ||
) |
Get the counter name of the specified group and event.
Get the counter name as defined in the performance group file
[in] | groupId | ID of the group that should be read |
[in] | eventId | ID of the event of which the counter should be returned |
int perfmon_getCountOfRegion | ( | int | region, |
int | thread | ||
) |
Get the call count of a region for a thread.
[in] | region | ID of region |
[in] | thread | ID of thread |
int perfmon_getCpulistOfRegion | ( | int | region, |
int | count, | ||
int * | cpulist | ||
) |
Get the cpulist of a region.
[in] | region | ID of region |
[in] | count | Length of cpulist array |
[in,out] | cpulist | cpulist array |
char* perfmon_getEventName | ( | int | groupId, |
int | eventId | ||
) |
Get the event name of the specified group and event.
Get the metric name as defined in the performance group file
[in] | groupId | ID of the group that should be read |
[in] | eventId | ID of the event that should be returned |
int perfmon_getEventsOfRegion | ( | int | region | ) |
Get the number of events of a region.
[in] | region | ID of region |
char* perfmon_getGroupInfoLong | ( | int | groupId | ) |
Get the long descriptive string of the specified group.
Returns the long descriptive string as defined by performance groups or NULL in case of custom event sets
[in] | groupId | ID of the group that should be read |
char* perfmon_getGroupInfoShort | ( | int | groupId | ) |
Get the short informational string of the specified group.
Returns the short information string as defined by performance groups or "Custom" in case of custom event sets
[in] | groupId | ID of the group that should be read |
char* perfmon_getGroupName | ( | int | groupId | ) |
Get the name group.
Get the name of group. Either it is the name of the performance group or "Custom"
[in] | groupId | ID of the group that should be read |
int perfmon_getGroupOfRegion | ( | int | region | ) |
Get the groupID of a region.
[in] | region | ID of region |
int perfmon_getGroups | ( | char *** | groups, |
char *** | shortinfos, | ||
char *** | longinfos | ||
) |
Get all groups.
Checks the configured performance group path for the current architecture and returns all found group names
int perfmon_getIdOfActiveGroup | ( | void | ) |
Get the ID of the currently set up event group.
double perfmon_getLastMetric | ( | int | groupId, |
int | metricId, | ||
int | threadId | ||
) |
Get the last metric result of the specified group, counter and thread.
Get the metric result of the last measurement cycle. It reads all raw results for the given groupId and threadId.
[in] | groupId | ID of the group that should be read |
[in] | metricId | ID of the metric that should be calculated |
[in] | threadId | ID of the thread/cpu that should be read |
double perfmon_getLastResult | ( | int | groupId, |
int | eventId, | ||
int | threadId | ||
) |
Get the last results of the specified group, counter and thread.
Get the result of the last measurement cycle. The function takes care of happened overflows and if the counter values need to be calculated with multipliers.
[in] | groupId | ID of the group that should be read |
[in] | eventId | ID of the event that should be read |
[in] | threadId | ID of the thread/cpu that should be read |
double perfmon_getLastTimeOfGroup | ( | int | groupId | ) |
Get the last measurement time a group.
[in] | groupId | ID of group |
double perfmon_getMetric | ( | int | groupId, |
int | metricId, | ||
int | threadId | ||
) |
Get the metric result of the specified group, counter and thread.
Get the metric result of all measurement cycles. It reads all raw results for the given groupId and threadId.
[in] | groupId | ID of the group that should be read |
[in] | metricId | ID of the metric that should be calculated |
[in] | threadId | ID of the thread/cpu that should be read |
char* perfmon_getMetricName | ( | int | groupId, |
int | metricId | ||
) |
Get the metric name of the specified group and metric.
Get the metric name as defined in the performance group file
[in] | groupId | ID of the group that should be read |
[in] | metricId | ID of the metric that should be calculated |
double perfmon_getMetricOfRegionThread | ( | int | region, |
int | metricId, | ||
int | threadId | ||
) |
Get the metric result of a region for a metric and thread.
[in] | region | ID of region |
[in] | metricId | ID of metric |
[in] | threadId | ID of thread |
int perfmon_getMetricsOfRegion | ( | int | region | ) |
Get the number of metrics of a region.
[in] | region | ID of region |
int perfmon_getNumberOfEvents | ( | int | groupId | ) |
Get the number of configured eventSets in group.
[in] | groupId | ID of group |
int perfmon_getNumberOfGroups | ( | void | ) |
Get the number of configured event groups.
int perfmon_getNumberOfMetrics | ( | int | groupId | ) |
Get the number of configured metrics for group.
[in] | groupId | ID of group |
int perfmon_getNumberOfRegions | ( | ) |
Get the number of regions listed in Marker API result file.
int perfmon_getNumberOfThreads | ( | void | ) |
Get the number of threads specified at perfmon_init()
double perfmon_getResult | ( | int | groupId, |
int | eventId, | ||
int | threadId | ||
) |
Get the results of the specified group, counter and thread.
Get the result of all measurement cycles. The function takes care of happened overflows and if the counter values need to be calculated with multipliers.
[in] | groupId | ID of the group that should be read |
[in] | eventId | ID of the event that should be read |
[in] | threadId | ID of the thread/cpu that should be read |
double perfmon_getResultOfRegionThread | ( | int | region, |
int | event, | ||
int | thread | ||
) |
Get the event result of a region for an event and thread.
[in] | region | ID of region |
[in] | event | ID of event |
[in] | thread | ID of thread |
char* perfmon_getTagOfRegion | ( | int | region | ) |
Get the tag of a region.
[in] | region | ID of region |
int perfmon_getThreadsOfRegion | ( | int | region | ) |
Get the number of threads of a region.
[in] | region | ID of region |
double perfmon_getTimeOfGroup | ( | int | groupId | ) |
Get the accumulated measurement time a group.
[in] | groupId | ID of group |
double perfmon_getTimeOfRegion | ( | int | region, |
int | thread | ||
) |
Get the accumulated measurement time of a region for a thread.
[in] | region | ID of region |
[in] | thread | ID of thread |
int perfmon_init | ( | int | nrThreads, |
const int * | threadsToCpu | ||
) |
Initialize performance monitoring facility.
Initialize the performance monitoring feature by creating basic data structures. The access mode must already be set when calling perfmon_init()
[in] | nrThreads | Amount of threads |
[in] | threadsToCpu | List of CPUs |
void perfmon_init_maps | ( | void | ) |
Initialize performance monitoring maps.
Initialize the performance monitoring maps for counters, events and Uncore boxes# for the current architecture. topology_init() and numa_init() must be called before calling perfmon_init_maps()
int perfmon_readCounters | ( | void | ) |
Read the performance monitoring counters on all CPUs.
Read the counters that have been previously started by perfmon_startCounters(). The counters are stopped directly to avoid interference of LIKWID with the measured code. Before returning, the counters are started again.
int perfmon_readCountersCpu | ( | int | cpu_id | ) |
Read the performance monitoring counters on one CPU.
Read the counters that have been previously started by perfmon_startCounters(). The counters are stopped directly to avoid interference of LIKWID with the measured code. Before returning, the counters are started again. Only one CPU is read.
[in] | cpu_id | CPU ID of the CPU that should be read |
int perfmon_readGroupCounters | ( | int | groupId | ) |
Read the performance monitoring counters of all threads in a group.
Read the counters that have been previously started by perfmon_startCounters(). The counters are stopped directly to avoid interference of LIKWID with the measured code. Before returning, the counters are started again.
[in] | groupId | Read the counters for all threads taking part in group |
int perfmon_readGroupThreadCounters | ( | int | groupId, |
int | threadId | ||
) |
Read the performance monitoring counters of on thread in a group.
Read the counters that have been previously started by perfmon_startCounters(). The counters are stopped directly to avoid interference of LIKWID with the measured code. Before returning, the counters are started again. Only one thread's CPU is read.
[in] | groupId | Read the counters defined in group identified with groupId |
[in] | threadId | Read the counters for the thread |
int perfmon_readMarkerFile | ( | const char * | filename | ) |
Read the output file of the Marker API.
[in] | filename | Filename with Marker API results |
void perfmon_returnGroups | ( | int | nrgroups, |
char ** | groups, | ||
char ** | shortinfos, | ||
char ** | longinfos | ||
) |
Free all group information.
[in] | nrgroups | Number of groups |
[in] | groups | List of group names |
[in] | shortinfos | List of short information string about group |
[in] | longinfos | List of long information string about group |
int perfmon_setupCounters | ( | int | groupId | ) |
Setup all performance monitoring counters of an eventSet.
A event string looks like Eventname:Countername(:Option1:Option2:...),... The eventname, countername and options are checked if they are available.
[in] | groupId | (returned from perfmon_addEventSet() |
void perfmon_setVerbosity | ( | int | verbose | ) |
Set verbosity of LIKWID library.
int perfmon_startCounters | ( | void | ) |
Start performance monitoring counters.
Start the counters that have been previously set up by perfmon_setupCounters(). The counter registered are zeroed before enabling the counters
int perfmon_stopCounters | ( | void | ) |
Stop performance monitoring counters.
Stop the counters that have been previously started by perfmon_startCounters(). All config registers get zeroed before reading the counter register.
int perfmon_switchActiveGroup | ( | int | new_group | ) |
Switch the active eventSet to a new one.
Stops the currently running counters, switches the eventSet by setting up the counters and start the counters.
[in] | new_group | ID of group that should be switched to. |
char* eventOptionTypeName[NUM_EVENT_OPTIONS] |
List of option names.
List of strings for all event and counter options used for matching and output