lkml.org 
[lkml]   [2010]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectTracing of power:power_start events doesn't work
I use Linux performance counters to trace some performance related 
events. Unfortunately power:power_start events are not reported on my
machine. In /drivers/acpi/processor_idle.c I found three different ways
to call a C-state, but only one way (via architectural FFH based C-state
and using MONITOR/MWAIT) is currently instrumented. Here is my patch to
instrument the remaining two possibilities:

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index b1b3856..08e7c42 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -43,6 +43,7 @@
#include <linux/clockchips.h>
#include <linux/cpuidle.h>
#include <linux/irqflags.h>
+#include <trace/events/power.h>

/*
* Include the apic definitions for x86 to have the APIC timer related
defines
@@ -136,6 +137,7 @@ static void acpi_safe_halt(void)
*/
smp_mb();
if (!need_resched()) {
+ trace_power_start(POWER_CSTATE,1);
safe_halt();
local_irq_disable();
}
@@ -797,6 +799,10 @@ static inline void acpi_idle_do_entry(struct
acpi_processor_cx *cx)
} else {
int unused;
/* IO port based C-state */
+ trace_power_start(POWER_CSTATE,
+ cx->type == ACPI_STATE_C1 ? 1 :
+ cx->type == ACPI_STATE_C2 ? 2 :
+ 3);
inb(cx->address);
/* Dummy wait op - must do something useless after P_LVL2 read
because chipsets cannot guarantee that STPCLK# signal

\
 
 \ /
  Last update: 2010-06-29 16:51    [W:0.053 / U:8.452 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site