Data type definition for Lua power and energy monitoring module in the Lua API
Power Information
This structure is returned by getPowerInfo function
The nested list structure is almost similar to the C struct CpuTopology.
Membername | Comment |
hasRAPL | If set, the system supports power readings through the RAPL interface |
baseFrequency | Nominal clock frequency of the system |
minFrequency | Minimal supported clock frequency of the system |
powerUnit | Multiplier for power readings |
timeUnit | Multiplier for time readings from RAPL |
turbo |
Membername | Comment |
numSteps | Amount of turbo mode steps |
steps | List containing the turbo mode steps |
|
domains |
Membername | Comment |
RAPL domain |
Typename | comment |
ID | Type of domain (PKG, PP0, PP1, DRAM) |
energyUnit | Multiplier for energy readings for RAPL domain |
supportStatus | RAPL domain has a status register to read energy values |
supportPerf | RAPL domain has a perf register |
supportPolicy | RAPL domain has a policy register to define a global energy policy |
supportLimit | RAPL domain has a policy register to define a limit for the energy consumption |
supportInfo | RAPL domain has a policy register to define a limit for the energy consumption |
tdp | Thermal Design Power
Only if supportInfo is set
Only if supportInfo is set |
minPower | Minimal power consumption for the RAPL domain
Only if supportInfo is set |
maxPower | Maximal power consumption for the RAPL domain
Only if supportInfo is set |
maxTimeWindow | Maximal duration between updates of the RAPL status registers
Only if supportInfo is set |
|
|
Function definitions for Lua power and energy monitoring module in the Lua API
getPowerInfo()
Get information about the RAPL interface in the system
Direction | Data type(s) |
Input Parameter | None |
Returns | Power Info lua_powerinfo |
putPowerInfo()
Frees C struct PowerInfo. You can still use the lua_powerinfo data structure
If you call getPowerInfo function again after calling this function, the power information struct will be filled again.
Direction | Data type(s) |
Input Parameter | None |
Returns | None |
startPower(cpuID, domainID)
Start measuring given RAPL domain on given CPU
Direction | Data type(s) |
Input Parameter |
cpuID | Start the power measurement on CPU cpuID |
domainID | Start the power measurement for domain domainID
Possible values: 0=PKG, 1=PP0, 2=PP1, 3=DRAM |
|
Returns | Power value at start |
stopPower(cpuID, domainID)
Stop measuring given RAPL domain on given CPU
Direction | Data type(s) |
Input Parameter |
cpuID | Stop the power measurement on CPU cpuID |
domainID | Stop the power measurement for domain domainID
Possible values: 0=PKG, 1=PP0, 2=PP1, 3=DRAM |
|
Returns | Power value at stop |
printEnergy(before, after, domainID)
Direction | Data type(s) |
Input Parameter |
before | Result from startPower function |
after | Result from stopPower function |
domainID | Print the power result for domain domainID
Possible values: 0=PKG, 1=PP0, 2=PP1, 3=DRAM |
|
Returns | Power value at stop |
limitGet(cpuID, domainID) (EXPERIMENTAL)
Get the current limit in the limit register of domain. The limit is defined as maximal power consumption in a time window
Direction | Data type(s) |
Input Parameter |
cpuID | Get limit for CPU cpuID |
domainID | Get limit for domain domainID
Possible values: 0=PKG, 1=PP0, 2=PP1, 3=DRAM |
|
Returns |
power | Power limit value |
time | Duration of time window |
|
limitSet(cpuID, domainID, power, time, clamp) (EXPERIMENTAL)
Direction | Data type(s) |
Input Parameter |
cpuID | Set limit for CPU cpuID |
domainID | Set limit for domain domainID
Possible values: 0=PKG, 1=PP0, 2=PP1, 3=DRAM |
power | Set power value to power |
time | Set time window value to time |
clamp | Should the limit be clamped or can it sometimes exceed the power limit if in total the limit is satisfied |
|
Returns | Error code, 0 for success |
limitState(cpuID, domainID) (EXPERIMENTAL)
Get the state of the limit
Direction | Data type(s) |
Input Parameter |
cpuID | Get the state on CPU cpuID |
domainID | Get the state for domain domainID
Possible values: 0=PKG, 1=PP0, 2=PP1, 3=DRAM |
|
Returns | State, 0 for off, 1 for on |
*/
/*!