[PATCH] Fix running failure when > 69 CPUs for open file limitation
by Youquan Song
Powertop 2.3 fails to run on machine with > 69 CPUs because system open files
limitation of one process is 1024 default, While powertop will open one file
for every monitored perf_event (at least 15) each CPU.
Like on 80 CPUs Westmere-EX machine, powertop will fail to run with below:
PowerTOP v2.3 needs the kernel to support the 'perf' subsystem
as well as support for trace points in the kernel:
CONFIG_PERF_EVENTS=y
CONFIG_PERF_COUNTERS=y
CONFIG_TRACEPOINTS=y
CONFIG_TRACING=y
This patch is to change RLIMIT_NOFILE from default (1024) to max limition.
Signed-off-by: Youquan Song <youquan.song(a)intel.com>
---
src/main.cpp | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/main.cpp b/src/main.cpp
index 0883424..8cd97a2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -36,6 +36,7 @@
#include <getopt.h>
#include <unistd.h>
#include <locale.h>
+#include <sys/resource.h>
#include "cpu/cpu.h"
#include "process/process.h"
@@ -283,9 +284,14 @@ static void powertop_init(void)
static char initialized = 0;
int ret;
struct statfs st_fs;
+ struct rlimit rlmt;
if (initialized)
return;
+
+ getrlimit (RLIMIT_NOFILE, &rlmt);
+ rlmt.rlim_cur = rlmt.rlim_max;
+ setrlimit (RLIMIT_NOFILE, &rlmt);
checkroot();
ret = system("/sbin/modprobe cpufreq_stats > /dev/null 2>&1");
--
1.7.7.4
9 years
Re: [Powertop] Seg Fault due to function format_watts in file src/lib.cpp
by Sergey Senozhatsky
On (05/21/13 12:20), Ganapati Bhat wrote:
> Dear Sergey,
> Powertop --html is working fine with the patch applied. I am able to
> successfully execute the command and get the results. However, still
> trying to understand the patch and the difference when I changed the 0 to
> len in while (mbstowcs(NULL,buffer,0) < len) inside src/lib.cpp file.
> Now, will try to adopt the latest version of powertop for android.
> Thanks for all the help and sorry for the delay.
> Regards,
> Ganapati Bhat
>
Thanks Ganapati!
Kristen, could you please take a look if we can land it in upcoming
release?
https://lists.01.org/pipermail/powertop/2013-February/000782.html
Reported-and-Tested-by: Ganapati Bhat <life.mytake(a)gmail.com>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
-ss
> On Tue, May 21, 2013 at 11:23 AM, Ganapati Bhat <[1]life.mytake(a)gmail.com>
> wrote:
>
> Hello,
> I am really sorry. i was involved in some other tasks. Will get back to
> you in a couple of days.
> Ganapati Bhat
>
> On Mon, May 20, 2013 at 6:56 PM, Sergey Senozhatsky
> <[2]sergey.senozhatsky(a)gmail.com> wrote:
>
> On (02/28/13 14:45), Ganapati Bhat wrote:
> > Dear All,
> > I was compiling powertop as an Android external module and using
> the
> > option powertop --html. However, there used to be a segmentation
> fault.
> > When i looked into it, I observed that in the function
> format_watts in
> > src/lib.cpp, the last�argument�to mbstows was zero. By changing
> the
> > argument to len, which is itself an argument to the function
> format_watts,
> > powertop worked properly? Does this also happen on an x86
> machine? ( I am
> > unable to verify this due to some problems in my laptop which I
> have not
> > yet resolved.) If not then can someone explain to me why is it
> happening
> > in the case of android?
> > Thanks and Regards,
> > Ganapati
>
> Hello,
>
> did you have any chance to test the patch?
>
> -ss
>
> > _______________________________________________
> > PowerTop mailing list
> > [3]PowerTop(a)lists.01.org
> > [4]https://lists.01.org/mailman/listinfo/powertop
>
> References
>
> Visible links
> 1. mailto:life.mytake@gmail.com
> 2. mailto:sergey.senozhatsky@gmail.com
> 3. mailto:PowerTop@lists.01.org
> 4. https://lists.01.org/mailman/listinfo/powertop
9 years, 1 month
Seg Fault due to function format_watts in file src/lib.cpp
by Ganapati Bhat
Dear All,
I was compiling powertop as an Android external module and using the option
powertop --html. However, there used to be a segmentation fault. When i
looked into it, I observed that in the function format_watts in
src/lib.cpp, the last argument to mbstows was zero. By changing the
argument to len, which is itself an argument to the function format_watts,
powertop worked properly? Does this also happen on an x86 machine? ( I am
unable to verify this due to some problems in my laptop which I have not
yet resolved.) If not then can someone explain to me why is it happening in
the case of android?
Thanks and Regards,
Ganapati
9 years, 1 month
[PATCH 0/2] Document key bindings
by Hans-Peter Deifel
Hi list,
I had trouble finding all keybindings for powertop and decided to
document them better. The first patch makes the code itself more
readable, the second one adds a new section about keys to the man
page.
Regards,
Hans-Peter
Hans-Peter Deifel (2):
Use symbolic instead of numeric constants for keys
Document key bindings in man page
doc/powertop.8 | 32 ++++++++++++++++++++++++++++++++
src/main.cpp | 10 +++++-----
2 files changed, 37 insertions(+), 5 deletions(-)
--
1.8.1.5
9 years, 1 month
How does powertop make power consumption estimation?
by Kevin Qiu
I am looking into the source code, but it's a bunch of codes. And lack
of knowledge of CPP itself brings me more troubles. Can some one
described to me how powertop makes power consumption estimation. And
which files does the job for make estimation for different devices? Are
there similar linux open source software does the similar job?
KevinQ
9 years, 1 month
[Announce] 2.4 string freeze
by Kristen Carlson Accardi
Hi,
We are roughly sticking to the schedule that Chris laid out for the
first half of 2013. I delayed by one week because we were a bit
late with the last release. This means we are freezing strings today
(5/8), and then the 2.4 release will happen 2 weeks later (5/22).
Thanks,
Kristen
9 years, 1 month