A series of patches towards limiting memory corruption and foot print
by Kalowsky, Daniel
Hi Powertop,
I've been working with the interactive mode and have run into cases where powertop will crash due to a series of memory corruptions. The following series of patches have helped to reduce the frequency of the issue, although not completely solved it. The issues arise much faster on platforms where there are constrained amounts of RAM to work within.
Patch 1 - When shutting down the interactive display, the display bits of memory is not correctly released. This patch provides a method for correctly doing so.
Patch 2 - Solving a documented memory leak with a non-elegant solution. The path either adds the bundle to the stack, or it forgets about it. If it is forgotten about, make sure to clear that memory before moving on. This is done with a simple flag variable being set.
Patch 3 - When the tuning window is updated, the current pointer is just set adrift and not properly free'd. This patch catches that issue and removes the dangling pointer by holding a reference to the pointer until it is reset or specifically free'd.
Patch 4 - Someone actually added in the code to create a onetime pretty-print array, this patch just puts it to use by setting the variable.
Patch 5 - Limiting the buffer copy to the size of the allocated buffer with snprintf.
Patch 6 - There exist some processes and entries that can and do extend beyond the length of these buffers. This limits those entries so as not to corrupt other memory on the system when in interactive mode.
Patch 7 - This is an untested patch, but follows along the same lines of Patch 6. It applies the same principals only for the report method.
Patch 8 - Creates a clean_shutdown function that can be used to cleanup the memory space at shutdown time. Calls upon parts of Patch 1 to make this happen.
There will more than likely be some more patches in the future as time permits.
7 years, 8 months
[Announce] PowerTOP v2.6.1 released
by Alexandra Yates
We are pleased to announce the release of PowerTOP v2.6.1
About PowerTOP
PowerTOP is a Linux tool to diagnose issues with power consumption and
power management. In addition to being a diagnostic tool, PowerTOP also
has an interactive mode you can use to experiment with various power
management settings, for cases where the Linux distribution has not
enabled those settings.
PowerTOP reports which components in the system are most likely to blame
for higher-than-needed power consumption, ranging from software
applications to active components in the system. Detailed screens are
available for CPU C and P states, device activity, and software activity.
For many years, PowerTOP has been used heavily by Intel, Linux
distributors, and various parts of the open source community.
Fixes
Segmentation faults with PowerTOP2.6 reported by Julian Wollrath
<jwollrath(a)web.de>
Packaging issues reported by Julian Wollrath <jwollrath(a)web.de>
Thank you to everyone who contributed to this release!
Alexandra Yates (3):
Bug-fix:Seg-fault with powertop --html & --csv
Update translation files and configuration
PowerTOP version 2.6.1
Thank you,
Alexandra.
8 years, 1 month
[Announce] News of PowerTOP
by Alexandra Yates
Here is an interesting article about PowerTop:
http://www.phoronix.com/scan.php?page=article&item=ubuntu_1404_powertop&n...
The conclusion page 4:
while running these various benchmarks and its many periods of idling,
there's still a clear win for PowerTOP
the average power consumption dropped from 25.6 Watts to 22.9 Watts [
]
The peak power [
] from 34.6 Watts to 32.0 Watts. [
] when the system was
idling went from 12 Watts to 10 Watts. These power-savings happened
without regressing the Linux system performance at all.
Thank you,
Alexandra.
8 years, 1 month
[Announce] PowerTOP v2.6.1 released]
by Alexandra Yates
We are pleased to announce the release of PowerTOP v2.6.1
About PowerTOP
PowerTOP is a Linux tool to diagnose issues with power consumption and
power management. In addition to being a diagnostic tool, PowerTOP also
has an interactive mode you can use to experiment with various power
management settings, for cases where the Linux distribution has not
enabled those settings.
PowerTOP reports which components in the system are most likely to blame
for higher-than-needed power consumption, ranging from software
applications to active components in the system. Detailed screens are
available for CPU C and P states, device activity, and software activity.
For many years, PowerTOP has been used heavily by Intel, Linux
distributors, and various parts of the open source community.
Fixes
Segmentation faults with PowerTOP2.6 reported by Julian Wollrath
<jwollrath(a)web.de>
Packaging issues reported by Julian Wollrath <jwollrath(a)web.de>
Thank you to everyone who contributed to this release!
Alexandra Yates (3):
Bug-fix:Seg-fault with powertop --html & --csv
Update translation files and configuration
PowerTOP version 2.6.1
Thank you,
Alexandra.
Thank you,
Alexandra.
8 years, 1 month
[Fwd: [PATCH] Bug-fix:Segmentation fault with powertop --html]
by Alexandra Yates
---------------------------- Original Message ----------------------------
Subject: [PATCH] Bug-fix:Segmentation fault with powertop --html
From: "Alexandra Yates" <alexandra.yates(a)linux.intel.com>
Date: Thu, May 22, 2014 4:19 pm
To: jwollrath(a)web.de
powertop-dev(a)linux.intel.com
Cc: "Alexandra Yates" <alexandra.yates(a)linux.intel.com>
--------------------------------------------------------------------------
Hi Julian,
Please test with this new patch. I left out one line on my previous
submission which caused the later segfault.
thank you,
Alexandra Yates (1):
Bug-fix:Seg-fault with powertop --html & --csv
src/cpu/cpu.cpp | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
--
1.7.9.5
Thank you,
Alexandra.
8 years, 1 month
[Fwd: [PATCH] Bug-fix:Seg-fault with powertop --html & --csv]
by Alexandra Yates
---------------------------- Original Message ----------------------------
Subject: [PATCH] Bug-fix:Seg-fault with powertop --html & --csv
From: "Alexandra Yates" <alexandra.yates(a)linux.intel.com>
Date: Thu, May 22, 2014 4:19 pm
To: jwollrath(a)web.de
powertop-dev(a)linux.intel.com
Cc: "Alexandra Yates" <alexandra.yates(a)linux.intel.com>
--------------------------------------------------------------------------
This patch allows the supported no Intel CPUs to be included on html &
CSV reports. It fixes the rows index needed for package data.
Additionally, fixes the calculation of title indexes when cores are absent
from the CPU. These changes are related to C-states and P-states
reports
Bug reported & tested by: Julian Wollrath <jwollrath(a)web.de>
Signed-off-by: Alexandra Yates <alexandra.yates(a)linux.intel.com>
---
src/cpu/cpu.cpp | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp
index 0a7c487..b3b6166 100644
--- a/src/cpu/cpu.cpp
+++ b/src/cpu/cpu.cpp
@@ -466,7 +466,7 @@ void report_display_cpu_cstates(void)
continue;
/* Tables for PKG, CORE, CPU */
pkg_tbl_size.cols=2;
- pkg_tbl_size.rows= cstates_num+1;
+ pkg_tbl_size.rows= ((cstates_num+1)-LEVEL_HEADER)+1;
string pkg_data[pkg_tbl_size.cols * pkg_tbl_size.rows];
core_tbl_size.cols=2;
@@ -491,11 +491,9 @@ void report_display_cpu_cstates(void)
num_cpus+=1;
}
}
-
cpu_tbl_size.cols=(2 * (num_cpus / num_cores)) + 1;
- cpu_tbl_size.rows = (cstates_num * _package->children.size())
+ cpu_tbl_size.rows = ((cstates_num+1-LEVEL_HEADER) *
_package->children.size())
+ _package->children.size();
-
string cpu_data[cpu_tbl_size.cols * cpu_tbl_size.rows];
for (core = 0; core < _package->children.size(); core++) {
@@ -608,12 +606,18 @@ void report_display_cpu_cstates(void)
}
/* Report Output */
- title=title/core_num;
+ if(core_num > 0)
+ title=title/core_num;
+ else if( _core->children.size() > 0)
+ title=title/_core->children.size();
+
init_pkg_table_attr(&std_table_css, pkg_tbl_size.rows,
pkg_tbl_size.cols);
report.add_table(pkg_data, &std_table_css);
- init_core_table_attr(&std_table_css, title+1, core_tbl_size.rows,
+ if (!_core->can_collapse()){
+ init_core_table_attr(&std_table_css, title+1, core_tbl_size.rows,
core_tbl_size.cols);
- report.add_table(core_data, &std_table_css);
+ report.add_table(core_data, &std_table_css);
+ }
init_cpu_table_attr(&std_table_css, title+1, cpu_tbl_size.rows,
cpu_tbl_size.cols);
report.add_table(cpu_data, &std_table_css);
@@ -625,7 +629,7 @@ void report_display_cpu_pstates(void)
{
char buffer[512], buffer2[512], tmp_num[50];
unsigned int package, core, cpu;
- int line;
+ int line, title=0;
class abstract_cpu *_package, * _core, * _cpu;
unsigned int i, pstates_num;
const char* core_type = NULL;
@@ -671,7 +675,7 @@ void report_display_cpu_pstates(void)
/* Tables for PKG, CORE, CPU */
pkg_tbl_size.cols=2;
- pkg_tbl_size.rows=pstates_num+2;
+ pkg_tbl_size.rows=((pstates_num+1)-LEVEL_HEADER)+2;
string pkg_data[pkg_tbl_size.cols * pkg_tbl_size.rows];
core_tbl_size.cols=2;
@@ -790,10 +794,16 @@ void report_display_cpu_pstates(void)
}
init_pkg_table_attr(&std_table_css, pkg_tbl_size.rows, pkg_tbl_size.cols);
report.add_table(pkg_data, &std_table_css);
- init_core_table_attr(&std_table_css, (pstates_num+2),
+ if(!_core->can_collapse()){
+ title=pstates_num+2;
+ init_core_table_attr(&std_table_css, title,
core_tbl_size.rows, core_tbl_size.cols);
- report.add_table(core_data, &std_table_css);
- init_cpu_table_attr(&std_table_css, (pstates_num+2),
+ report.add_table(core_data, &std_table_css);
+ } else {
+ title=pstates_num+1;
+ }
+
+ init_cpu_table_attr(&std_table_css, title,
cpu_tbl_size.rows, cpu_tbl_size.cols);
report.add_table(cpu_data, &std_table_css);
}
--
1.7.9.5
Thank you,
Alexandra.
8 years, 1 month
[PATCH] Bug-fix:Segmentation fault with powertop --html
by Alexandra Yates
This patch fixes the segmentation fault erros seen in powertop --html.
Reported by: Julian Wollrath" <jwollrath(a)web.de>
Julian can you test the patch please. thank you. AY.
Alexandra Yates (1):
Bug-fix: html & csv report core indexes
src/cpu/cpu.cpp | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
--
1.7.9.5
8 years, 1 month
Segmentation fault with powertop --html
by Julian Wollrath
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hello,
I get a segmentation fault with powertop 2.6 if I want to generate an
HTML report:
$ powertop --html
Loaded 750 prior measurements
RAPL device for cpu 0
RAPL device for cpu 0
Preparing to take measurements
unknown op '{'
[1] 5221 segmentation fault (core dumped) powertop --html
Backtrace:
Core was generated by `powertop --html'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f9f6d52019f in std::string::assign(std::string const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20-gdb.py", line 59, in <module>
from libstdcxx.v6.printers import register_libstdcxx_printers
File "/usr/lib/x86_64-linux-gnu/../../share/gcc-4.9/python/libstdcxx/v6/printers.py", line 392
raise ValueError, "Unsupported implementation for %s" % str(node.type)
^
SyntaxError: invalid syntax
(gdb) backtrace
#0 0x00007f9f6d52019f in std::string::assign(std::string const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00000000004114ae in operator= (__str=..., this=0x7fff595c2408) at /usr/include/c++/4.8/bits/basic_string.h:547
#2 report_display_cpu_cstates () at cpu/cpu.cpp:529
#3 0x0000000000449374 in one_measurement (seconds=seconds@entry=1, workload=workload@entry=0x0) at main.cpp:221
#4 0x00000000004495c2 in make_report (time=20, workload=workload@entry=0x7fff595c3b30 "", iterations=iterations@entry=1, file=file@entry=0x7fff595c2b30 "powertop.html") at main.cpp:254
#5 0x000000000040741d in main (argc=2, argv=0x7fff595c4c58) at
main.cpp:441
If you need more information, I will happily provide it.
Cheers,
Julian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQEcBAEBCAAGBQJTdzIcAAoJEFl2dmpRMS8zquMH/2ptSBMoONcu43sGbWCmAUDu
7a5xx4O6YcFHG76kuUDnJVwMQLwEx76C79uprX5jyVtAoi2k+houA3Q+xABWAN6j
K545qbTCd7InVzByHifWm967pwPqZeFan5/SInjo3JpIuaQSCRI7SKwpmmbjZ62l
9tmFMxuXMUg9+92imrHWu4R16t6j25cAfOaIOwi0LJio92fWxXlshhXDnW0YJKJw
Q7Ojs/GvrfJ4nPJIcvigxQP4Ekn1S0otohhhMcfETc0kq/BfF6o2DFTbWVk2J2yv
zTazI253O1wIY5AN9ePkw8+/nZmvG42vC63ZE8WELN7KLy/C0OI3iA+Z53Zw+iA=
=HWSf
-----END PGP SIGNATURE-----
8 years, 1 month
[Announce] PowerTOP v2.6 released
by Alexandra Yates
PowerTOP v2.6 Release
We are pleased to announce the release of PowerTOP v2.6.
About PowerTOP
PowerTOP is a Linux tool to diagnose issues with power consumption and
power management. In addition to being a diagnostic tool, PowerTOP also
has an interactive mode you can use to experiment with various power
management settings, for cases where the Linux distribution has not
enabled those settings.
PowerTOP reports which components in the system are most likely to blame
for higher-than-needed power consumption, ranging from software
applications to active components in the system. Detailed screens are
available for CPU C and P states, device activity, and software activity.
For many years, PowerTOP has been used heavily by Intel, Linux
distributors, and various parts of the open source community.
Highlights
* Changed Look and feel of HTML report
* Allow compilation with C++11
* Several bug fixes
Thank you to everyone who contributed to this release!
The complete release notes are listed at:
https://01.org/powertop/blogs/ayates1/2014/powertop-v2.6-released
Thank you,
Alexandra.
8 years, 1 month