aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2011-05-12 13:50:52 -0700
committerArjan van de Ven <arjan@linux.intel.com>2011-05-12 13:50:52 -0700
commite25ad37227d54b9d40ec244bc692d0fbd9bc52ce (patch)
treea6fedaf05591655ddd56f6e718ef96a531ba6206
parent317a742b92522837070fd7de037857a11093f4b1 (diff)
downloadpowertop-e25ad37227d54b9d40ec244bc692d0fbd9bc52ce.tar.gz
fix this for real
-rw-r--r--process/do_process.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/process/do_process.cpp b/process/do_process.cpp
index eca6151..87d1b52 100644
--- a/process/do_process.cpp
+++ b/process/do_process.cpp
@@ -255,7 +255,7 @@ void perf_process_bundle::handle_trace_point(int type, void *trace, int cpu, uin
if (strcmp(event_name, "sched:sched_wakeup") == 0) {
struct wakeup_entry *we;
class power_consumer *from = NULL;
- class process *dest_proc;
+ class process *dest_proc, *from_proc;
int i;
we = (struct wakeup_entry *)trace;
@@ -280,10 +280,12 @@ void perf_process_bundle::handle_trace_point(int type, void *trace, int cpu, uin
if (from && strcmp(from->name(), "process")!=0){
/* not a process doing the wakeup */
from = NULL;
+ from_proc = NULL;
+ } else {
+ from_proc = (class process *) from;
}
-
- if (from && (dest_proc->running == 0) && (dest_proc->waker == NULL) && (we->pid != 0) && !dont_blame_me(we->comm))
+ if (from_proc && (dest_proc->running == 0) && (dest_proc->waker == NULL) && (we->pid != 0) && !dont_blame_me(from_proc->comm))
dest_proc->waker = from;
if (from)
dest_proc->last_waker = from;