Data type definition for Lua performance monitoring module in the Lua API
Event and Counter Info
This structure is returned by getEventsAndCounters function
Membername | Comment |
Counters |
Membername | Comment |
Name | Counter name as used by LIKWID |
Index | Index of counter definition in internal list of counters |
Type | ID number of counter type, use TypeName to get a human-readable name |
TypeName | Name of counter type |
Options | String with the options available for the counter |
|
Events |
Membername | Comment |
Name | Event name as used by LIKWID |
ID | Event ID as defined by CPU vendor |
Umask | Umask further restricting the event defined by ID |
Limit | String containing the name(s) of registers the event can be programmed on |
Options | String with the options available for the event |
|
Info about a performance group
This structure is returned by get_groupdata function
Membername | Comment |
EventString | Event set used for the performance group. Well formatted for addEventSet function |
GroupString | Name of the performance group |
LongDescription | Description of the group. The 'LONG' section in the performance group file |
Events |
Membername | Comment |
Event ID |
Event | Name of event |
Counter | LIKWID's name of the counter register |
|
|
Metrics |
Membername | Comment |
Metric ID |
description | Descriptive information of the metric |
formula | Formula for calculating the metrics value |
|
|
Info about online PCI devices used for performance monitoring
This structure is returned by getOnlineDevices function
Membername | Comment |
Name (used by LIKWID) |
Membername | Comment |
Name | Name of PCI device |
Path | Path to PCI device |
Type | Human-readable name of the PCI device type |
TypeDescription | Description about the PCI device |
|
Info about performance groups
This structure is returned by getGroups function
Membername | Comment |
Index |
Membername | Comment |
Name | Name of performance group |
Info | Short description of the performance group |
Long | Long description of the performance group |
|
Function definitions for Lua performance monitoring module in the Lua API
init(nrThreads, thread2Cpus)
Initializes the Perfmon module of LIKWID, like opening the MSR files and check the PCI devices
If in access daemon mode, a single daemon instance is started to forward measurements on all given CPUs
Direction | Data type(s) |
Input Parameter |
nrThreads | Number of CPUs that should be measured |
thread2Cpus | List with length nrThreads containing the relation between thread number and measured CPU |
|
Returns | Error code, 0 for success |
addEventSet(eventSet)
Creates the internal management structures for the given event set. Checks the registers and if needed PCI device access
The init function as to be called previously
Direction | Data type(s) |
Input Parameter |
eventSet | String composed of all events in the event set. Format is Event1:Counter1(:Option11:Options12:...),Event2:Counter2... |
|
Returns | The group ID of the added event set |
setupCounters(groupID)
Setup the config registers to measure the events defined by group
Direction | Data type(s) |
Input Parameter |
|
Returns | Error code, 0 for success |
startCounters()
Starts the perfmon group previously set up with setupCounters function.
Direction | Data type(s) |
Input Parameter | None |
Returns | Error code, 0 for success |
stopCounters()
Stops the perfmon group and reads the counters into the internal result section. Use the getResult or getResults functions to get the results.
Direction | Data type(s) |
Input Parameter | None |
Returns | Error code, 0 for success |
readCounters()
Reads the perfmon group into the internal result section. Use the getResult or getResults functions to get the results.
The counters will be stopped shortly and started after reading to exclude the LIKWID code from measurements.
Direction | Data type(s) |
Input Parameter | None |
Returns | Error code, 0 for success |
switchGroup(newgroup)
Switches the currently active group in the perfmon module. If the given group ID does not exist, it fallbacks to group ID 1.
Direction | Data type(s) |
Input Parameter |
newgroup | Switch active group to newgroup |
|
Returns | Error code, 0 for success |
finalize()
Destroy internal structures and clean all used registers
Direction | Data type(s) |
Input Parameter | None |
Returns | Always 0 |
finalize()
Destroy internal structures and clean all used registers
Direction | Data type(s) |
Input Parameter | None |
Returns | Always 0 |
getResult(groupID, eventID, threadID)
Get result for a group, event, thread combination. All options must be given
Direction | Data type(s) |
Input Parameter |
groupID | Return result from group defined by groupID |
eventID | Return result for event with eventID. Position in string given to addEventSet function |
threadID | Return result for thread with threadID as defined by the thread2Cpus input parameter for init function |
|
Returns | Result |
getLastResult(groupID, eventID, threadID)
Get result for a group, event, thread combination of the last measurement cycle. All options must be given
Direction | Data type(s) |
Input Parameter |
groupID | Return result from group defined by groupID |
eventID | Return result for event with eventID. Position in string given to addEventSet function |
threadID | Return result for thread with threadID as defined by the thread2Cpus input parameter for init function |
|
Returns | Result |
getMetric(groupID, metricID, threadID)
Get the derived metric result for a group, metric, thread combination. All options must be given
Direction | Data type(s) |
Input Parameter |
groupID | Return result from group defined by groupID |
metricID | Return result for metric with metricID. |
threadID | Return result for thread with threadID as defined by the thread2Cpus input parameter for init function |
|
Returns | Result |
getLastMetric(groupID, metricID, threadID)
Get the derived metric result for a group, metric, thread combination of the last measurement cycle. All options must be given
Direction | Data type(s) |
Input Parameter |
groupID | Return result from group defined by groupID |
eventID | Return result for event with metricID. |
threadID | Return result for thread with threadID as defined by the thread2Cpus input parameter for init function |
|
Returns | Result |
getEventsAndCounters()
Get a list containing all event and counter definitions
Direction | Data type(s) |
Input Parameter | None |
Returns | Event and counter info like lua_counterinfo |
getOnlineDevices()
Get a list containing all online PCI devices
Direction | Data type(s) |
Input Parameter | None |
Returns | PCI device info like lua_pcidevinfo |
getNumberOfGroups()
Returns the number of event sets (groups) added to the perfmon module
Direction | Data type(s) |
Input Parameter | None |
Returns | Amount of configured groups |
getIdOfActiveGroup()
Returns the ID of the currently active group
Direction | Data type(s) |
Input Parameter | None |
Returns | ID of active group |
getRuntimeOfGroup(groupID)
Returns the measurement time of the given groupID
Direction | Data type(s) |
Input Parameter |
groupID | Return the measurement time for group defined by groupID |
|
Returns | Measurement time of group |
getNumberOfEvents(groupID)
Returns the amount of events for the given groupID
Direction | Data type(s) |
Input Parameter |
groupID | Return the number of events in group defined by groupID |
|
Returns | Amount of events in group |
getNumberOfMetrics(groupID)
Returns the amount of metrics for the given groupID
Direction | Data type(s) |
Input Parameter |
groupID | Return the number of derived metrics for group defined by groupID |
|
Returns | Amount of metrics in group |
getNumberOfThreads()
Returns the number of threads as given to init function
Direction | Data type(s) |
Input Parameter | None |
Returns | Amount of measurement threads |
getNameOfEvent(groupID, eventID)
Returns the name of an event in a configured event set
Direction | Data type(s) |
Input Parameter |
groupID | Return event name from group defined by groupID |
eventID | Return event name for event with eventID. |
|
Returns | Name of event |
getNameOfCounter(groupID, eventID)
Returns the name of counter in a configured event set
Direction | Data type(s) |
Input Parameter |
groupID | Return counter name from group defined by groupID |
eventID | Return counter name for event with eventID. |
|
Returns | Name of counter |
getNameOfMetric(groupID, metricID)
Returns the name of a derived metric in a configured performance group
Direction | Data type(s) |
Input Parameter |
groupID | Return metric name from group defined by groupID |
metricID | Return metric name for event with metricID. |
|
Returns | Name of derived metric |
getNameOfGroup(groupID)
Returns the name of a configured performance group or 'Custom' for own event sets
Direction | Data type(s) |
Input Parameter |
groupID | Return name of group defined by groupID |
|
Returns | Name of group |
getShortInfoOfGroup(groupID)
Returns the short info string of a configured performance group or 'Custom' for own event sets
Direction | Data type(s) |
Input Parameter |
groupID | Return short description of a group defined by groupID |
|
Returns | Short description of a group |
getLongInfoOfGroup(groupID)
Returns the long info string of a configured performance group or 'Custom' for own event sets
Direction | Data type(s) |
Input Parameter |
groupID | Return long description of a group defined by groupID |
|
Returns | Long description of a group |
getGroups()
Returns a list of all performance groups in groupfolder
Direction | Data type(s) |
Input Parameter | None |
Returns | List of performance groups, see lua_groupinfo for structure |
get_groupdata(group)
Read in the performance group group
Direction | Data type(s) |
Input Parameter |
group | Get group data for group |
|
Returns |
groupdata | Structure with all group information found for the performance group group, see lua_groupdata |
|
readMarkerFile(filename)
Get the results for an output file written by Marker API module
Direction | Data type(s) |
Input Parameter |
|
Returns | No return value |
destroyMarkerFile()
Destroy all results previously read in from the Marker API module
Direction | Data type(s) |
Input Parameter | None |
Returns | No return value |
markerNumRegions()
Get the number of regions defined in the file previously read in with readMarkerFile
Direction | Data type(s) |
Input Parameter | None |
Returns | Amount of regions |
markerRegionGroup(regionID)
Get the group ID of a region read in with readMarkerFile
Direction | Data type(s) |
Input Parameter |
regionID | Region ID to get group ID from |
|
Returns | Group ID for the region |
markerRegionTag(regionID)
Get the region name of a region read in with readMarkerFile
Direction | Data type(s) |
Input Parameter |
regionID | Region ID to get the name from |
|
Returns | Region name |
markerRegionEvents(regionID)
Get the number of events of a region read in with readMarkerFile
Direction | Data type(s) |
Input Parameter |
regionID | Region ID to get the event count from |
|
Returns | Number of events |
markerRegionThreads(regionID)
Get the number of thread participating in a region read in with readMarkerFile
Direction | Data type(s) |
Input Parameter |
regionID | Region ID to get the thread count from |
|
Returns | Number of threads |
markerRegionCpulist(regionID)
Get a list of CPUs participating in a region read in with readMarkerFile
Direction | Data type(s) |
Input Parameter |
regionID | Region ID to get the thread count from |
|
Returns | List with CPU IDs |
markerRegionTime(regionID, threadID)
Get the accumulated measurement time for a region read in with readMarkerFile
Direction | Data type(s) |
Input Parameter |
regionID | Region ID to get the time from |
threadID | Thread ID to get the time from |
|
Returns | Measurement time |
markerRegionCount(regionID, threadID)
Get the call count for a region read in with readMarkerFile
Direction | Data type(s) |
Input Parameter |
regionID | Region ID to get the call count from |
threadID | Thread ID to get the call count from |
|
Returns | Call count |
markerRegionResult(regionID, eventID, threadID)
Get the result for a region and thread read in with readMarkerFile
Direction | Data type(s) |
Input Parameter |
regionID | Region ID to get the result |
eventID | Event ID to get the result |
threadID | Thread ID to get the result |
|
Returns | Result |
markerRegionMetric(regionID, metricID, threadID)
Get the derived metric result for a region read in with readMarkerFile
Direction | Data type(s) |
Input Parameter |
regionID | Region ID to get the derived metric result |
metricID | Metric ID to get the derived metric result |
threadID | Thread ID to get the derived metric result |
|
Returns | Metric result |
*/
/*!