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 |
|
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 |
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 |
getResults()
Get all results for all group, event, thread combinations
Direction | Data type(s) |
Input Parameter | None |
Returns | Three-dimensional list with results. First dim. is groups, second dim. is events and third dim. are the threads |
getMarkerResults(filename, group_list, num_cpus)
Get the results for an output file written by Marker API module
Direction | Data type(s) |
Input Parameter |
filename | Filename written by Marker API module |
group_list | List of defined groups |
num_cpus | Amount of defined CPUs. Is used just used for checking if the Marker API module run is valid. If LIKWID_MARKER_THREADINIT is not called properly the tests will fail |
|
Returns | Four-dimensional list with results. First dim. is groups, second dim. is management regions, and third dim. are the events and fourth dim. are the threads |
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 measurement time for group defined by groupID |
|
Returns | Amount of events 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 |
get_groups()
Returns a list of all performance groups in groupfolder
Direction | Data type(s) |
Input Parameter | None |
Returns |
numerOfGroups | Amount of groups in groupfolder for given architecture |
groups | List with the names of all performance groups in groupfolder for given architecture |
|
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 |
|
*/
/*!