summaryrefslogtreecommitdiffstats
path: root/meta/packages/powertop
diff options
context:
space:
mode:
authorRoss Burton <ross@openedhand.com>2008-01-22 15:29:03 +0000
committerRoss Burton <ross@openedhand.com>2008-01-22 15:29:03 +0000
commite06f2c78392ec08913c6ac7c4d0fc24fedea3a5b (patch)
tree0cecf62442ce352fc5178304e34101be82fa0c81 /meta/packages/powertop
parent551987f968a39dca23f4bb66d8adf60fd9a74003 (diff)
downloadpoky-e06f2c78392ec08913c6ac7c4d0fc24fedea3a5b.tar.gz
powertop: fix crash in dump mode
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3572 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/powertop')
-rw-r--r--meta/packages/powertop/files/dump-fixes.patch107
-rw-r--r--meta/packages/powertop/powertop_1.9.bb5
2 files changed, 111 insertions, 1 deletions
diff --git a/meta/packages/powertop/files/dump-fixes.patch b/meta/packages/powertop/files/dump-fixes.patch
new file mode 100644
index 0000000000..7f6af7dd10
--- /dev/null
+++ b/meta/packages/powertop/files/dump-fixes.patch
@@ -0,0 +1,107 @@
1=== modified file 'display.c'
2--- powertop-1.9/display.c 2008-01-22 14:35:03 +0000
3+++ powertop-1.9/display.c 2008-01-22 14:42:30 +0000
4@@ -182,7 +182,8 @@
5 print(cstate_window, i, 38, "%s", cpufreqstrings[i]);
6 }
7
8- wrefresh(cstate_window);
9+ if (!dump)
10+ wrefresh(cstate_window);
11 }
12
13
14@@ -192,7 +193,7 @@
15
16 sprintf(buffer, _("no ACPI power usage estimate available") );
17
18- werase(acpi_power_window);
19+ if (!dump) werase(acpi_power_window);
20 if (rate > 0.001) {
21 char *c;
22 sprintf(buffer, _("Power usage (ACPI estimate): %3.1fW (%3.1f hours)"), rate, cap/rate);
23@@ -205,45 +206,51 @@
24 sprintf(buffer, _("Power usage (5 minute ACPI estimate) : %5.1f W (%3.1f hours left)"), 3600*capdelta / ti, cap / (3600*capdelta/ti+0.01));
25
26 print(acpi_power_window, 0, 0, "%s\n", buffer);
27- wrefresh(acpi_power_window);
28+ if (!dump) wrefresh(acpi_power_window);
29 }
30
31 void show_wakeups(double d, double interval, double C0time)
32 {
33- werase(wakeup_window);
34-
35- wbkgd(wakeup_window, COLOR_PAIR(PT_COLOR_RED));
36- if (d <= 25.0)
37- wbkgd(wakeup_window, COLOR_PAIR(PT_COLOR_YELLOW));
38- if (d <= 10.0)
39- wbkgd(wakeup_window, COLOR_PAIR(PT_COLOR_GREEN));
40-
41- /*
42- * if the cpu is really busy.... then make it blue to indicate
43- * that it's not the primary power consumer anymore
44- */
45- if (C0time > 25.0)
46- wbkgd(wakeup_window, COLOR_PAIR(PT_COLOR_BLUE));
47-
48- wattron(wakeup_window, A_BOLD);
49+ if (!dump) {
50+ werase(wakeup_window);
51+
52+ wbkgd(wakeup_window, COLOR_PAIR(PT_COLOR_RED));
53+ if (d <= 25.0)
54+ wbkgd(wakeup_window, COLOR_PAIR(PT_COLOR_YELLOW));
55+ if (d <= 10.0)
56+ wbkgd(wakeup_window, COLOR_PAIR(PT_COLOR_GREEN));
57+
58+ /*
59+ * if the cpu is really busy.... then make it blue to indicate
60+ * that it's not the primary power consumer anymore
61+ */
62+ if (C0time > 25.0)
63+ wbkgd(wakeup_window, COLOR_PAIR(PT_COLOR_BLUE));
64+
65+ wattron(wakeup_window, A_BOLD);
66+ }
67+
68 print(wakeup_window, 0, 0, _("Wakeups-from-idle per second : %4.1f\tinterval: %0.1fs\n"), d, interval);
69- wrefresh(wakeup_window);
70+
71+ if (!dump) wrefresh(wakeup_window);
72 }
73
74 void show_timerstats(int nostats, int ticktime)
75 {
76 int i;
77- werase(timerstat_window);
78+ if (!dump) werase(timerstat_window);
79
80 if (!nostats) {
81 int counter = 0;
82 print(timerstat_window, 0, 0, _("Top causes for wakeups:\n"));
83 for (i = 0; i < linehead; i++)
84 if (lines[i].count > 0 && counter++ < maxtimerstats) {
85- if ((lines[i].count * 1.0 / ticktime) >= 10.0)
86- wattron(timerstat_window, A_BOLD);
87- else
88- wattroff(timerstat_window, A_BOLD);
89+ if (!dump) {
90+ if ((lines[i].count * 1.0 / ticktime) >= 10.0)
91+ wattron(timerstat_window, A_BOLD);
92+ else
93+ wattroff(timerstat_window, A_BOLD);
94+ }
95 print(timerstat_window, i+1, 0," %5.1f%% (%5.1f) %s \n", lines[i].count * 100.0 / linectotal,
96 lines[i].count * 1.0 / ticktime,
97 lines[i].string);
98@@ -259,7 +266,7 @@
99 }
100
101
102- wrefresh(timerstat_window);
103+ if (!dump) wrefresh(timerstat_window);
104 }
105
106 void show_suggestion(char *sug)
107
diff --git a/meta/packages/powertop/powertop_1.9.bb b/meta/packages/powertop/powertop_1.9.bb
index ab84161ddc..f78714c719 100644
--- a/meta/packages/powertop/powertop_1.9.bb
+++ b/meta/packages/powertop/powertop_1.9.bb
@@ -3,7 +3,10 @@ HOMEPAGE = "http://www.linuxpowertop.org/"
3LICENSE = "GPLv2" 3LICENSE = "GPLv2"
4DEPENDS = "ncurses" 4DEPENDS = "ncurses"
5 5
6SRC_URI = "http://www.linuxpowertop.org/download/powertop-${PV}.tar.gz" 6PR="r1"
7
8SRC_URI = "http://www.linuxpowertop.org/download/powertop-${PV}.tar.gz \
9 file://dump-fixes.patch;patch=1"
7 10
8CFLAGS += "${LDFLAGS}" 11CFLAGS += "${LDFLAGS}"
9 12