diff --git a/powertop-2.7-auto-tune-crash-fix.patch b/powertop-2.7-auto-tune-crash-fix.patch deleted file mode 100644 index 97ca259..0000000 --- a/powertop-2.7-auto-tune-crash-fix.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 6fd9ecebd3bc277bd91ce057f85f8e54b09bb0a9 Mon Sep 17 00:00:00 2001 -From: Michael Mullin -Date: Thu, 22 Jan 2015 16:50:10 -0500 -Subject: [PATCH] Powertop crashes with 'powertop --auto-tune' - ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA256 - -Please see the following patch to address the reported crash -- --- -- From e994a414f619410877023fce35ade12d1cfce68d Mon Sep 17 00:00:00 2001 -From: Michael Mullin -Date: Thu, 22 Jan 2015 16:33:31 -0500 -Subject: [PATCH] If "dir" is closed early inside create_add_devfreq_devices() - then there is a potential double free due to a second close during the - cleanup phase in clear_all_devfreq() - -Signed-off-by: Michael Mullin - -- --- - src/devices/devfreq.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) ---- - src/devices/devfreq.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp -index d2e56e3..f652a57 100644 ---- a/src/devices/devfreq.cpp -+++ b/src/devices/devfreq.cpp -@@ -247,6 +247,7 @@ void create_all_devfreq_devices(void) - fprintf(stderr, "Devfreq not enabled\n"); - is_enabled = false; - closedir(dir); -+ dir = NULL; - return; - } - -@@ -327,6 +328,8 @@ void clear_all_devfreq() - } - all_devfreq.clear(); - /* close /sys/class/devfreq */ -- if (dir != NULL) -+ if (dir != NULL) { - closedir(dir); -+ dir = NULL; -+ } - } diff --git a/powertop-2.7-baytrail-no-c7.patch b/powertop-2.7-baytrail-no-c7.patch deleted file mode 100644 index d618198..0000000 --- a/powertop-2.7-baytrail-no-c7.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp -index 167f1a7..e019484 100644 ---- a/src/cpu/intel_cpus.cpp -+++ b/src/cpu/intel_cpus.cpp -@@ -131,11 +131,6 @@ nhm_core::nhm_core(int model) - if (model == 0x37) { - has_c3_res = 0; - has_c1_res = 1; -- this->byt_has_ahci(); -- if ((this->get_byt_ahci_support()) == 0) -- has_c7_res = 1;/*BYT-T PC7 <- S0iX*/ -- else -- has_c7_res = 0; - } else { - has_c3_res = 1; - has_c1_res = 0; diff --git a/powertop-2.7-navigate-hint.patch b/powertop-2.7-navigate-hint.patch deleted file mode 100644 index 2445f1d..0000000 --- a/powertop-2.7-navigate-hint.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/display.cpp b/src/display.cpp -index b6c9200..c051520 100644 ---- a/src/display.cpp -+++ b/src/display.cpp -@@ -127,7 +127,9 @@ void show_tab(unsigned int tab) - if (c && strlen(c) > 0) - mvwprintw(bottom_line, 0,0, c); - else -- mvwprintw(bottom_line, 0,0," %s | ",_("Exit")); -+ mvwprintw(bottom_line, 0, 0, -+ " %s | / %s | ", _("Exit"), -+ _("Navigate")); - - - current_tab = tab; diff --git a/powertop-2.7-tunable-overflow-fix.patch b/powertop-2.7-tunable-overflow-fix.patch deleted file mode 100644 index b33b5da..0000000 --- a/powertop-2.7-tunable-overflow-fix.patch +++ /dev/null @@ -1,226 +0,0 @@ -diff --git a/src/tuning/bluetooth.cpp b/src/tuning/bluetooth.cpp -index 9be327e..52a9278 100644 ---- a/src/tuning/bluetooth.cpp -+++ b/src/tuning/bluetooth.cpp -@@ -46,8 +46,8 @@ - bt_tunable::bt_tunable(void) : tunable("", 1.0, _("Good"), _("Bad"), _("Unknown")) - { - sprintf(desc, _("Bluetooth device interface status")); -- strcpy(toggle_bad, "/usr/sbin/hciconfig hci0 up &> /dev/null &"); -- strcpy(toggle_good, "/usr/sbin/hciconfig hci0 down &> /dev/null"); -+ toggle_bad = "/usr/sbin/hciconfig hci0 up &> /dev/null &"; -+ toggle_good = "/usr/sbin/hciconfig hci0 down &> /dev/null"; - } - - -@@ -190,9 +190,9 @@ const char *bt_tunable::toggle_script(void) - good = good_bad(); - - if (good == TUNE_GOOD) { -- return toggle_bad; -+ return toggle_bad.c_str(); - } -- return toggle_good; -+ return toggle_good.c_str(); - } - - -diff --git a/src/tuning/ethernet.cpp b/src/tuning/ethernet.cpp -index 3d36112..f3f0224 100644 ---- a/src/tuning/ethernet.cpp -+++ b/src/tuning/ethernet.cpp -@@ -49,11 +49,13 @@ extern void create_all_nics(callback fn); - - ethernet_tunable::ethernet_tunable(const char *iface) : tunable("", 0.3, _("Good"), _("Bad"), _("Unknown")) - { -+ char tmp[4096]; -+ - memset(interf, 0, sizeof(interf)); - strncpy(interf, iface, sizeof(interf)); - sprintf(desc, _("Wake-on-lan status for device %s"), iface); -- sprintf(toggle_good, "ethtool -s %s wol d;", iface); -- -+ snprintf(tmp, 4096, "ethtool -s %s wol d;", iface); -+ toggle_good = tmp; - } - - -@@ -134,7 +136,7 @@ const char *ethernet_tunable::toggle_script(void) - good = good_bad(); - - if (good != TUNE_GOOD) { -- return toggle_good; -+ return toggle_good.c_str(); - } - - return NULL; -diff --git a/src/tuning/runtime.cpp b/src/tuning/runtime.cpp -index 3201fdd..6d6bb98 100644 ---- a/src/tuning/runtime.cpp -+++ b/src/tuning/runtime.cpp -@@ -42,6 +42,7 @@ runtime_tunable::runtime_tunable(const char *path, const char *bus, const char * - { - ifstream file; - sprintf(runtime_path, "%s/power/control", path); -+ char tmp[4096]; - - - sprintf(desc, _("Runtime PM for %s device %s"), bus, dev); -@@ -77,8 +78,10 @@ runtime_tunable::runtime_tunable(const char *path, const char *bus, const char * - - - } -- sprintf(toggle_good, "echo 'auto' > '%s';", runtime_path); -- sprintf(toggle_bad, "echo 'on' > '%s';", runtime_path); -+ snprintf(tmp, 4096, "echo 'auto' > '%s';", runtime_path); -+ toggle_good = tmp; -+ snprintf(tmp, 4096, "echo 'on' > '%s';", runtime_path); -+ toggle_bad = tmp; - } - - int runtime_tunable::good_bad(void) -@@ -112,10 +115,10 @@ const char *runtime_tunable::toggle_script(void) - good = good_bad(); - - if (good == TUNE_GOOD) { -- return toggle_bad; -+ return toggle_bad.c_str(); - } - -- return toggle_good; -+ return toggle_good.c_str(); - } - - -diff --git a/src/tuning/tunable.h b/src/tuning/tunable.h -index 3372378..8f90ee2 100644 ---- a/src/tuning/tunable.h -+++ b/src/tuning/tunable.h -@@ -26,6 +26,7 @@ - #define _INCLUDE_GUARD_TUNABLE_H - - #include -+#include - - #include "../lib.h" - -@@ -43,8 +44,8 @@ class tunable { - char bad_string[128]; - char neutral_string[128]; - protected: -- char toggle_good[4096]; -- char toggle_bad[4096]; -+ string toggle_good; -+ string toggle_bad; - public: - char desc[4096]; - double score; -diff --git a/src/tuning/tuningsysfs.cpp b/src/tuning/tuningsysfs.cpp -index 0859a0c..3bfe0e3 100644 ---- a/src/tuning/tuningsysfs.cpp -+++ b/src/tuning/tuningsysfs.cpp -@@ -43,11 +43,15 @@ - - sysfs_tunable::sysfs_tunable(const char *str, const char *_sysfs_path, const char *_target_content) : tunable(str, 1.0, _("Good"), _("Bad"), _("Unknown")) - { -+ char tmp[4096]; -+ - strcpy(sysfs_path, _sysfs_path); - strcpy(target_value, _target_content); - bad_value[0] = 0; -- sprintf(toggle_good, "echo '%s' > '%s';", target_value, sysfs_path); -- sprintf(toggle_bad, "echo '%s' > '%s';", bad_value, sysfs_path); -+ snprintf(tmp, 4096, "echo '%s' > '%s';", target_value, sysfs_path); -+ toggle_good = tmp; -+ snprintf(tmp, 4096, "echo '%s' > '%s';", bad_value, sysfs_path); -+ toggle_bad = tmp; - } - - int sysfs_tunable::good_bad(void) -@@ -92,11 +96,11 @@ const char *sysfs_tunable::toggle_script(void) { - - if (good == TUNE_GOOD) { - if (strlen(bad_value) > 0) -- return toggle_bad; -+ return toggle_bad.c_str(); - return NULL; - } - -- return toggle_good; -+ return toggle_good.c_str(); - } - - -diff --git a/src/tuning/tuningusb.cpp b/src/tuning/tuningusb.cpp -index d2a0c11..ec869ec 100644 ---- a/src/tuning/tuningusb.cpp -+++ b/src/tuning/tuningusb.cpp -@@ -41,6 +41,7 @@ usb_tunable::usb_tunable(const char *path, const char *name) : tunable("", 0.9, - char filename[4096]; - char vendor[2048]; - char product[2048]; -+ char tmp[4096]; - string str1, str2; - sprintf(usb_path, "%s/power/control", path); - -@@ -73,8 +74,10 @@ usb_tunable::usb_tunable(const char *path, const char *name) : tunable("", 0.9, - else if (strlen(vendor)) - sprintf(desc, _("Autosuspend for USB device %s [%s]"), vendor, name); - -- sprintf(toggle_good, "echo 'auto' > '%s';", usb_path); -- sprintf(toggle_bad, "echo 'on' > '%s';", usb_path); -+ snprintf(tmp, 4096, "echo 'auto' > '%s';", usb_path); -+ toggle_good = tmp; -+ snprintf(tmp, 4096, "echo 'on' > '%s';", usb_path); -+ toggle_bad = tmp; - } - - int usb_tunable::good_bad(void) -@@ -108,10 +111,10 @@ const char *usb_tunable::toggle_script(void) - good = good_bad(); - - if (good == TUNE_GOOD) { -- return toggle_bad; -+ return toggle_bad.c_str(); - } - -- return toggle_good; -+ return toggle_good.c_str(); - } - - static void add_usb_callback(const char *d_name) -diff --git a/src/tuning/wifi.cpp b/src/tuning/wifi.cpp -index 77cdfcc..2cc01b8 100644 ---- a/src/tuning/wifi.cpp -+++ b/src/tuning/wifi.cpp -@@ -44,11 +44,15 @@ extern "C" { - - wifi_tunable::wifi_tunable(const char *_iface) : tunable("", 1.5, _("Good"), _("Bad"), _("Unknown")) - { -+ char tmp[4096]; -+ - strcpy(iface, _iface); - sprintf(desc, _("Wireless Power Saving for interface %s"), iface); - -- sprintf(toggle_good, "iw dev %s set power_save on", iface); -- sprintf(toggle_bad, "iw dev %s set power_save off", iface); -+ snprintf(tmp, 4096, "iw dev %s set power_save on", iface); -+ toggle_good = tmp; -+ snprintf(tmp, 4096, "iw dev %s set power_save off", iface); -+ toggle_bad = tmp; - } - - int wifi_tunable::good_bad(void) -@@ -78,10 +82,10 @@ const char *wifi_tunable::toggle_script(void) - good = good_bad(); - - if (good == TUNE_GOOD) { -- return toggle_bad; -+ return toggle_bad.c_str(); - } - -- return toggle_good; -+ return toggle_good.c_str(); - } - - void add_wifi_tunables(void) diff --git a/powertop-2.8-pthreads-cflags-fix.patch b/powertop-2.8-pthreads-cflags-fix.patch new file mode 100644 index 0000000..0380462 --- /dev/null +++ b/powertop-2.8-pthreads-cflags-fix.patch @@ -0,0 +1,48 @@ +diff --git a/src/Makefile.am b/src/Makefile.am +index d7132c0..87d8469 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -133,7 +133,8 @@ powertop_CXXFLAGS = \ + $(GLIB2_CFLAGS) \ + $(LIBNL_CFLAGS) \ + $(NCURSES_CFLAGS) \ +- $(PCIUTILS_CFLAGS) ++ $(PCIUTILS_CFLAGS) \ ++ $(PTHREAD_CFLAGS) + + + powertop_CPPFLAGS = \ +@@ -142,7 +143,8 @@ powertop_CPPFLAGS = \ + $(LIBNL_CFLAGS) \ + $(LIBZ_CFLAGS) \ + $(NCURSES_CFLAGS) \ +- $(PCIUTILS_CFLAGS) ++ $(PCIUTILS_CFLAGS) \ ++ $(PTHREAD_CFLAGS) + + powertop_LDADD = \ + ../traceevent/libtraceevnet.la +diff --git a/src/Makefile.in b/src/Makefile.in +index 564ce5c..88d81e7 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -533,7 +533,8 @@ powertop_CXXFLAGS = \ + $(GLIB2_CFLAGS) \ + $(LIBNL_CFLAGS) \ + $(NCURSES_CFLAGS) \ +- $(PCIUTILS_CFLAGS) ++ $(PCIUTILS_CFLAGS) \ ++ $(PTHREAD_CFLAGS) + + powertop_CPPFLAGS = \ + -DLOCALEDIR=\"$(localedir)\" \ +@@ -541,7 +542,8 @@ powertop_CPPFLAGS = \ + $(LIBNL_CFLAGS) \ + $(LIBZ_CFLAGS) \ + $(NCURSES_CFLAGS) \ +- $(PCIUTILS_CFLAGS) ++ $(PCIUTILS_CFLAGS) \ ++ $(PTHREAD_CFLAGS) + + powertop_LDADD = \ + ../traceevent/libtraceevnet.la diff --git a/powertop.spec b/powertop.spec index 914194b..51ab827 100644 --- a/powertop.spec +++ b/powertop.spec @@ -1,29 +1,24 @@ -Name: powertop -Version: 2.7 -Release: 6%{?dist} -Summary: Power consumption monitor +Name: powertop +Version: 2.8 +Release: 1%{?dist} +Summary: Power consumption monitor -Group: Applications/System -License: GPLv2 -URL: http://01.org/powertop/ -Source0: http://01.org/powertop/sites/default/files/downloads/%{name}-%{version}.tar.gz -Source1: powertop.service +Group: Applications/System +License: GPLv2 +URL: http://01.org/powertop/ +Source0: http://01.org/powertop/sites/default/files/downloads/%{name}-%{version}.tar.gz +Source1: powertop.service # Sent upstream -Patch0: powertop-2.7-always-create-params.patch -Patch1: powertop-2.7-tunable-overflow-fix.patch -# Taken from upstream -Patch2: powertop-2.7-auto-tune-crash-fix.patch -# Sent upstream, patch by Pierre-Yves Chibon -Patch3: powertop-2.7-navigate-hint.patch -# Backported from upstream -Patch4: powertop-2.7-baytrail-no-c7.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: gettext, ncurses-devel, pciutils-devel, zlib-devel, libnl3-devel -BuildRequires: systemd -Requires(post): systemd, coreutils -Requires(preun): systemd +Patch0: powertop-2.7-always-create-params.patch +# Sent upstream +Patch1: powertop-2.8-pthreads-cflags-fix.patch +BuildRequires: gettext-devel, ncurses-devel, pciutils-devel, zlib-devel, libnl3-devel +BuildRequires: systemd +Requires(post): systemd, coreutils +Requires(preun): systemd Requires(postun): systemd +Provides: bundled(kernel-event-lib) %description PowerTOP is a tool that finds the software component(s) that make your @@ -32,10 +27,7 @@ computer use more power than necessary while it is idle. %prep %setup -q %patch0 -p1 -b .always-create-params -%patch1 -p1 -b .tunable-overfow-fix -%patch2 -p1 -b .autotune-crash-fix -%patch3 -p1 -b .navigate-hint -%patch4 -p1 -b .baytrail-no-c7 +%patch1 -p1 -b .pthreads-cflags-fix %build %configure @@ -76,6 +68,16 @@ rm -rf %{buildroot} %{_unitdir}/powertop.service %changelog +* Tue Nov 10 2015 Jaroslav Škarvada - 2.8-1 +- New version + Resolves: rhbz#1279872 +- Dropped tunable-overflow-fix, auto-tune-crash-fix, navigate-hint + patches (all upstreamed) +- Dropped bytrail-no-c7 patch (following upstream) +- Fixed linkage with pthreads (by pthreads-cflags-fix patch) +- Added bundled(kernel-event-lib) + Resolves: rhbz#1041323 + * Thu Jun 18 2015 Fedora Release Engineering - 2.7-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild