From: "Ronny Tschüter" <Ronny.Tschueter@tu-dresden.de>
To: "Robert Schöne" <robert.schoene@tu-dresden.de>
Cc: Arjan van de Ven <arjan@linux.intel.com>,
rostedt@goodmis.org, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Tracing of power:power_start events doesn't work
Date: Tue, 29 Jun 2010 16:49:12 +0200 [thread overview]
Message-ID: <4C2A07E8.7000005@tu-dresden.de> (raw)
In-Reply-To: <4C120F67.3050400@tu-dresden.de>
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
prev parent reply other threads:[~2010-06-29 14:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-03 13:19 Ronny Tschüter
2010-05-03 21:36 ` Frank Ch. Eigler
2010-05-05 0:31 ` Steven Rostedt
2010-05-05 6:34 ` Ronny Tschüter
2010-05-05 17:23 ` Frederic Weisbecker
2010-05-06 6:32 ` Ronny Tschüter
2010-05-05 14:11 ` Ronny Tschüter
2010-05-05 14:31 ` Steven Rostedt
2010-05-05 14:33 ` Arjan van de Ven
2010-05-12 8:57 ` Robert Schöne
2010-06-11 10:26 ` Ronny Tschüter
2010-06-29 14:49 ` Ronny Tschüter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C2A07E8.7000005@tu-dresden.de \
--to=ronny.tschueter@tu-dresden.de \
--cc=arjan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=robert.schoene@tu-dresden.de \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome