public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Robert Schöne" <robert.schoene@tu-dresden.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: add power_end event to process_*.c cpu_idle routine
Date: Mon, 14 Jun 2010 13:37:20 +0200	[thread overview]
Message-ID: <1276515440.5441.45.camel@localhost> (raw)

From: Robert Schöne <robert.schoene@tu-dresden.de>

Systems using the idle thread from process_32.c and process_64.c do not
generate power_end events which could be traced using perf. This patch
adds the event generation for such systems.

Signed-off-by: Robert Schöne <robert.schoene@tu-dresden.de>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>

---
The smp_processor_id() is given to power_end as i hope that the changed
interface defined in http://lkml.org/lkml/2010/4/27/271 will be part of
the standard tree one day. (It is currently part of the -mm tree.) As
long as this new interface is not included in the standard tree, this
patch won't make no harm. When it will be included, this code does not
have to be touched anymore.


 arch/x86/kernel/process_32.c |    4 ++++
 arch/x86/kernel/process_64.c |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index f6c6266..134f5f9 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -58,6 +58,8 @@
 #include <asm/ds.h>
 #include <asm/debugreg.h>
 
+#include <trace/events/power.h> 
+
 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
 
 /*
@@ -112,6 +114,8 @@ void cpu_idle(void)
 			stop_critical_timings();
 			pm_idle();
 			start_critical_timings();
+
+			trace_power_end(smp_processor_id());
 		}
 		tick_nohz_restart_sched_tick();
 		preempt_enable_no_resched();
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 17cb329..01c55ed 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -52,6 +52,8 @@
 #include <asm/ds.h>
 #include <asm/debugreg.h>
 
+#include <trace/events/power.h> 
+
 asmlinkage extern void ret_from_fork(void);
 
 DEFINE_PER_CPU(unsigned long, old_rsp);
@@ -139,6 +141,9 @@ void cpu_idle(void)
 			stop_critical_timings();
 			pm_idle();
 			start_critical_timings();
+
+			trace_power_end(smp_processor_id());
+
 			/* In many cases the interrupt that ended idle
 			   has already called exit_idle. But some idle
 			   loops can be woken up without interrupt. */





                 reply	other threads:[~2010-06-14 11:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1276515440.5441.45.camel@localhost \
    --to=robert.schoene@tu-dresden.de \
    --cc=arjan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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