aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarjan <arjan@arjan-desktop.localdomain>2010-09-10 04:41:07 -0700
committerarjan <arjan@arjan-desktop.localdomain>2010-09-10 04:41:07 -0700
commit4b4b3128b7eb4612599cd88cf28172bd51d07164 (patch)
tree6b0a4345ce6eb1910c9c8ae7829601438a42d419
parenta94189471105cb1a16a0f34f2835336ff03499bd (diff)
downloadpowertop-4b4b3128b7eb4612599cd88cf28172bd51d07164.tar.gz
use a proper constructor to initialize powerconsumer variables
-rw-r--r--process/device.cpp5
-rw-r--r--process/interrupt.cpp5
-rw-r--r--process/powerconsumer.cpp10
-rw-r--r--process/powerconsumer.h3
-rw-r--r--process/process.cpp5
-rw-r--r--process/timer.cpp5
-rw-r--r--process/work.cpp5
7 files changed, 13 insertions, 25 deletions
diff --git a/process/device.cpp b/process/device.cpp
index 52bd157..5f4c839 100644
--- a/process/device.cpp
+++ b/process/device.cpp
@@ -4,11 +4,6 @@
device_consumer::device_consumer(class device *dev)
{
- wake_ups = 0;
- disk_hits = 0;
- accumulated_runtime = 0;
- child_runtime = 0;
- waker = NULL;
device = dev;
power = device->power_usage(&all_results, &all_parameters);
}
diff --git a/process/interrupt.cpp b/process/interrupt.cpp
index 4459cf6..ca48011 100644
--- a/process/interrupt.cpp
+++ b/process/interrupt.cpp
@@ -25,11 +25,6 @@ interrupt::interrupt(const char *_handler, int _number)
running_since = 0;
number = _number;
strncpy(handler, _handler, 31);
- wake_ups = 0;
- disk_hits = 0;
- accumulated_runtime = 0;
- child_runtime = 0;
- waker = NULL;
raw_count = 0;
}
diff --git a/process/powerconsumer.cpp b/process/powerconsumer.cpp
index ae2c8c2..24bdf02 100644
--- a/process/powerconsumer.cpp
+++ b/process/powerconsumer.cpp
@@ -22,3 +22,13 @@ double power_consumer::Witts(void)
return cost;
}
+
+power_consumer::power_consumer(void)
+{
+ accumulated_runtime = 0;
+ child_runtime = 0;
+ disk_hits = 0;
+ wake_ups = 0;
+ gpu_ops = 0;
+ waker = NULL;
+} \ No newline at end of file
diff --git a/process/powerconsumer.h b/process/powerconsumer.h
index 35d6893..1fa2008 100644
--- a/process/powerconsumer.h
+++ b/process/powerconsumer.h
@@ -17,8 +17,11 @@ public:
uint64_t child_runtime;
int disk_hits;
int wake_ups;
+ int gpu_ops;
class power_consumer *waker;
+ power_consumer(void);
+
virtual double Witts(void);
virtual const char * description(void) { return ""; };
diff --git a/process/process.cpp b/process/process.cpp
index 6ce16f5..6d4f5ac 100644
--- a/process/process.cpp
+++ b/process/process.cpp
@@ -44,13 +44,8 @@ process::process(const char *_comm, int _pid)
{
strcpy(comm, _comm);
pid = _pid;
- accumulated_runtime = 0;
- child_runtime = 0;
- wake_ups = 0;
- disk_hits = 0;
is_idle = 0;
running = 0;
- waker = NULL;
if (strncmp(_comm, "kondemand/", 10) == 0)
is_idle = 1;
diff --git a/process/timer.cpp b/process/timer.cpp
index 891d71f..551d865 100644
--- a/process/timer.cpp
+++ b/process/timer.cpp
@@ -15,11 +15,6 @@ using namespace std;
timer::timer(unsigned long address)
{
strncpy(handler, kernel_function(address), 31);
- wake_ups = 0;
- disk_hits = 0;
- accumulated_runtime = 0;
- child_runtime = 0;
- waker = NULL;
raw_count = 0;
}
diff --git a/process/work.cpp b/process/work.cpp
index fde1119..9747b41 100644
--- a/process/work.cpp
+++ b/process/work.cpp
@@ -15,11 +15,6 @@ using namespace std;
work::work(unsigned long address)
{
strncpy(handler, kernel_function(address), 31);
- wake_ups = 0;
- disk_hits = 0;
- accumulated_runtime = 0;
- child_runtime = 0;
- waker = NULL;
raw_count = 0;
}