Hello community, here is the log from the commit of package powertop checked in at Mon May 28 15:04:40 CEST 2007. -------- --- powertop/powertop.changes 2007-05-26 11:17:34.000000000 +0200 +++ /mounts/work_src_done/STABLE/powertop/powertop.changes 2007-05-28 13:19:15.591175000 +0200 @@ -1,0 +2,20 @@ +Mon May 28 13:02:15 CEST 2007 - thoenig@suse.de + +- Update to PowerTOP 1.5 +- Changes: + * fix resize-corrupts-screen-content bug + * add interrupts to the wakeups/second data in the emulated + (non-mobile) case + * calculate a long term power usage from battery charge deltas; + this should help people whos battery doesn't report discharge + rates, and also will provide a less noisy datapoint + * Add option to use `kill` on some known power hogs if they are + actually waking up a lot: + - beagle (even latest wakes up 10 times/second when not + indexing) + - hal (suggest to stop cdrom polling) + - gnome-power-manager + These only show if these actually wake up the cpu 'a lot'; + so if these get fixed then the suggestion will not display. + +------------------------------------------------------------------- Old: ---- powertop-1.4.tar.gz New: ---- powertop-1.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powertop.spec ++++++ --- /var/tmp/diff_new_pack.y25432/_old 2007-05-28 15:04:29.000000000 +0200 +++ /var/tmp/diff_new_pack.y25432/_new 2007-05-28 15:04:29.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package powertop (Version 1.4) +# spec file for package powertop (Version 1.5) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -12,8 +12,8 @@ Name: powertop URL: http://www.linuxpowertop.org Summary: PowerTOP is a Linux tool to find out what is using power on a laptop -Version: 1.4 -Release: 2 +Version: 1.5 +Release: 1 License: GNU General Public License (GPL) Group: System/Monitoring Source0: %{name}-%{version}.tar.gz @@ -53,6 +53,23 @@ %{_mandir}/man*/%{name}.1.gz %changelog +* Mon May 28 2007 - thoenig@suse.de +- Update to PowerTOP 1.5 +- Changes: + * fix resize-corrupts-screen-content bug + * add interrupts to the wakeups/second data in the emulated + (non-mobile) case + * calculate a long term power usage from battery charge deltas; + this should help people whos battery doesn't report discharge + rates, and also will provide a less noisy datapoint + * Add option to use `kill` on some known power hogs if they are + actually waking up a lot: + - beagle (even latest wakes up 10 times/second when not + indexing) + - hal (suggest to stop cdrom polling) + - gnome-power-manager + These only show if these actually wake up the cpu 'a lot'; + so if these get fixed then the suggestion will not display. * Sat May 26 2007 - schwab@suse.de - Don't strip binaries. * Sat May 26 2007 - thoenig@suse.de ++++++ powertop-1.4.tar.gz -> powertop-1.5.tar.gz ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/bluetooth.c new/powertop-1.5/bluetooth.c --- old/powertop-1.4/bluetooth.c 2007-05-24 23:23:47.000000000 +0200 +++ new/powertop-1.5/bluetooth.c 2007-05-27 18:00:35.000000000 +0200 @@ -90,8 +90,8 @@ void turn_bluetooth_off(void) { - system("hciconfig hci0 down"); - system("rmmod hci_usb"); + system("hciconfig hci0 down &> /dev/null"); + system("rmmod hci_usb &> /dev/null"); } void suggest_bluetooth_off(void) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/Changelog new/powertop-1.5/Changelog --- old/powertop-1.4/Changelog 2007-05-25 22:52:40.000000000 +0200 +++ new/powertop-1.5/Changelog 2007-05-27 20:14:02.000000000 +0200 @@ -1,3 +1,18 @@ +1.5 -- + * fix resize-corrupts-screen-content bug + * add interrupts to the wakeups/second data in the emulated + (non-mobile) case + * calculate a long term power usage from battery charge deltas; + this should help people whos battery doesn't report discharge + rates, and also will provide a less noisy datapoint + * Add option to use `kill` on some known power hogs if they are + actually waking up a lot: + - beagle (even latest wakes up 10 times/second when not indexing) + - hal (suggest to stop cdrom polling) + - gnome-power-manager + These only show if these actually wake up the cpu 'a lot'; so if + these get fixed then the suggestion will not display. + 1.4 -- May 25th, 2007 * use gettext to allow translation (with lots of thanks to the various translators, especially diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/config.c new/powertop-1.5/config.c --- old/powertop-1.4/config.c 2007-05-24 22:21:53.000000000 +0200 +++ new/powertop-1.5/config.c 2007-05-27 18:01:37.000000000 +0200 @@ -44,7 +44,7 @@ if (configcount) return; if (access("/proc/config.gz", R_OK) == 0) { - file = popen("zcat /proc/config.gz", "r"); + file = popen("zcat /proc/config.gz 2> /dev/null", "r"); while (file && !feof(file)) { char line[100]; if (fgets(line, 100, file) == NULL) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/cpufreq.c new/powertop-1.5/cpufreq.c --- old/powertop-1.4/cpufreq.c 2007-05-25 22:46:38.000000000 +0200 +++ new/powertop-1.5/cpufreq.c 2007-05-26 19:21:25.000000000 +0200 @@ -60,7 +60,7 @@ closedir(dir); } -void suggest_ondemand_governer(void) +void suggest_ondemand_governor(void) { DIR *dir; struct dirent *dirent; @@ -94,7 +94,7 @@ if (strlen(gov)==0) strcpy(gov, line); else - /* if the governers are inconsistent, warn */ + /* if the governors are inconsistent, warn */ if (strcmp(gov, line)) ret = 1; fclose(file); @@ -102,19 +102,19 @@ closedir(dir); - /* if the governer is set to userspace, also warn */ + /* if the governor is set to userspace, also warn */ if (strstr(gov, "userspace")) ret = 1; - /* if the governer is set to performance, also warn */ + /* if the governor is set to performance, also warn */ /* FIXME: check if this is fair on all cpus */ if (strstr(gov, "performance")) ret = 1; if (ret) { - add_suggestion(_("Suggestion: Enable the ondemand cpu speed governer for all processors via: \n" - " echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq_scaling_governor \n"), - 15, 'O', _(" O - enable Ondemand governer "), activate_ondemand); + add_suggestion(_("Suggestion: Enable the ondemand cpu speed governor for all processors via: \n" + " echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \n"), + 15, 'O', _(" O - enable Ondemand governor "), activate_ondemand); } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/display.c new/powertop-1.5/display.c --- old/powertop-1.4/display.c 2007-05-25 23:00:24.000000000 +0200 +++ new/powertop-1.5/display.c 2007-05-27 20:10:38.000000000 +0200 @@ -30,6 +30,8 @@ #include <sys/types.h> #include <dirent.h> #include <ncurses.h> +#include <time.h> +#include <wchar.h> #include "powertop.h" @@ -106,6 +108,9 @@ strcpy(status_bar_slots[0], _(" Q - Quit ")); strcpy(status_bar_slots[1], _(" R - Refresh ")); + + werase(stdscr); + refresh(); } void initialize_curses(void) @@ -138,7 +143,7 @@ wbkgd(title_bar_window, COLOR_PAIR(PT_COLOR_HEADER_BAR)); werase(title_bar_window); - mvwprintw(title_bar_window, 0, 0, " PowerTOP version 1.4 (C) 2007 Intel Corporation"); + mvwprintw(title_bar_window, 0, 0, " PowerTOP version 1.5 (C) 2007 Intel Corporation"); wrefresh(title_bar_window); @@ -173,14 +178,25 @@ } -void show_acpi_power_line(double rate, double cap) +void show_acpi_power_line(double rate, double cap, double capdelta, time_t ti) { + char buffer[1024]; + + sprintf(buffer, _("no ACPI power usage estimate available") ); + werase(acpi_power_window); - if (rate > 0) { - mvwprintw(acpi_power_window, 0, 0, _("Power usage (ACPI estimate) : %5.1f W (%3.1f hours left)"), rate, cap/rate); - } else { - mvwprintw(acpi_power_window, 0, 0, _("no ACPI power usage estimate available")); - } + if (rate > 0.001) { + char *c; + sprintf(buffer, _("Power usage (ACPI estimate) : %5.1f W (%3.1f hours left)"), rate, cap/rate); + strcat(buffer, " "); + c = &buffer[strlen(buffer)]; + if (ti>180 && capdelta > 0) + sprintf(c, _("(long term: %5.1f W, %3.1f hours)"), 3600*capdelta / ti, cap / (3600*capdelta/ti+0.01)); + } + else if (ti>120 && capdelta > 0.001) + sprintf(buffer, _("Power usage (5 minute ACPI estimate) : %5.1f W (%3.1f hours left)"), 3600*capdelta / ti, cap / (3600*capdelta/ti+0.01)); + + mvwprintw(acpi_power_window, 0, 0, buffer); wrefresh(acpi_power_window); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/Makefile new/powertop-1.5/Makefile --- old/powertop-1.4/Makefile 2007-05-25 23:29:15.000000000 +0200 +++ new/powertop-1.5/Makefile 2007-05-26 19:12:07.000000000 +0200 @@ -6,7 +6,7 @@ CC?=gcc powertop: powertop.c config.c process.c misctips.c bluetooth.c display.c suggestions.c wireless.c cpufreq.c Makefile powertop.h - $(CC) ${CFLAGS} powertop.c config.c process.c misctips.c bluetooth.c display.c suggestions.c wireless.c cpufreq.c -lncurses -o powertop + $(CC) ${CFLAGS} powertop.c config.c process.c misctips.c bluetooth.c display.c suggestions.c wireless.c cpufreq.c -lncursesw -o powertop @(cd po/ && $(MAKE)) powertop.1.gz: powertop.1 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/misctips.c new/powertop-1.5/misctips.c --- old/powertop-1.4/misctips.c 2007-05-25 18:09:12.000000000 +0200 +++ new/powertop-1.5/misctips.c 2007-05-26 17:03:51.000000000 +0200 @@ -98,21 +98,23 @@ { FILE *file; char buffer[1024]; - file = fopen("/proc/timer_list", "r"); + file = fopen("/sys/devices/system/clocksource/clocksource0/available_clocksource", "r"); if (!file) return; memset(buffer, 0, 1024); - while (!feof(file)) { - if (!fgets(buffer, 1023, file)) { - fclose(file); - return; - } - if (strstr(buffer, "Clock Event Device: hpet")) { - fclose(file); - return; - } + + if (!fgets(buffer, 1023, file)) { + fclose(file); + return; + } + + if (strstr(buffer, "hpet")) { + fclose(file); + return; } + fclose(file); + add_suggestion( _("Suggestion: enable the HPET (Multimedia Timer) in your BIOS or add \n" "the kernel patch to force-enable HPET. HPET support allows Linux to \n" "have much longer sleep intervals."), 7, 0, NULL, NULL); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/po/de.po new/powertop-1.5/po/de.po --- old/powertop-1.4/po/de.po 2007-05-25 23:52:32.000000000 +0200 +++ new/powertop-1.5/po/de.po 2007-05-26 19:21:53.000000000 +0200 @@ -34,7 +34,7 @@ msgstr " N - NMI Wächter ausschalten" #: cpufreq.c:118 -msgid " O - enable Ondemand governer " +msgid " O - enable Ondemand governor " msgstr " O - Ondemand Regulator aktivieren" #: display.c:107 @@ -169,7 +169,7 @@ msgid "" "Suggestion: Enable the CONFIG_CPU_FREQ_GOV_ONDEMAND kernel configuration " "option.\n" -"The 'ondemand' CPU speed governer will minimize the CPU power usage while\n" +"The 'ondemand' CPU speed governor will minimize the CPU power usage while\n" "giving you performance when it is needed." msgstr "" "Vorschlag: Aktivieren Sie die Option CONFIG_CPU_FREQ_GOV_ONDEMAND Ihres " @@ -218,10 +218,10 @@ #: cpufreq.c:116 msgid "" -"Suggestion: Enable the ondemand cpu speed governer for all processors via: \n" -" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq_scaling_governor \n" +"Suggestion: Enable the ondemand cpu speed governor for all processors via: \n" +" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \n" msgstr "Vorschlag: Aktivieren Sie den Ondemand Regulator durch: \n" -" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq_scaling_governor \n" +" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \n" #: wireless.c:97 #, c-format diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/po/es.po new/powertop-1.5/po/es.po --- old/powertop-1.4/po/es.po 2007-05-25 23:52:45.000000000 +0200 +++ new/powertop-1.5/po/es.po 2007-05-26 19:21:54.000000000 +0200 @@ -33,7 +33,7 @@ msgstr " N - Apagar el vigilante de NMI " #: cpufreq.c:118 -msgid " O - enable Ondemand governer " +msgid " O - enable Ondemand governor " msgstr " O - Encender el goverando basado en demanda " #: display.c:107 @@ -176,7 +176,7 @@ msgid "" "Suggestion: Enable the CONFIG_CPU_FREQ_GOV_ONDEMAND kernel configuration " "option.\n" -"The 'ondemand' CPU speed governer will minimize the CPU power usage while\n" +"The 'ondemand' CPU speed governor will minimize the CPU power usage while\n" "giving you performance when it is needed." msgstr "" "Sugerencia: Active la opción del núcleo CONFIG_CPU_FREQ_GOV_ONDEMAND.\n" @@ -226,12 +226,12 @@ #: cpufreq.c:116 msgid "" -"Suggestion: Enable the ondemand cpu speed governer for all processors via: \n" -" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq_scaling_governor \n" +"Suggestion: Enable the ondemand cpu speed governor for all processors via: \n" +" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \n" msgstr "" "Sugerencia: Active el gobernador de velocidad de CPU en demanda en\n" "todos los procesadores ejecutando:\n" -" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq_scaling_governor \n" +" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \n" #: wireless.c:97 #, c-format diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/po/fi.po new/powertop-1.5/po/fi.po --- old/powertop-1.4/po/fi.po 2007-05-25 23:29:21.000000000 +0200 +++ new/powertop-1.5/po/fi.po 2007-05-26 19:21:55.000000000 +0200 @@ -30,7 +30,7 @@ msgstr " N - Sulje NMI-valvoja " #: cpufreq.c:118 -msgid " O - enable Ondemand governer " +msgid " O - enable Ondemand governor " msgstr " O - Käytä ondemand-suorituskykyprofiilia " #: display.c:107 @@ -167,7 +167,7 @@ msgid "" "Suggestion: Enable the CONFIG_CPU_FREQ_GOV_ONDEMAND kernel configuration " "option.\n" -"The 'ondemand' CPU speed governer will minimize the CPU power usage while\n" +"The 'ondemand' CPU speed governor will minimize the CPU power usage while\n" "giving you performance when it is needed." msgstr "" "Ehdotus: Käytä ytimen CONFIG_CPU_FREQ_GOV_ONDEMAND-asetusta. ”ondemand”-" @@ -214,12 +214,12 @@ #: cpufreq.c:116 msgid "" -"Suggestion: Enable the ondemand cpu speed governer for all processors via: \n" -" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq_scaling_governor \n" +"Suggestion: Enable the ondemand cpu speed governor for all processors via: \n" +" echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \n" msgstr "" "Ehdotus: Aseta ondemand-suorituskykyprofiili kaikille suorittimille " "komennolla:\n" -"\techo ondemand > /sys/devices/system/cpu/cpu0/cpufreq_scaling_governor\n" +"\techo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\n" #: wireless.c:97 #, c-format diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/po/fr.po new/powertop-1.5/po/fr.po --- old/powertop-1.4/po/fr.po 2007-05-25 12:00:36.000000000 +0200 +++ new/powertop-1.5/po/fr.po 2007-05-26 16:10:43.000000000 +0200 @@ -147,7 +147,7 @@ #: powertop.c:549 msgid "" "Suggestion: Enable the CONFIG_CPU_FREQ_GOV_ONDEMAND kernel configuration option.\n" -"The 'ondemand' CPU speed governer will minimize the CPU power usage while\n" +"The 'ondemand' CPU speed governor will minimize the CPU power usage while\n" "giving you performance when it is needed." msgstr "" "Suggestion : activez l'option de configuration du noyau \n" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/po/hu.po new/powertop-1.5/po/hu.po --- old/powertop-1.4/po/hu.po 2007-05-24 03:48:09.000000000 +0200 +++ new/powertop-1.5/po/hu.po 2007-05-26 16:10:43.000000000 +0200 @@ -158,7 +158,7 @@ msgid "" "Suggestion: Enable the CONFIG_CPU_FREQ_GOV_ONDEMAND kernel configuration " "option.\n" -"The 'ondemand' CPU speed governer will minimize the CPU power usage while\n" +"The 'ondemand' CPU speed governor will minimize the CPU power usage while\n" "giving you performance when it is needed." msgstr "" "Tanács: Endedélyezd a CONFIG_CPU_FREQ_GOV_ONDEMAND kernel konfigurációs opciót.\n" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/po/it.po new/powertop-1.5/po/it.po --- old/powertop-1.4/po/it.po 2007-05-24 16:51:25.000000000 +0200 +++ new/powertop-1.5/po/it.po 2007-05-26 16:10:43.000000000 +0200 @@ -164,7 +164,7 @@ msgid "" "Suggestion: Enable the CONFIG_CPU_FREQ_GOV_ONDEMAND kernel configuration " "option.\n" -"The 'ondemand' CPU speed governer will minimize the CPU power usage while\n" +"The 'ondemand' CPU speed governor will minimize the CPU power usage while\n" "giving you performance when it is needed." msgstr "" "Suggerimento: Abilitare CONFIG_CPU_FREQ_GOV_ONDEMAND nel kernel\n" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/po/nl.po new/powertop-1.5/po/nl.po --- old/powertop-1.4/po/nl.po 2007-05-22 19:23:21.000000000 +0200 +++ new/powertop-1.5/po/nl.po 2007-05-26 16:10:43.000000000 +0200 @@ -146,7 +146,7 @@ msgid "" "Suggestion: Enable the CONFIG_CPU_FREQ_GOV_ONDEMAND kernel configuration " "option.\n" -"The 'ondemand' CPU speed governer will minimize the CPU power usage while\n" +"The 'ondemand' CPU speed governor will minimize the CPU power usage while\n" "giving you performance when it is needed." msgstr "" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/po/ru.po new/powertop-1.5/po/ru.po --- old/powertop-1.4/po/ru.po 2007-05-23 05:09:38.000000000 +0200 +++ new/powertop-1.5/po/ru.po 2007-05-26 16:10:43.000000000 +0200 @@ -168,11 +168,11 @@ msgid "" "Suggestion: Enable the CONFIG_CPU_FREQ_GOV_ONDEMAND kernel configuration " "option.\n" -"The 'ondemand' CPU speed governer will minimize the CPU power usage while\n" +"The 'ondemand' CPU speed governor will minimize the CPU power usage while\n" "giving you performance when it is needed." msgstr "" "Совет: Включите опцию CONFIG_CPU_FREQ_GOV_ONDEMAND в конфигурации ядра.\n" -"'ondemand' cpufreq governer минимизирует потребление энергии ЦП, наращивая\n" +"'ondemand' cpufreq governor минимизирует потребление энергии ЦП, наращивая\n" "производительность при необходимости." #: powertop.c:555 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/powertop.c new/powertop-1.5/powertop.c --- old/powertop-1.4/powertop.c 2007-05-25 23:50:01.000000000 +0200 +++ new/powertop-1.5/powertop.c 2007-05-27 20:10:46.000000000 +0200 @@ -33,6 +33,7 @@ #include <ctype.h> #include <assert.h> #include <locale.h> +#include <time.h> #include "powertop.h" @@ -42,7 +43,7 @@ int ticktime = 5; -int interrupt_0; +int interrupt_0, total_interrupt; static int maxcstate = 0; int topcstate = 0; @@ -68,6 +69,12 @@ int linesize; int linectotal; + +double last_bat_cap = 0; +double prev_bat_cap = 0; +time_t last_bat_time = 0; +time_t prev_bat_time = 0; + void push_line(char *string, int count) { int i; @@ -134,10 +141,12 @@ { FILE *file; char line[1024]; + char line2[1024]; char *name; uint64_t delta; interrupt_0 = 0; + total_interrupt = 0; file = fopen("/proc/interrupts", "r"); if (!file) @@ -180,11 +189,13 @@ c = strchr(name, '\n'); if (c) *c = 0; - sprintf(line, " <interrupt> : %s", name); + sprintf(line2, " <interrupt> : %s", name); if (nr > 0 && delta > 0) - push_line(line, delta); + push_line(line2, delta); if (nr==0) interrupt_0 = delta; + else + total_interrupt += delta; } fclose(file); } @@ -339,10 +350,24 @@ rate += watts_drawn + voltage * amperes_drawn; } cap += watts_left + voltage * amperes_left; + } closedir(dir); - show_acpi_power_line(rate, cap); + if (!last_bat_time) { + last_bat_time = prev_bat_time = time(NULL); + last_bat_cap = prev_bat_cap = cap; + } + if (time(NULL) - last_bat_time >= 400) { + prev_bat_cap = last_bat_cap; + prev_bat_time = last_bat_time; + last_bat_time = time(NULL); + last_bat_cap = cap; + } + + if (prev_bat_cap - cap < 0.001 && rate < 0.001) + last_bat_time = 0; + show_acpi_power_line(rate, cap, prev_bat_cap - cap, time(NULL) - prev_bat_time); } char cstate_lines[6][200]; @@ -353,6 +378,8 @@ int ncursesinited=0; FILE *file = NULL; uint64_t cur_usage[8], cur_duration[8]; + double wakeups_per_second = 0; + read_data(&start_usage[0], &start_duration[0]); setlocale (LC_ALL, ""); @@ -367,7 +394,7 @@ memset(cur_usage, 0, sizeof(cur_usage)); memset(cur_duration, 0, sizeof(cur_duration)); - printf(_("PowerTOP 1.4 (C) 2007 Intel Corporation \n\n")); + printf("PowerTOP 1.5 (C) 2007 Intel Corporation \n\n"); if (getuid() != 0) printf(_("PowerTOP needs to be run as root to collect enough information\n")); printf(_("Collecting data for %i seconds \n"), ticktime); @@ -513,17 +540,19 @@ if (strstr(line, "total events")) { int d; d = strtoull(line, NULL, 10) / sysconf(_SC_NPROCESSORS_ONLN); - if (totalevents == 0) /* No c-state info available, use timerstats instead */ - totalevents = d * sysconf(_SC_NPROCESSORS_ONLN); + if (totalevents == 0) { /* No c-state info available, use timerstats instead */ + totalevents = d * sysconf(_SC_NPROCESSORS_ONLN) + total_interrupt; + if (d < interrupt_0) + totalevents += interrupt_0 - d; + } if (d>0 && d < interrupt_0) push_line(" <interrupt> : extra timer interrupt", interrupt_0 - d); } if (totalevents && ticktime) { - double d; - d = totalevents * 1.0 / ticktime / sysconf(_SC_NPROCESSORS_ONLN); - show_wakeups(d); + wakeups_per_second = totalevents * 1.0 / ticktime / sysconf(_SC_NPROCESSORS_ONLN); + show_wakeups(wakeups_per_second); } print_battery(); count_lines(); @@ -560,18 +589,15 @@ suggest_kernel_config("CONFIG_USB_SUSPEND", 1, _("Suggestion: Enable the CONFIG_USB_SUSPEND kernel configuration option.\nThis option will automatically disable UHCI USB when not in use, and may\nsave approximately 1 Watt of power."), 20); - suggest_process_death("beagled : schedule_timeout", lines, min(linehead,20), - _("Suggestion: Disable or remove 'beagle' from your system. \n" - "Beagle is the program that indexes for easy desktop search, however it's \n" - "not very efficient and costs a significant amount of battery life."), 30); suggest_kernel_config("CONFIG_CPU_FREQ_GOV_ONDEMAND", 1, _("Suggestion: Enable the CONFIG_CPU_FREQ_GOV_ONDEMAND kernel configuration option.\n" - "The 'ondemand' CPU speed governer will minimize the CPU power usage while\n" "giving you performance when it is needed."), 5); + "The 'ondemand' CPU speed governor will minimize the CPU power usage while\n" "giving you performance when it is needed."), 5); suggest_kernel_config("CONFIG_NO_HZ", 1, _("Suggestion: Enable the CONFIG_NO_HZ kernel configuration option.\nThis option is required to get any kind of longer sleep times in the CPU."), 50); suggest_kernel_config("CONFIG_HPET_TIMER", 1, _("Suggestion: Enable the CONFIG_HPET kernel configuration option.\n" "Without HPET support the kernel needs to wake up every 20 miliseconds for \n" "some housekeeping tasks."), 10); - if (!access("/sys/module/snd_ac97_codec", F_OK)) + if (!access("/sys/module/snd_ac97_codec", F_OK) && + access("/sys/module/snd_ac97_codec/parameters/power_save", F_OK)) suggest_kernel_config("CONFIG_SND_AC97_POWER_SAVE", 1, _("Suggestion: Enable the CONFIG_SND_AC97_POWER_SAVE kernel configuration option.\n" "This option will automatically power down your sound codec when not in use,\n" @@ -579,16 +605,48 @@ suggest_kernel_config("CONFIG_IRQBALANCE", 0, _("Suggestion: Disable the CONFIG_IRQBALANCE kernel configuration option.\n" "The in-kernel irq balancer is obsolete and wakes the CPU up far more than needed."), 3); + + /* suggest to stop beagle if it shows up in the top 20 and wakes up more than 10 times in the measurement */ + suggest_process_death("beagled : schedule_timeout", "beagled", lines, min(linehead,20), 10.0, + _("Suggestion: Disable or remove 'beagle' from your system. \n" + "Beagle is the program that indexes for easy desktop search, however it's \n" + "not very efficient and costs a significant amount of battery life."), 30); + suggest_process_death("beagled : futex_wait (hrtimer_wakeup)", "beagled", lines, min(linehead,20), 10.0, + _("Suggestion: Disable or remove 'beagle' from your system. \n" + "Beagle is the program that indexes for easy desktop search, however it's \n" + "not very efficient and costs a significant amount of battery life."), 30); + + /* suggest to stop gnome-power-manager if it shows up in the top 10 and wakes up more than 10 times in the measurement */ + suggest_process_death("gnome-power-man : schedule_timeout (process_timeout)", "gnome-power-manager", lines, min(linehead,10), 10.0, + _("Suggestion: Disable or remove 'gnome-power-manager' from your system. \n" + "Despite its name, some versions of gnome-power-manager end up costing more power \n" + "than it'll ever save."), 5); + + /* suggest to stop pcscd if it shows up in the top 50 and wakes up at all*/ + suggest_process_death("pcscd : do_nanosleep (hrtimer_wakeup)", "pcscd", lines, min(linehead,50), 1.0, + _("Suggestion: Disable or remove 'pcscd' from your system. \n" + "pcscd tends to keep the USB subsystem out of power save mode\n" + "and your processor out of deeper powersave states."), 30); + + + /* suggest to stop hal polilng if it shows up in the top 50 and wakes up too much*/ + suggest_process_death("hald-addon-stor : do_nanosleep (hrtimer_wakeup)", "hald-addon-storage", lines, min(linehead,50), 2.0, + _("Suggestion: Disable 'hal' from polling your cdrom with: hal-stop-polling /dev/scd0\n" + "'hal' is the component that auto-opens a file browser when you plug in a CD\n" + "but disables SATA power saving from kicking in."), 30); + + suggest_bluetooth_off(); suggest_nmi_watchdog(); suggest_laptop_mode(); suggest_hpet(); suggest_ac97_powersave(); suggest_wireless_powersave(); - suggest_ondemand_governer(); + suggest_ondemand_governor(); - pick_suggestion(); + if (!key) + pick_suggestion(); show_title_bar(); fflush(stdout); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/powertop.h new/powertop-1.5/powertop.h --- old/powertop-1.4/powertop.h 2007-05-25 22:44:05.000000000 +0200 +++ new/powertop-1.5/powertop.h 2007-05-26 23:07:34.000000000 +0200 @@ -40,7 +40,7 @@ extern int linesize; extern int linectotal; -void suggest_process_death(char *process, struct line *lines, int linecount, char *comment, int weight); +void suggest_process_death(char *process_match, char *process_name, struct line *lines, int linecount, double minwakeups, char *comment, int weight); void suggest_kernel_config(char *string, int onoff, char *comment, int weight); void suggest_laptop_mode(void); void suggest_bluetooth_off(void); @@ -48,7 +48,7 @@ void suggest_hpet(void); void suggest_ac97_powersave(void); void suggest_wireless_powersave(void); -void suggest_ondemand_governer(void); +void suggest_ondemand_governor(void); @@ -83,7 +83,7 @@ void show_title_bar(void); void setup_windows(void); void initialize_curses(void); -void show_acpi_power_line(double rate, double cap); +void show_acpi_power_line(double rate, double cap, double capdelta, time_t time); void show_cstates(void); void show_wakeups(double d); void show_timerstats(int nostats, int ticktime); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/process.c new/powertop-1.5/process.c --- old/powertop-1.4/process.c 2007-05-24 22:49:32.000000000 +0200 +++ new/powertop-1.5/process.c 2007-05-27 18:01:02.000000000 +0200 @@ -32,15 +32,26 @@ #include "powertop.h" -void suggest_process_death(char *process, struct line *lines, int linecount, char *comment, int weight) +char process_to_kill[1024]; + +void do_kill(void) +{ + char line[2048]; + sprintf(line, "killall %s &> /dev/null", process_to_kill); + system(line); +} + +void suggest_process_death(char *process_match, char *tokill, struct line *lines, int linecount, double minwakeups, char *comment, int weight) { int i; - int found = 0; for (i = 0; i < linecount; i++) { - if (strstr(lines[i].string, process)) { - found++; - add_suggestion(comment, weight, 0, NULL, NULL); + if (strstr(lines[i].string, process_match)) { + char hotkey_string[300]; + sprintf(hotkey_string, " K - kill %s ", tokill); + strcpy(process_to_kill, tokill); + if (minwakeups < lines[i].count) + add_suggestion(comment, weight, 'K' , hotkey_string, do_kill); break; } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/powertop-1.4/suggestions.c new/powertop-1.5/suggestions.c --- old/powertop-1.4/suggestions.c 2007-05-24 23:08:15.000000000 +0200 +++ new/powertop-1.5/suggestions.c 2007-05-26 23:37:11.000000000 +0200 @@ -70,6 +70,9 @@ ptr = next; } suggestions = NULL; + strcpy(status_bar_slots[9],""); + suggestion_key = 255; + suggestion_activate = NULL; total_weight = 0; } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de