Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pmda-denki RAPL MSR support #2106

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 60 additions & 36 deletions qa/1653.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,41 @@ QA output created by 1653
Updating the Performance Metrics Name Space (PMNS) ...
Terminate PMDA if already installed ...
Updating the PMCD control file, and notifying PMCD ...
Check denki metrics have appeared ... 4 metrics and 4 values
Check denki metrics have appeared ... 5 metrics and 4 values

denki.rapl
denki.raplsysfs
Data Type: 64-bit unsigned int InDom: 156.0 0x27000000
Semantics: counter Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [0 or "0-package-1"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [1 or "0-core"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [2 or "1-package-0"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [3 or "1-core"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [0 or "0-package-1"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [1 or "0-core"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [2 or "1-package-0"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [3 or "1-core"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [2 or "1-package-0"] value 13719
inst [1 or "0-core"] value 3483
inst [3 or "1-core"] value 8334
inst [0 or "0-package-1"] value 8826

denki.raplmsr
Data Type: 64-bit unsigned int InDom: 156.1 0x27000001
Semantics: counter Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplmsr","machineid":"MACHINEID","userid":USERID}
No value(s) available!

denki.bat.energy_now
Data Type: double InDom: 156.1 0x27000001
Data Type: double InDom: 156.2 0x27000002
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt hours","userid":USERID}
No value(s) available!

denki.bat.power_now
Data Type: double InDom: 156.2 0x27000002
Data Type: double InDom: 156.3 0x27000003
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt","userid":USERID}
No value(s) available!

denki.bat.capacity
Data Type: 32-bit int InDom: 156.3 0x27000003
Data Type: 32-bit int InDom: 156.4 0x27000004
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"percent","userid":USERID}
No value(s) available!
Expand All @@ -46,30 +52,36 @@ No value(s) available!
Updating the Performance Metrics Name Space (PMNS) ...
Terminate PMDA if already installed ...
Updating the PMCD control file, and notifying PMCD ...
Check denki metrics have appeared ... 4 metrics and 3 values
Check denki metrics have appeared ... 5 metrics and 3 values

denki.rapl
denki.raplsysfs
Data Type: 64-bit unsigned int InDom: 156.0 0x27000000
Semantics: counter Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
No value(s) available!

denki.raplmsr
Data Type: 64-bit unsigned int InDom: 156.1 0x27000001
Semantics: counter Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplmsr","machineid":"MACHINEID","userid":USERID}
No value(s) available!

denki.bat.energy_now
Data Type: double InDom: 156.1 0x27000001
Data Type: double InDom: 156.2 0x27000002
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt hours","userid":USERID}
inst [N or BATTERY-N"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt hours","userid":USERID}
inst [N or BATTERY-N"] value 15.23

denki.bat.power_now
Data Type: double InDom: 156.2 0x27000002
Data Type: double InDom: 156.3 0x27000003
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt","userid":USERID}
inst [N or BATTERY-N"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt","userid":USERID}
inst [N or BATTERY-N"] value 4.077

denki.bat.capacity
Data Type: 32-bit int InDom: 156.3 0x27000003
Data Type: 32-bit int InDom: 156.4 0x27000004
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"percent","userid":USERID}
inst [N or BATTERY-N"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"percent","userid":USERID}
Expand All @@ -80,23 +92,29 @@ denki.bat.capacity
Updating the Performance Metrics Name Space (PMNS) ...
Terminate PMDA if already installed ...
Updating the PMCD control file, and notifying PMCD ...
Check denki metrics have appeared ... 4 metrics and 10 values
Check denki metrics have appeared ... 5 metrics and 10 values

denki.rapl
denki.raplsysfs
Data Type: 64-bit unsigned int InDom: 156.0 0x27000000
Semantics: counter Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [0 or "package-0"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [1 or "core"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [2 or "uncore"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [3 or "dram"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [0 or "package-0"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [1 or "core"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [2 or "uncore"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [3 or "dram"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [2 or "uncore"] value 1
inst [1 or "core"] value 1568
inst [3 or "dram"] value 2120
inst [0 or "package-0"] value 2977

denki.raplmsr
Data Type: 64-bit unsigned int InDom: 156.1 0x27000001
Semantics: counter Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplmsr","machineid":"MACHINEID","userid":USERID}
No value(s) available!

denki.bat.energy_now
Data Type: double InDom: 156.1 0x27000001
Data Type: double InDom: 156.2 0x27000002
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt hours","userid":USERID}
inst [N or BATTERY-N"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt hours","userid":USERID}
Expand All @@ -105,7 +123,7 @@ denki.bat.energy_now
inst [N or BATTERY-N"] value 15.87

denki.bat.power_now
Data Type: double InDom: 156.2 0x27000002
Data Type: double InDom: 156.3 0x27000003
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt","userid":USERID}
inst [N or BATTERY-N"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt","userid":USERID}
Expand All @@ -114,7 +132,7 @@ denki.bat.power_now
inst [N or BATTERY-N"] value 1.576

denki.bat.capacity
Data Type: 32-bit int InDom: 156.3 0x27000003
Data Type: 32-bit int InDom: 156.4 0x27000004
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"percent","userid":USERID}
inst [N or BATTERY-N"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"percent","userid":USERID}
Expand All @@ -127,37 +145,43 @@ denki.bat.capacity
Updating the Performance Metrics Name Space (PMNS) ...
Terminate PMDA if already installed ...
Updating the PMCD control file, and notifying PMCD ...
Check denki metrics have appeared ... 4 metrics and 7 values
Check denki metrics have appeared ... 5 metrics and 7 values

denki.rapl
denki.raplsysfs
Data Type: 64-bit unsigned int InDom: 156.0 0x27000000
Semantics: counter Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [0 or "package-0"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [1 or "core"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [2 or "uncore"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
inst [3 or "dram"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"rapl","machineid":"MACHINEID","userid":USERID}
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [0 or "package-0"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [1 or "core"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [2 or "uncore"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [3 or "dram"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplsysfs","machineid":"MACHINEID","userid":USERID}
inst [1 or "core"] value 12628
inst [0 or "package-0"] value 26716
inst [2 or "uncore"] value 2711
inst [3 or "dram"] value 7743

denki.raplmsr
Data Type: 64-bit unsigned int InDom: 156.1 0x27000001
Semantics: counter Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","indom_name":"raplmsr","machineid":"MACHINEID","userid":USERID}
No value(s) available!

denki.bat.energy_now
Data Type: double InDom: 156.1 0x27000001
Data Type: double InDom: 156.2 0x27000002
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt hours","userid":USERID}
inst [N or BATTERY-N"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt hours","userid":USERID}
inst [N or BATTERY-N"] value 34.71

denki.bat.power_now
Data Type: double InDom: 156.2 0x27000002
Data Type: double InDom: 156.3 0x27000003
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt","userid":USERID}
inst [N or BATTERY-N"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"watt","userid":USERID}
inst [N or BATTERY-N"] value 26.439

denki.bat.capacity
Data Type: 32-bit int InDom: 156.3 0x27000003
Data Type: 32-bit int InDom: 156.4 0x27000004
Semantics: instant Units: none
labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"percent","userid":USERID}
inst [N or BATTERY-N"] labels {"agent":"denki","domainname":"DOMAINNAME","groupid":GROUPID,"hostname":"HOSTNAME","machineid":"MACHINEID","units":"percent","userid":USERID}
Expand Down
1 change: 1 addition & 0 deletions src/pmdas/denki/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ PMDAADMDIR = $(PCP_PMDASADM_DIR)/$(IAM)
PMDATMPDIR = $(PCP_PMDAS_DIR)/$(IAM)

LLDLIBS = $(PCP_PMDALIB)
LLDLIBS += $(LIB_FOR_MATH)
LCFLAGS = $(INVISIBILITY)

CFILES = denki.c
Expand Down
42 changes: 36 additions & 6 deletions src/pmdas/denki/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ Denki PMDA
This is the PMDA providing metrics which are related to the systems
electricity.

At the moment, metrics from 2 sources are available:
At the moment, metrics from 3 sources are available:

- RAPL values, available on newer Intel CPUs.
- RAPL (available on newer Intel CPUs), values read via /sys file system
- RAPL (available on newer Intel CPUs), values read via cpu MSR registers
- battery values


Expand Down Expand Up @@ -58,10 +59,10 @@ Troubleshooting
Usage scenarios/examples
========================

- denki.rapl:
- denki.raplsysfs:

If RAPL is available, denki.rapl can give an estimation of
the current power consumption. On laptops, typically 4 RAPL
If RAPL via /sys is available, denki.raplsysfs can give an estimation
of the current power consumption. On laptops, typically 4 RAPL
domains are available:

inst [0 or "package-0"] - consumption of the other 3 domains
Expand All @@ -76,7 +77,26 @@ Usage scenarios/examples
On systems with multiple numa zones, also multiple RAPL
packages can be available, pmda-denki should properly deal
with these. For these, i.e. domains 0-package-0 and
1-package-0 will become available as instances.
1-package-0 will become available as instances, i.e.

denki.raplsysfs
inst [0 or "0-package-0"] value 169013
inst [1 or "0-dram"] value 12294
inst [2 or "1-package-1"] value 135669
inst [3 or "1-dram"] value 9600

- denki.raplmsr:

If RAPL via MSR cpu registers is available, denki.raplmsr can
give an estimation of the current power consumption. On
laptops, typically 5 RAPL MSR domains are available:

denki.raplmsr
inst [0 or "package_energy"] value 17222
inst [1 or "cores_energy"] value 6110
inst [2 or "uncore_energy"] value 143
inst [3 or "dram_energy"] value 3167
inst [4 or "psys_energy"] value 53005

- denki.bat.energy_now:

Expand Down Expand Up @@ -108,3 +128,13 @@ Usage scenarios/examples
- denki.bat.capacity:

This metric reports the fillstate of the battery in percent.

Links
=====

More details are available in the pmda-denki handbook:
* https://github.com/christianhorn/smallhelpers/tree/main/pmda-denki-handbook
* Rendered as html:
https://htmlpreview.github.io/?https://github.com/christianhorn/smallhelpers/blob/main/pmda-denki-handbook/denki.html
* As pdf:
https://github.com/christianhorn/smallhelpers/blob/main/pmda-denki-handbook/denki.pdf
Loading
Loading