From 3c2a36679ce606e45920941cc241b3d41720de2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Fri, 20 Sep 2013 10:59:20 +0200 Subject: [PATCH] Unlimit FDs (by unlimit-fds patch) and dropped the fd-limit-err patch --- powertop-2.4-fd-limit-err.patch | 38 --------------------------------- powertop.spec | 11 ++++++---- 2 files changed, 7 insertions(+), 42 deletions(-) delete mode 100644 powertop-2.4-fd-limit-err.patch diff --git a/powertop-2.4-fd-limit-err.patch b/powertop-2.4-fd-limit-err.patch deleted file mode 100644 index d517e94..0000000 --- a/powertop-2.4-fd-limit-err.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -up powertop-2.4/src/perf/perf.cpp.orig powertop-2.4/src/perf/perf.cpp ---- powertop-2.4/src/perf/perf.cpp.orig 2013-01-31 16:39:27.000000000 -0500 -+++ powertop-2.4/src/perf/perf.cpp 2013-09-19 10:36:02.298839248 -0400 -@@ -26,6 +26,7 @@ - #include - #include - -+#include - #include - #include - #include -@@ -72,6 +73,7 @@ void perf_event::create_perf_event(char - { - struct perf_event_attr attr; - int ret; -+ int err; - - struct { - __u64 count; -@@ -107,10 +109,15 @@ void perf_event::create_perf_event(char - perf_fd = sys_perf_event_open(&attr, -1, _cpu, -1, 0); - - if (perf_fd < 0) { -+ err = errno; - reset_display(); -- fprintf(stderr, _("PowerTOP %s needs the kernel to support the 'perf' subsystem\n"), POWERTOP_VERSION); -- fprintf(stderr, _("as well as support for trace points in the kernel:\n")); -- fprintf(stderr, "CONFIG_PERF_EVENTS=y\nCONFIG_PERF_COUNTERS=y\nCONFIG_TRACEPOINTS=y\nCONFIG_TRACING=y\n"); -+ if (err == EMFILE) -+ fprintf(stderr, _("Too many open files, please increase the limit of open file descriptors.\n")); -+ else { -+ fprintf(stderr, _("PowerTOP %s needs the kernel to support the 'perf' subsystem\n"), POWERTOP_VERSION); -+ fprintf(stderr, _("as well as support for trace points in the kernel:\n")); -+ fprintf(stderr, "CONFIG_PERF_EVENTS=y\nCONFIG_PERF_COUNTERS=y\nCONFIG_TRACEPOINTS=y\nCONFIG_TRACING=y\n"); -+ } - exit(EXIT_FAILURE); - } - if (read(perf_fd, &read_data, sizeof(read_data)) == -1) { diff --git a/powertop.spec b/powertop.spec index c569d27..93cc316 100644 --- a/powertop.spec +++ b/powertop.spec @@ -1,6 +1,6 @@ Name: powertop Version: 2.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Power consumption monitor Group: Applications/System @@ -14,8 +14,8 @@ Patch0: powertop-2.3-always-create-params.patch Patch1: powertop-2.3-man-fix.patch # Sent upstream (http://github.com/fenrus75/powertop/pull/12) Patch2: powertop-2.3-ondemand-check.patch -# Sent upstream (http://github.com/fenrus75/powertop/pull/14) -Patch3: powertop-2.4-fd-limit-err.patch +# Accepted upstream +Patch3: powertop-2.4-unlimit-fds.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gettext, ncurses-devel, pciutils-devel, zlib-devel, libnl3-devel Requires(post): coreutils @@ -29,7 +29,7 @@ computer use more power than necessary while it is idle. %patch0 -p1 -b .always-create-params %patch1 -p1 -b .man-fix %patch2 -p1 -b .ondemand-check -%patch3 -p1 -b .fd-limit-err +%patch3 -p1 -b .unlimit-fds # remove left over object files find . -name "*.o" -exec rm {} \; @@ -62,6 +62,9 @@ rm -rf %{buildroot} %{_mandir}/man8/powertop.8* %changelog +* Fri Sep 20 2013 Jaroslav Škarvada - 2.4-4 +- Unlimit FDs (by unlimit-fds patch) and dropped the fd-limit-err patch + * Thu Sep 19 2013 Jaroslav Škarvada - 2.4-3 - Printed friendly error message if the system is running out of FDs (by fd-limit-err patch)