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.
-----BEGIN PGP SIGNED MESSAGE-----
Original bug report: https://bugs.gentoo.org/show_bug.cgi?id=486124
Depending on how ncurses is built, it may require different information
passed to the linker. Use pkg-config to detect the correct information:
- --- a/configure.ac
@@ -46,7 +46,7 @@
AC_CHECK_FUNCS([fdatasync getpagesize gettimeofday memmove memset mkdir
munmap pow realpath regcomp select setlocale socket sqrt strcasecmp
strchr strdup strerror strncasecmp strstr strtoul strtoull])
- -AC_SEARCH_LIBS([delwin], [ncursesw ncurses], , AC_MSG_ERROR([ncurses
is required but was not found]), )
+PKG_CHECK_MODULES(ncurses, ncurses, [LIBS="$LIBS $ncurses_LIBS"],
AC_MSG_ERROR([ncurses is required but was not found]))
Please include this fix.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
-----END PGP SIGNATURE-----
I'm holding up release for the time being, there are a couple of bugs that
need to be workout before release.
> Here are results of PowerTop 2.6 rc1 validation.
> Results seem bad but most of reported bugs deal with cosmetic.
> The most serious problem appears when trying to reach the deeper state and
> only stats for Core C7 state are reported.
> Not run
> Run rate
> Not run
> PowerTop 2.6: 8f56e9f12f66e13f602eb436d9c53614d6816253 from
> Linux distribution: Ubuntu 13.10 64 bits
> Kernel 3.14.0 from
> Duration of measurement is not indicated in report
> Several warnings when compiling PowerTop
> System out of order when enabling SATA link power management for hosts
> PowerTop must be launched twice to see correct AHCI ALPM Residency
> PowerTop logo is missing in html report when created outside source folder
> "Not Applicable" can be displayed in the product name
> CSV report contains an error 510
> Some cells are not in the appropriate column when device name contains a
> Section "Process Device Activity" is not well aligned
> W3C validator "Markup Validation Service" returns one error
> W3C validator "CSS Validation Service" returns one error and five warnings
> Wrong values of Package and Cores residency when trying to reach the
> deeper state
> Only Core C7 state stats are reported
> Problems when changing language
> Need to clarify which Package C states are reported by PowerTop on
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number: 302 456 199 R.C.S. NANTERRE
> Capital: 4,572,000 Euros
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
> PowerTop mailing list
Here are results of PowerTop 2.6 rc1 validation.
Results seem bad but most of reported bugs deal with cosmetic.
The most serious problem appears when trying to reach the deeper state and only stats for Core C7 state are reported.
PowerTop 2.6: 8f56e9f12f66e13f602eb436d9c53614d6816253 from https://github.com/fenrus75/powertop.git
Linux distribution: Ubuntu 13.10 64 bits
Kernel 3.14.0 from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Duration of measurement is not indicated in report
Several warnings when compiling PowerTop
System out of order when enabling SATA link power management for hosts
PowerTop must be launched twice to see correct AHCI ALPM Residency Statistics
PowerTop logo is missing in html report when created outside source folder
"Not Applicable" can be displayed in the product name
CSV report contains an error 510
Some cells are not in the appropriate column when device name contains a coma
Section "Process Device Activity" is not well aligned
W3C validator "Markup Validation Service" returns one error
W3C validator "CSS Validation Service" returns one error and five warnings
Wrong values of Package and Cores residency when trying to reach the deeper state
Only Core C7 state stats are reported
Problems when changing language
Need to clarify which Package C states are reported by PowerTop on Baytrail
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
Note: Dates are subject to change. If changes are needed, they will be
announced via mailing list and updated here.
March 3st (string freeze)
March 14th (code freeze v2.6)
March 27th (release v2.6)
March 31nd (community meeting about v2.7)
Jul 14th (string freeze)
Jul 25th (code freeze v2.8)
Aug 8th (release v2.8)
Aug 11th (community meeting about v2.9)
Nov 3rd (string freeze)
Nov 14th (code freeze v2.9)
Nov 21th (release v2.9)
Dec 2nd (community meeting about v2.10)
On my laptop, the display backlight is reported this:
See this screenshot: http://i.imgur.com/mP0H6hX.png
Now I am confused. Does this mean that my actual display brightness is 4W or 2W and this is only a displaying error of PowerTOP?
If the latter applies, can this be fixed so that PowerTOP only recognises one display?
I think it is related to the fact that I have two entries in */sys/class/backlight*
lrwxrwxrwx 1 root root 0 2014-04-03 07:15:06.796659660 +0200 intel_backlight -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight lrwxrwxrwx 1 root root 0 2014-04-03 07:15:06.796659660 +0200 acpi_video0 -> ../../devices/pci0000:00/0000:00:02.0/backlight/acpi_video0
Any help would be appreciated!
I am working on power consumption anaysis of different machines we have in
our lab ( servers, power pcs). I came to know about powertop for power
analysis. till now, I have used it on my laptop only and analyse power when
laptop is on battery and connected to power also(plugged). Now I have to
move on servers etc. There are some questions in my mind and searched a lot
but stilled confused. Please guide me about these questions.
1. Can powertop be used on PCs and servers ( having backups or not) 2. I
experiment it and it worked on servers but watts etc colunm is not appeared
that's what I main problem.
3. How watts etc can be appeared on powertop when running on servers.
4.If I sum all the power usage (watts etc colunm) on my laptop when
Is that value total power comsumed on my system.
5. How much accurate powertop is(%).
6. What is working principle of powertop i.e. from where it get
informations about power usage.Is it read some specific registers? If you
donot want to give the answer of this question then just inform me a
littlebit. I am a student and not belong to a big company.
7. I want to know can I use powertop for mips( octeon) linux system. I have
tried to install. It is completed but when I launch It, it shows nothing
but says following
No detailed statistics available; please enable the CONFIG_TIMER_STATS
kernel option This option is located in the Kernel Debugging section of
menuconfig (which is CONFIG_DEBUG_KERNEL=y in the config file)
Note: this is only available in 2.6.21 and later kernels
Suggestion: Enable the CONFIG_NO_HZ kernel configuration option.
This option is required to get any kind of longer sleep times in the CPU.
How to solve it. what is this
I have a question about the tunables section. Why the changes from bad to
good are not permanent?
I don't think it is something very hard to implement, the popular solution
on the web is to create a text file with the appropriate commands and have
it run every time in the login. I suspect that by making some of the
changes permanent you are essentially changing kernel settings so possibly
you run the risk of a broken kernel.