pull request
Sergey Senozhatsky
cover pull request
Hello,
two patches are in -next, fixing Android build errors and IE html report rendering.
thanks to Sanjay Singh Rawat and Alexandra Yates.
please pull from -next
git(a)github.com:sergey-senozhatsky/powertop2-next.git
Sanjay Singh Rawat (1):
resolve android build errors
Sergey Senozhatsky (1):
html report: fix IE compatibility errors
Android.mk | 4 ++++ src/cpu/rapl/rapl_interface.cpp | 6 +++--- src/powertop.css | 19 ++++++++++++++----- 3 files changed, 21 insertions(+), 8 deletions(-)
Signature · 1 line
1.8.4.1.780.ga09e2a8
Sergey Senozhatsky
PATCH 1/2 resolve android build errors
From: Sanjay Singh Rawat <sanjay.rawat(a)linaro.org>
- for android receiving compilation error
rapl_interface.cpp:195:40: error: call of overloaded 'pow(int, uint64_t)' is ambiguous
include/math.h:222:8: note: double pow(double, double). stlport/stlport/stl/_cmath.h:453:24: note: float pow(float, float)
- these files are missing in the android makefile
--- Android.mk | 4 ++++ src/cpu/rapl/rapl_interface.cpp | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-)
Android.mk +4 -0
@@ -31,6 +31,9 @@ LOCAL_SRC_FILES += \ src/cpu/cpu_core.cpp \ src/cpu/cpu_package.cpp \ src/cpu/abstract_cpu.cpp \ + src/cpu/cpu_rapl_device.cpp \ + src/cpu/dram_rapl_device.cpp \ + src/cpu/rapl/rapl_interface.cpp \ src/measurement/measurement.cpp \ src/measurement/acpi.cpp \ src/measurement/extech.cpp \
@@ -62,6 +65,7 @@ LOCAL_SRC_FILES += \ src/devices/backlight.cpp \ src/devices/network.cpp \ src/devices/device.cpp \ + src/devices/gpu_rapl_device.cpp \ src/devlist.cpp \ src/calibrate/calibrate.cpp \ src/lib.cpp \
src/cpu/rapl/rapl_interface.cpp +3 -3
@@ -192,7 +192,7 @@ double c_rapl_interface::get_power_unit() return ret; } - return (double) 1/pow(2, value & 0xf); + return (double) 1/pow((double)2, (double)(value & 0xf)); } double c_rapl_interface::get_energy_status_unit()
@@ -206,7 +206,7 @@ double c_rapl_interface::get_energy_status_unit() return ret; } - return (double)1/ pow(2, (value & 0x1f00) >> 8); + return (double)1/ pow((double)2, (double)((value & 0x1f00) >> 8)); } double c_rapl_interface::get_time_unit()
@@ -220,7 +220,7 @@ double c_rapl_interface::get_time_unit() return ret; } - return (double)1 / pow(2, (value & 0xf0000) >> 16); + return (double)1 / pow((double)2, (double)((value & 0xf0000) >> 16)); } int c_rapl_interface::get_pkg_energy_status(double *status)
Signature · 1 line
1.8.4.1.780.ga09e2a8
Sergey Senozhatsky
PATCH 2/2 html report: fix IE compatibility errors
In reply to Sergey SenozhatskyAlexandra Yates reported that c8a9e53854ad672529bee73a31c9c25382089ec8 broke IE (v8 - v10) compatibility.
the following issues were addressed:
-- IE up to v10 does not support object classList. workaround by manual className manipulation.
-- IE has issues with textContent in some versions. workaround by setting innerText.
Reported-and-tested-by: Alexandra Yates <alexandra.yates(a)intel.com>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
--- src/powertop.css | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
src/powertop.css +14 -5
@@ -17,20 +17,29 @@ var powertop = { }, cadd: function(idx, c){ var el = document.getElementById(idx); - if (el) - el.classList.add(c); - + if (el) { + var cn = el.className; + if (cn.indexOf(c) != -1) + return; + cn += ' ' + c; + el.className = cn; + } }, crm: function(id, c){ var el = document.getElementById(id); - if (el) - el.classList.remove(c); + if (el) { + var cn = el.className + while (cn.indexOf(' ' + c) != -1) + cn = cn.replace(' ' + c,''); + el.className = cn; + } }, newbutton: function(id, txt) { var x = document.createElement('div'); x.id = id + '_button'; x.className = 'nav_button'; x.textContent = txt; + x.innerText = txt; x.onclick = function() { powertop.toggle(id); }; return x; },
Signature · 1 line
1.8.4.1.780.ga09e2a8