[PATCH] fix cpuidle state name parsing
by Rajagopal Venkat
parse cpuidle C state based on sysfs file entry(stateX)
instead of state name/description
Signed-off-by: Rajagopal Venkat <rajagopal.venkat(a)linaro.org>
---
src/cpu/abstract_cpu.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/abstract_cpu.cpp b/src/cpu/abstract_cpu.cpp
index cd4eba0..72969fc 100644
--- a/src/cpu/abstract_cpu.cpp
+++ b/src/cpu/abstract_cpu.cpp
@@ -147,7 +147,7 @@ void abstract_cpu::insert_cstate(const char *linux_name, const char *human_name,
strcpy(state->linux_name, linux_name);
strcpy(state->human_name, human_name);
- c = human_name;
+ c = linux_name;
while (*c) {
if (strcmp(linux_name, "active")==0) {
state->line_level = LEVEL_C0;
--
1.7.9.5
9 years, 10 months
hrtimer events are not properly added -- is this bug or feature?
by Igor Zhbanov
Hello!
In the function start_process_measurement() in the file src/process/do_process.cpp
events are added to perf_bundle:
perf_events->add_event("irq:softirq_entry");
perf_events->add_event("irq:softirq_exit");
perf_events->add_event("timer:timer_expire_entry");
perf_events->add_event("timer:timer_expire_exit");
perf_events->add_event("hrtimer_expire_entry"); /* !!! */
perf_events->add_event("hrtimer_expire_exit"); /* !!! */
if (!perf_events->add_event("power:cpu_idle")){
perf_events->add_event("power:power_start");
perf_events->add_event("power:power_end");
}
As you may see all events are prefixed with the subsystem name.
All but hrtimer_expire_entry and hrtimer_expire_exit. And without "timer:" prefix
these events are never catched.
So I have added this prefix and see that events are intercepted as needed.
But event parser complains about wrong event format:
unknown op '{'
failed to read event print fmt for hrtimer_expire_entry
It seems that event parser can't handle square bracket in print format for the event:
print fmt: "hrtimer=%p function=%pf now=%llu", REC->hrtimer, REC->function, (unsigned long long)(((ktime_t) { .tv64 = REC->now }).tv64)
So is the absence of "timer:" prefix a bug or a commenting of non-working case?
Thank you.
--
Best regards,
Igor Zhbanov,
Expert Software Engineer,
phone: +7 (495) 797 25 00 ext 3806
e-mail: i.zhbanov(a)samsung.com
ASWG, Moscow R&D center, Samsung Electronics
12 Dvintsev street, building 1
127018, Moscow, Russian Federation
9 years, 10 months
[PATCH] configure: First try to use libnl-3, then libnl-2, then libnl-1
by Igor Zhbanov
Change search order for libnl in configure.ac:
first try to use libnl-3, then libnl-2, then libnl-1.
---
configure.ac | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3f5775f..552626c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,12 +53,13 @@ PKG_CHECK_MODULES([PCIUTILS], [libpci],[has_libpci=1],[
has_libnl_ver=0
-PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [
- AC_SEARCH_LIBS([nl_socket_alloc], [nl], [has_libnl_ver=2], [
- PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0], [has_libnl_ver=3],
- [AC_SEARCH_LIBS([nl_socket_alloc], [nl-3 nl-genl-3], [has_libnl_ver=3], [], [])])
- ], [])
-])
+PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0], [
+ has_libnl_ver=3], [
+ AC_SEARCH_LIBS([nl_socket_alloc], [nl-3 nl-genl-3], [
+ has_libnl_ver=3], [
+ AC_SEARCH_LIBS([nl_socket_alloc], [nl], [
+ has_libnl_ver=2], [
+ PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [])])])])
if (test "$has_libnl_ver" -eq 0); then
AC_MSG_ERROR(libnl is required but not found)
fi
--
1.7.5.4
9 years, 10 months
[PATCH 1/2] Make it possible to include parse-events.h before libc headers.
by Magnus Fromreide
The __unused macro interferes with the glibc and is in a reserved namespace
so it should be renamed.
Additionally the __ununsed macro is used from just one implementation file so
the macro is moved there.
Signed-off-by: Magnus Fromreide <magfr(a)lysator.liu.se>
---
pevent/parse-events.c | 12 +++++++++---
pevent/parse-events.h | 4 ----
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/pevent/parse-events.c b/pevent/parse-events.c
index 58716e9..c039698 100644
--- a/pevent/parse-events.c
+++ b/pevent/parse-events.c
@@ -37,6 +37,10 @@
#include "parse-events.h"
+#ifndef pevent_unused
+#define pevent_unused __attribute__ ((unused))
+#endif
+
static const char *input_buf;
static unsigned long long input_buf_ptr;
static unsigned long long input_buf_siz;
@@ -1777,7 +1781,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
}
static enum event_type
-process_entry(struct event_format *event __unused, struct print_arg *arg,
+process_entry(struct event_format *event pevent_unused, struct print_arg *arg,
char **tok)
{
enum event_type type;
@@ -2350,7 +2354,8 @@ process_paren(struct event_format *event, struct print_arg *arg, char **tok)
static enum event_type
-process_str(struct event_format *event __unused, struct print_arg *arg, char **tok)
+process_str(struct event_format *event pevent_unused, struct print_arg *arg,
+ char **tok)
{
enum event_type type;
char *token;
@@ -3500,7 +3505,8 @@ static void free_args(struct print_arg *args)
}
static char *
-get_bprint_format(void *data, int size __unused, struct event_format *event)
+get_bprint_format(void *data, int size pevent_unused,
+ struct event_format *event)
{
struct pevent *pevent = event->pevent;
unsigned long long addr;
diff --git a/pevent/parse-events.h b/pevent/parse-events.h
index 5d5d195..124aa1b 100644
--- a/pevent/parse-events.h
+++ b/pevent/parse-events.h
@@ -27,10 +27,6 @@
#include <stdarg.h>
#include <regex.h>
-#ifndef __unused
-#define __unused __attribute__ ((unused))
-#endif
-
/* ----------------------- trace_seq ----------------------- */
--
1.7.10.4
9 years, 10 months
[PATCH 2/2] Move some includes to the implementation in order to reduce their scope.
by Magnus Fromreide
Signed-off-by: Magnus Fromreide <magfr(a)lysator.liu.se>
---
src/perf/perf.cpp | 5 ++++-
src/perf/perf_event.h | 4 ----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/perf/perf.cpp b/src/perf/perf.cpp
index 102e224..9a30e9f 100644
--- a/src/perf/perf.cpp
+++ b/src/perf/perf.cpp
@@ -23,6 +23,8 @@
* Arjan van de Ven <arjan(a)linux.intel.com>
*/
+#include "perf.h"
+
#include <iostream>
#include <fstream>
@@ -35,11 +37,12 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
+#include <linux/ioctl.h>
+#include <sys/syscall.h>
#include <fcntl.h>
#include "perf_event.h"
-#include "perf.h"
#include "../lib.h"
#include "../display.h"
diff --git a/src/perf/perf_event.h b/src/perf/perf_event.h
index 92a38b8..a28a570 100644
--- a/src/perf/perf_event.h
+++ b/src/perf/perf_event.h
@@ -39,10 +39,6 @@
#define _LINUX_PERF_EVENT_H
#include <linux/types.h>
-#include <linux/ioctl.h>
-#include <asm/byteorder.h>
-#include <sys/syscall.h>
-
/*
* User-space ABI bits:
--
1.7.10.4
9 years, 11 months
[PATCH] Fix typo in the translation file hu_HU.po
by Igor Zhbanov
Fix typo in the translation file hu_HU.po causing build errors.
---
po/hu_HU.po | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/po/hu_HU.po b/po/hu_HU.po
index 0d817e2..1af051d 100644
--- a/po/hu_HU.po
+++ b/po/hu_HU.po
@@ -553,7 +553,7 @@ msgstr "El��k��sz��l��s a m��r��sek elv��gz��s��hez\n"
#: src/main.cpp:255
#, c-format
msgid "Taking %d measurement(s) for a duration of %d second(s) each.\n"
-msgstr "%d darab, egyenk��nt %d m��sodperces m��r��s k��sz��t��se.\\n"
+msgstr "%d darab, egyenk��nt %d m��sodperces m��r��s k��sz��t��se.\n"
#: src/main.cpp:278
#, c-format
--
1.7.5.4
9 years, 11 months
[PATCH] Relaxed autoconf version restriction for scratchbox build
by Igor Zhbanov
Relaxed autoconf version restriction for scratchbox build.
PowerTOP successfully builds with 2.67 version of Autotools.
---
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4b3d027..e1e670a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ([2.68])
+AC_PREREQ([2.67])
AC_INIT([powertop], [2.0], [powertop(a)lists.01.org])
AM_INIT_AUTOMAKE([-Wall foreign ])
AC_LANG([C++])
--
1.7.5.4
9 years, 11 months
[PATCH] Get rid of ncurses' TRUE and FALSE
by Igor Zhbanov
Get rid of TRUE and FALSE ncurses' defines used for boolean variables
initialization. This fix also helps build without ncurses support.
---
src/main.cpp | 6 +++---
src/tuning/tuning.cpp | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/main.cpp b/src/main.cpp
index 7a1b976..9f53b46 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -354,7 +354,7 @@ int main(int argc, char **argv)
{
int option_index;
int c;
- bool wantreport = FALSE;
+ bool wantreport = false;
char filename[4096];
char workload[4096] = {0,};
int iterations = 1;
@@ -396,7 +396,7 @@ int main(int argc, char **argv)
break;
case 'h': /* html report */
- wantreport = TRUE;
+ wantreport = true;
reporttype = 1;
sprintf(filename, "%s", optarg ? optarg : "PowerTOP.html" );
break;
@@ -417,7 +417,7 @@ int main(int argc, char **argv)
break;
case 'C': /* csv report*/
- wantreport = TRUE;
+ wantreport = true;
reporttype = 0;
sprintf(filename, "%s", optarg ? optarg : "PowerTOP.csv");
break;
diff --git a/src/tuning/tuning.cpp b/src/tuning/tuning.cpp
index 1a90417..865d986 100644
--- a/src/tuning/tuning.cpp
+++ b/src/tuning/tuning.cpp
@@ -43,7 +43,7 @@
#include "../lib.h"
static void sort_tunables(void);
-static bool should_clear = FALSE;
+static bool should_clear = false;
#ifndef DISABLE_NCURSES
class tuning_window: public tab_window {
@@ -103,7 +103,7 @@ static void __tuning_update_display(int cursor_pos)
return;
if (should_clear) {
- should_clear = FALSE;
+ should_clear = false;
wclear(win);
}
@@ -185,7 +185,7 @@ static bool tunables_sort(class tunable * i, class tunable * j)
void tuning_window::window_refresh()
{
clear_tuning();
- should_clear = TRUE;
+ should_clear = true;
init_tuning();
}
--
1.7.5.4
9 years, 11 months
writeback sysfs tunable only likes one magic value
by Mikko Tiihonen
Hi,
On one of my systems I have set dirty_writeback_centisecs to 2500. Because
it does not exactly match the powertop magic value of 1500 the powertop
reports it as a Bad value.
Would it be possible to modify the code to accept anything >= 1500 as Good?
I checked out the source code and the value seems to come from here:
In src/tuning/tuning.cpp:
add_sysfs_tunable(_("VM writeback timeout"),
"/proc/sys/vm/dirty_writeback_centisecs", "1500");
Maybe it would be possible to add an optional flag at the end to specify
the comparision function(eg. == > >= < <=) ?
-Mikko
9 years, 11 months
building on Fedora 17
by Howard, James D
I downloaded PowerTop ver. 2.0 and attempted to build it with:
./autogen.sh
then
./configure
The configure script is not finding "LIBNL" and nl_socket_alloc.
My Fedora 17 installation seems to have libnl and the looked-for symbol:
$ rpm -qa | grep libnl
libnl3-3.2.7-1.fc17.x86_64
libnl-1.1-15.fc17.x86_64
And, nl_socket_alloc is defined in (at least) the 64-bit library /usr/lib64/libnl-3.so.200:
$ nm --dynamic /usr/lib64/libnl-3.so.200 | grep nl_socket_alloc
00000039c360f740 T nl_socket_alloc
00000039c360f6d0 T nl_socket_alloc_cb
Is this something that the Fedora 17 distribution has changed in the libnl naming string -- again?
--
james.d.howard(a)intel.com Principal Engineer
//Intel/SSG/DRD/PAE/FACE/DCE
+1-503-712-8608
9 years, 11 months