Power Top RAPL interface v04
Srinivas Pandruvada
cover Power Top RAPL interface v04
This patch adds RAPL interface to powertop. RAPL can give energy consumed for a domain. For client platform, domain are "PKG", "PP0" and "PP1". For servers "PKG", "DRAM" and "PP0". PP0 refers to CPU energy comsumtion and PP1 refers to GPUs. DRAM is for DRAM in servers only.
Powertop estimates how much power CPU and GPU is consuming based on the measured power and load. This patch splits this into the following:
- Actual CPU/GPU power reported by RAPL
- DRAM power for servers
- Remaining as "misc" usage for CPU/GPU
As more domain are getting added, this patch creates a parent/child relationship for CPU/GPU. This way when new domains are added these files don't need change. Only inherit CPU/GPU class, and implement virtual method for consumed power.
v04 changes:
Rebase with the latest git tree
Add MSR access error message from previous commit to lib.cpp MSR api "_("Model-specific registers (MSR) not found (try enabling CONFIG_X86_MSR)"
v03 changes:
close fd when pread/pwrite fails.
v02 changes:
Addressed review comments
Moved MSR handling to library
Added interface to get the first CPU in a package Fix error in reading RAPL when system has multiple packages
Srinivas Pandruvada (8):
Common read/write MSR API
Use MSR Lib MSR functions
RAPL Interface
cpu device as parent class
Interface to get first cpu
Added PP0 RAPL domain for CPU
Add RAPL DRAM domain
Add RAPL PP1 domain for GPU
src/Makefile.am | 4 +- src/cpu/cpu.cpp | 16 ++ src/cpu/cpu.h | 1 + src/cpu/cpu_rapl_device.cpp | 74 +++++ src/cpu/cpu_rapl_device.h | 57 ++++ src/cpu/cpudevice.cpp | 14 + src/cpu/cpudevice.h | 6 +- src/cpu/dram_rapl_device.cpp | 75 +++++ src/cpu/dram_rapl_device.h | 57 ++++ src/cpu/intel_cpus.cpp | 23 +- src/cpu/rapl/rapl_interface.cpp | 611 ++++++++++++++++++++++++++++++++++++++++ src/cpu/rapl/rapl_interface.h | 85 ++++++ src/devices/gpu_rapl_device.cpp | 70 +++++ src/devices/gpu_rapl_device.h | 57 ++++ src/devices/i915-gpu.cpp | 21 ++ src/devices/i915-gpu.h | 6 +- src/lib.cpp | 65 +++++ src/lib.h | 3 +- 18 files changed, 1222 insertions(+), 23 deletions(-) create mode 100644 src/cpu/cpu_rapl_device.cpp create mode 100644 src/cpu/cpu_rapl_device.h create mode 100644 src/cpu/dram_rapl_device.cpp create mode 100644 src/cpu/dram_rapl_device.h create mode 100644 src/cpu/rapl/rapl_interface.cpp create mode 100644 src/cpu/rapl/rapl_interface.h create mode 100644 src/devices/gpu_rapl_device.cpp create mode 100644 src/devices/gpu_rapl_device.h
Signature · 1 line
1.7.11.7
Srinivas Pandruvada
PATCH 1/8 Common read/write MSR API
Added two new interfaces:
extern int read_msr(int cpu, uint64_t offset, uint64_t *value); extern int write_msr(int cpu, uint64_t offset, uint64_t value);
This way all MSR interface can use this instead of reimplementing.
--- src/lib.cpp | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/lib.h | 3 ++- 2 files changed, 67 insertions(+), 1 deletion(-)
src/lib.cpp +65 -0
@@ -56,6 +56,7 @@ extern "C" { #include <limits> #include <math.h> #include <ncurses.h> +#include <fcntl.h> static int kallsyms_read = 0;
@@ -450,3 +451,67 @@ int get_user_input(char *buf, unsigned sz) /* to distinguish between getnstr error and empty line */ return ret || strlen(buf); } + +int read_msr(int cpu, uint64_t offset, uint64_t *value) +{ + ssize_t retval; + uint64_t msr; + int fd; + char msr_path[256]; + + fd = sprintf(msr_path, "/dev/cpu/%d/msr", cpu); + + if (access(msr_path, R_OK) != 0){ + fd = sprintf(msr_path, "/dev/msr%d", cpu); + + if (access(msr_path, R_OK) != 0){ + fprintf(stderr, + _("Model-specific registers (MSR)\ + not found (try enabling CONFIG_X86_MSR).\n")); + return -1; + } + } + + fd = open(msr_path, O_RDONLY); + if (fd < 0) + return -1; + retval = pread(fd, &msr, sizeof msr, offset); + close(fd); + if (retval != sizeof msr) { + return -1; + } + *value = msr; + + return retval; +} + +int write_msr(int cpu, uint64_t offset, uint64_t value) +{ + ssize_t retval; + int fd; + char msr_path[256]; + + fd = sprintf(msr_path, "/dev/cpu/%d/msr", cpu); + + if (access(msr_path, R_OK) != 0){ + fd = sprintf(msr_path, "/dev/msr%d", cpu); + + if (access(msr_path, R_OK) != 0){ + fprintf(stderr, + _("Model-specific registers (MSR)\ + not found (try enabling CONFIG_X86_MSR).\n")); + return -1; + } + } + + fd = open(msr_path, O_WRONLY); + if (fd < 0) + return -1; + retval = pwrite(fd, &value, sizeof value, offset); + close(fd); + if (retval != sizeof value) { + return -1; + } + + return retval; +}
src/lib.h +2 -1
@@ -74,5 +74,6 @@ typedef void (*callback)(const char*);extern void process_directory (const char *d_name,callback fn);extern int utf_ok;extern int get_user_input (char *buf,unsigned sz); - +extern int read_msr (int cpu,uint64_t offset,uint64_t *value); +extern int write_msr (int cpu,uint64_t offset,uint64_t value);#endif
Signature · 1 line
1.7.11.7
Srinivas Pandruvada
PATCH 2/8 Use MSR Lib MSR functions
In reply to Srinivas PandruvadaMSR read is implemented in lib.c. Use this API instead.
--- src/cpu/intel_cpus.cpp | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-)
src/cpu/intel_cpus.cpp +4 -19
@@ -50,30 +50,15 @@ static uint64_t get_msr(int cpu, uint64_t offset) { ssize_t retval; uint64_t msr; - int fd; - char msr_path[256]; - fd = sprintf(msr_path, "/dev/cpu/%d/msr", cpu); - - if (access(msr_path, R_OK) != 0){ - fd = sprintf(msr_path, "/dev/msr%d", cpu); - - if (access(msr_path, R_OK) != 0){ - fprintf(stderr, _("Model-specific registers (MSR) not found (try enabling CONFIG_X86_MSR).\n")); - exit(-2); - } - } - - fd = open(msr_path, O_RDONLY); - - retval = pread(fd, &msr, sizeof msr, offset); - if (retval != sizeof msr) { + retval = read_msr(cpu, offset, &msr); + if (retval < 0) { reset_display(); - fprintf(stderr, _("pread cpu%d 0x%llx : "), cpu, (unsigned long long)offset); + fprintf(stderr, _("read_msr cpu%d 0x%llx : "), cpu, (unsigned long long)offset); fprintf(stderr, "%s\n", strerror(errno)); exit(-2); } - close(fd); + return msr; }
Signature · 1 line
1.7.11.7
Srinivas Pandruvada
PATCH 3/8 RAPL Interface
In reply to Srinivas PandruvadaAdded RAPL interface class. This provides methods to get the status of RAPL domains and get energy and power status.
--- src/Makefile.am | 3 +- src/cpu/rapl/rapl_interface.cpp | 611 ++++++++++++++++++++++++++++++++++++++++ src/cpu/rapl/rapl_interface.h | 85 ++++++ 3 files changed, 698 insertions(+), 1 deletion(-) create mode 100644 src/cpu/rapl/rapl_interface.cpp create mode 100644 src/cpu/rapl/rapl_interface.h
src/Makefile.am +2 -1
@@ -31,7 +31,8 @@ powertop_SOURCES = parameters/persistent.cpp parameters/learn.cpp parameters/par report/report-formatter-base.cpp report/report-formatter-base.h \ report/report-formatter-csv.cpp report/report-formatter-csv.h \ report/report-formatter-html.cpp report/report-formatter-html.h \ - main.cpp css.h powertop.css cpu/intel_gpu.cpp + main.cpp css.h powertop.css cpu/intel_gpu.cpp \ + cpu/rapl/rapl_interface.cpp powertop_CXXFLAGS = -fno-omit-frame-pointer -fstack-protector -Wall -Wshadow -Wformat $(NCURSES_CFLAGS) $(PCIUTILS_CFLAGS) $(LIBNL_CFLAGS) $(GLIB2_CFLAGS)
src/cpu/rapl/rapl_interface.cpp new file +611 -0
611 lines not on this page · raw message
src/cpu/rapl/rapl_interface.h new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
1.7.11.7
Srinivas Pandruvada
PATCH 4/8 cpu device as parent class
In reply to Srinivas PandruvadaAdded members and methods so that it can have children. Other cpu type device can inherit and overide functionality.
If there are children, the power_usage method will not include the power reported by children, as they will be reporting as its own device.
--- src/cpu/cpudevice.cpp | 14 ++++++++++++++ src/cpu/cpudevice.h | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-)
src/cpu/cpudevice.cpp +14 -0
@@ -40,12 +40,20 @@ cpudevice::cpudevice(const char *classname, const char *dev_name, class abstract r_consumption_index = get_result_index("cpu-consumption");; } +const char * cpudevice::device_name(void) +{ + if (child_devices.size()) + return "CPU misc"; + else + return "CPU use"; +} double cpudevice::power_usage(struct result_bundle *result, struct parameter_bundle *bundle) { double power; double factor; double _utilization; + double child_power; power = 0; factor = get_parameter_value(wake_index, bundle);
@@ -58,6 +66,12 @@ double cpudevice::power_usage(struct result_bundle *result, struct parameter_bun power += _utilization * factor; + for (unsigned int i = 0; i < child_devices.size(); ++i) { + child_power = child_devices[i]->power_usage(result, bundle); + if ((power - child_power) > 0.0) + power -= child_power; + } + return power; }
src/cpu/cpudevice.h +5 -1
@@ -34,6 +34,7 @@ using namespace std;#include "cpu.h" class cpudevice: public device { +protected:char _class[128 ];char _cpuname[128 ];
@@ -44,15 +45,18 @@ class cpudevice: public device {int r_wake_index;int r_consumption_index; + vector<device *>child_devices; + public: cpudevice(const char *classname = "cpu", const char *device_name = "cpu0", class abstract_cpu *_cpu = NULL); virtual const char * class_name(void) { return _class;}; - virtual const char * device_name(void) {return "CPU use";}; + virtual const char * device_name(void); virtual double power_usage(struct result_bundle *result, struct parameter_bundle *bundle); virtual bool show_in_list(void) {return false;}; virtual double utilization(void); /* percentage */ +void add_child (device *dev_ptr) { child_devices.push_back (dev_ptr);} };
Signature · 1 line
1.7.11.7
Srinivas Pandruvada
PATCH 5/8 Interface to get first cpu
In reply to Srinivas PandruvadaAdded get interface to get the first cpu number for this cpu device.
--- src/cpu/cpu.h | 1 + 1 file changed, 1 insertion(+)
src/cpu/cpu.h +1 -0
@@ -105,6 +105,7 @@ public: class abstract_cpu *parent; +int get_first_cpu () {return first_cpu; }void set_number (int _number,int cpu) {this->number = _number; this->first_cpu = cpu;};void set_type (const char * _name) {this->name = _name;};int get_number (void ) {return number; };
Signature · 1 line
1.7.11.7
Srinivas Pandruvada
PATCH 6/8 Added PP0 RAPL domain for CPU
In reply to Srinivas PandruvadaAdded PP0 RAPL domain as core CPU power. This will display as "cpu core" in the device stats.
--- src/Makefile.am | 2 +- src/cpu/cpu.cpp | 9 ++++++ src/cpu/cpu_rapl_device.cpp | 74 +++++++++++++++++++++++++++++++++++++++++++++ src/cpu/cpu_rapl_device.h | 57 ++++++++++++++++++++++++++++++++++ 4 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 src/cpu/cpu_rapl_device.cpp create mode 100644 src/cpu/cpu_rapl_device.h
src/Makefile.am +1 -1
@@ -32,7 +32,7 @@ powertop_SOURCES = parameters/persistent.cpp parameters/learn.cpp parameters/par report/report-formatter-csv.cpp report/report-formatter-csv.h \ report/report-formatter-html.cpp report/report-formatter-html.h \ main.cpp css.h powertop.css cpu/intel_gpu.cpp \ - cpu/rapl/rapl_interface.cpp + cpu/rapl/rapl_interface.cpp cpu/cpu_rapl_device.cpp powertop_CXXFLAGS = -fno-omit-frame-pointer -fstack-protector -Wall -Wshadow -Wformat $(NCURSES_CFLAGS) $(PCIUTILS_CFLAGS) $(LIBNL_CFLAGS) $(GLIB2_CFLAGS)
src/cpu/cpu.cpp +9 -0
@@ -31,6 +31,7 @@ #include <unistd.h> #include "cpu.h" #include "cpudevice.h" +#include "cpu_rapl_device.h" #include "intel_cpus.h" #include "../parameters/parameters.h"
@@ -59,6 +60,8 @@ static class abstract_cpu * new_package(int package, int cpu, char * vendor, int { class abstract_cpu *ret = NULL; class cpudevice *cpudev; + class cpu_rapl_device *cpu_rapl_dev; + char packagename[128]; if (strcmp(vendor, "GenuineIntel") == 0) { if (family == 6)
@@ -99,6 +102,12 @@ static class abstract_cpu * new_package(int package, int cpu, char * vendor, int sprintf(packagename, _("cpu package %i"), cpu); cpudev = new class cpudevice(_("cpu package"), packagename, ret); all_devices.push_back(cpudev); + + sprintf(packagename, _("cpu rapl package %i"), cpu); + cpu_rapl_dev = new class cpu_rapl_device(cpudev, _("cpu rapl package"), packagename, ret); + if (cpu_rapl_dev->device_present()) + all_devices.push_back(cpu_rapl_dev); + return ret; }
src/cpu/cpu_rapl_device.cpp new file +74 -0
74 lines not on this page · raw message
src/cpu/cpu_rapl_device.h new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
1.7.11.7
Srinivas Pandruvada
PATCH 7/8 Add RAPL DRAM domain
In reply to Srinivas PandruvadaAdded DRAM RAPL domain as core CPU power. This will display as "DRAM" in the device stats, if present.
--- src/Makefile.am | 3 +- src/cpu/cpu.cpp | 7 +++++ src/cpu/dram_rapl_device.cpp | 75 ++++++++++++++++++++++++++++++++++++++++++++ src/cpu/dram_rapl_device.h | 57 +++++++++++++++++++++++++++++++++ 4 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 src/cpu/dram_rapl_device.cpp create mode 100644 src/cpu/dram_rapl_device.h
src/Makefile.am +2 -1
@@ -32,7 +32,8 @@ powertop_SOURCES = parameters/persistent.cpp parameters/learn.cpp parameters/par report/report-formatter-csv.cpp report/report-formatter-csv.h \ report/report-formatter-html.cpp report/report-formatter-html.h \ main.cpp css.h powertop.css cpu/intel_gpu.cpp \ - cpu/rapl/rapl_interface.cpp cpu/cpu_rapl_device.cpp + cpu/rapl/rapl_interface.cpp cpu/cpu_rapl_device.cpp \ + cpu/dram_rapl_device.cpp powertop_CXXFLAGS = -fno-omit-frame-pointer -fstack-protector -Wall -Wshadow -Wformat $(NCURSES_CFLAGS) $(PCIUTILS_CFLAGS) $(LIBNL_CFLAGS) $(GLIB2_CFLAGS)
src/cpu/cpu.cpp +7 -0
@@ -32,6 +32,7 @@ #include "cpu.h" #include "cpudevice.h" #include "cpu_rapl_device.h" +#include "dram_rapl_device.h" #include "intel_cpus.h" #include "../parameters/parameters.h"
@@ -61,6 +62,7 @@ static class abstract_cpu * new_package(int package, int cpu, char * vendor, int class abstract_cpu *ret = NULL; class cpudevice *cpudev; class cpu_rapl_device *cpu_rapl_dev; + class dram_rapl_device *dram_rapl_dev; char packagename[128]; if (strcmp(vendor, "GenuineIntel") == 0) {
@@ -108,6 +110,11 @@ static class abstract_cpu * new_package(int package, int cpu, char * vendor, int if (cpu_rapl_dev->device_present()) all_devices.push_back(cpu_rapl_dev); + sprintf(packagename, _("dram rapl package %i"), cpu); + dram_rapl_dev = new class dram_rapl_device(cpudev, _("dram rapl package"), packagename, ret); + if (dram_rapl_dev->device_present()) + all_devices.push_back(dram_rapl_dev); + return ret; }
src/cpu/dram_rapl_device.cpp new file +75 -0
75 lines not on this page · raw message
src/cpu/dram_rapl_device.h new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
1.7.11.7
Srinivas Pandruvada
PATCH 8/8 Add RAPL PP1 domain for GPU
In reply to Srinivas PandruvadaAdded RAPL PP1 domain as GPU core power. This will show "GPU misc" and "GPU core" in device stats, if PP1 domain is present.
--- src/Makefile.am | 2 +- src/devices/gpu_rapl_device.cpp | 70 +++++++++++++++++++++++++++++++++++++++++ src/devices/gpu_rapl_device.h | 57 +++++++++++++++++++++++++++++++++ src/devices/i915-gpu.cpp | 21 +++++++++++++ src/devices/i915-gpu.h | 6 +++- 5 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 src/devices/gpu_rapl_device.cpp create mode 100644 src/devices/gpu_rapl_device.h
src/Makefile.am +1 -1
@@ -33,7 +33,7 @@ powertop_SOURCES = parameters/persistent.cpp parameters/learn.cpp parameters/par report/report-formatter-html.cpp report/report-formatter-html.h \ main.cpp css.h powertop.css cpu/intel_gpu.cpp \ cpu/rapl/rapl_interface.cpp cpu/cpu_rapl_device.cpp \ - cpu/dram_rapl_device.cpp + cpu/dram_rapl_device.cpp devices/gpu_rapl_device.cpp powertop_CXXFLAGS = -fno-omit-frame-pointer -fstack-protector -Wall -Wshadow -Wformat $(NCURSES_CFLAGS) $(PCIUTILS_CFLAGS) $(LIBNL_CFLAGS) $(GLIB2_CFLAGS)
src/devices/gpu_rapl_device.cpp new file +70 -0
70 lines not on this page · raw message
src/devices/gpu_rapl_device.h new file +57 -0
57 lines not on this page · raw message
src/devices/i915-gpu.cpp +21 -0
@@ -37,6 +37,7 @@ using namespace std; #include "i915-gpu.h" #include "../parameters/parameters.h" #include "../process/powerconsumer.h" +#include "gpu_rapl_device.h" #include <string.h> #include <unistd.h>
@@ -47,6 +48,14 @@ i915gpu::i915gpu(): device() rindex = get_result_index("gpu-operations"); } +const char * i915gpu::device_name(void) +{ + if (child_devices.size()) + return "GPU misc"; + else + return "GPU"; +} + void i915gpu::start_measurement(void) { }
@@ -66,6 +75,7 @@ void create_i915_gpu(void) { char filename[4096]; class i915gpu *gpu; + gpu_rapl_device *rapl_dev; strcpy(filename, "/sys/kernel/debug/tracing/events/i915/i915_gem_ring_dispatch/format");
@@ -80,6 +90,10 @@ void create_i915_gpu(void) gpu = new class i915gpu(); all_devices.push_back(gpu); + + rapl_dev = new class gpu_rapl_device(gpu); + if (rapl_dev->device_present()) + all_devices.push_back(rapl_dev); }
@@ -89,11 +103,18 @@ double i915gpu::power_usage(struct result_bundle *result, struct parameter_bundl double power; double factor; double util; + double child_power; power = 0; factor = get_parameter_value(index, bundle); util = get_result_value(rindex, result); power += util * factor / 100.0; + for (unsigned int i = 0; i < child_devices.size(); ++i) { + child_power = child_devices[i]->power_usage(result, bundle); + if ((power - child_power) > 0.0) + power -= child_power; + } + return power; }
src/devices/i915-gpu.h +5 -1
@@ -31,6 +31,8 @@ class i915gpu: public device {int index;int rindex; + vector<device *>child_devices; + public:i915gpu ();
@@ -42,10 +44,12 @@ public: virtual const char * class_name(void) { return "GPU";}; - virtual const char * device_name(void) { return "GPU";}; + virtual const char * device_name(void); virtual double power_usage(struct result_bundle *result, struct parameter_bundle *bundle); virtual bool show_in_list(void) {return false;}; virtual const char * util_units(void) { return " ops/s"; }; + + virtual void add_child(device *dev_ptr) { child_devices.push_back(dev_ptr);} };extern void create_i915_gpu (void );
Signature · 1 line
1.7.11.7
Sergey Senozhatsky
Quoted 10 lines · Srinivas Pandruvada
This patch adds RAPL interface to powertop. RAPL can give energy consumed for a domain. For client platform, domain are "PKG", "PP0" and "PP1". For servers "PKG", "DRAM" and "PP0". PP0 refers to CPU energy comsumtion and PP1 refers to GPUs. DRAM is for DRAM in servers only.
Powertop estimates how much power CPU and GPU is consuming based on the measured power and load. This patch splits this into the following:
- Actual CPU/GPU power reported by RAPL
- DRAM power for servers
- Remaining as "misc" usage for CPU/GPU
Quoted 4 lines
As more domain are getting added, this patch creates a parent/child relationship for CPU/GPU. This way when new domains are added these files don't need change. Only inherit CPU/GPU class, and implement virtual method for consumed power.
Hello,
looks good to me. thanks.
any objections/inputs/etc. from list members are welcomed.
-ss
Quoted 61 lines
v04 changes:
Rebase with the latest git tree
Add MSR access error message from previous commit to lib.cpp MSR api "_("Model-specific registers (MSR) not found (try enablingCONFIG_X86_MSR)"v03 changes:
close fd when pread/pwrite fails.v02 changes:
Addressed review comments
Moved MSR handling to library
Added interface to get the first CPU in a package Fix error in reading RAPL when system has multiple packagesSrinivas Pandruvada (8):
Common read/write MSR API
Use MSR Lib MSR functions
RAPL Interface
cpu device as parent class
Interface to get first cpu
Added PP0 RAPL domain for CPU
Add RAPL DRAM domain
Add RAPL PP1 domain for GPUsrc/Makefile.am | 4 +- src/cpu/cpu.cpp | 16 ++ src/cpu/cpu.h | 1 + src/cpu/cpu_rapl_device.cpp | 74 +++++ src/cpu/cpu_rapl_device.h | 57 ++++ src/cpu/cpudevice.cpp | 14 + src/cpu/cpudevice.h | 6 +- src/cpu/dram_rapl_device.cpp | 75 +++++ src/cpu/dram_rapl_device.h | 57 ++++ src/cpu/intel_cpus.cpp | 23 +- src/cpu/rapl/rapl_interface.cpp | 611 ++++++++++++++++++++++++++++++++++++++++ src/cpu/rapl/rapl_interface.h | 85 ++++++ src/devices/gpu_rapl_device.cpp | 70 +++++ src/devices/gpu_rapl_device.h | 57 ++++ src/devices/i915-gpu.cpp | 21 ++ src/devices/i915-gpu.h | 6 +- src/lib.cpp | 65 +++++ src/lib.h | 3 +- 18 files changed, 1222 insertions(+), 23 deletions(-) create mode 100644 src/cpu/cpu_rapl_device.cpp create mode 100644 src/cpu/cpu_rapl_device.h create mode 100644 src/cpu/dram_rapl_device.cpp create mode 100644 src/cpu/dram_rapl_device.h create mode 100644 src/cpu/rapl/rapl_interface.cpp create mode 100644 src/cpu/rapl/rapl_interface.h create mode 100644 src/devices/gpu_rapl_device.cpp create mode 100644 src/devices/gpu_rapl_device.hSignature · 6 lines
1.7.11.7 _______________________________________________ PowerTop mailing list PowerTop(a)lists.01.org https://lists.01.org/mailman/listinfo/powertop
Kristen Carlson Accardi
AppliedQuoted 16 lines · On Mon, 15 Apr 2013 23:35:43 +0300 Sergey Senozhatsky…
Quoted 10 lines · Srinivas Pandruvada
This patch adds RAPL interface to powertop. RAPL can give energy consumed for a domain. For client platform, domain are "PKG", "PP0" and "PP1". For servers "PKG", "DRAM" and "PP0". PP0 refers to CPU energy comsumtion and PP1 refers to GPUs. DRAM is for DRAM in servers only.
Powertop estimates how much power CPU and GPU is consuming based on the measured power and load. This patch splits this into the following:
- Actual CPU/GPU power reported by RAPL
- DRAM power for servers
- Remaining as "misc" usage for CPU/GPUQuoted 4 lines
As more domain are getting added, this patch creates a parent/child relationship for CPU/GPU. This way when new domains are added these files don't need change. Only inherit CPU/GPU class, and implement virtual method for consumed power.
Quoted 8 lines
Hello,
looks good to me. thanks.any objections/inputs/etc. from list members are welcomed.
-ss
Applied.
Thanks!