From patchwork Fri Sep 17 22:04:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Renninger X-Patchwork-Id: 189122 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8HM5LaD031957 for ; Fri, 17 Sep 2010 22:05:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754430Ab0IQWEy (ORCPT ); Fri, 17 Sep 2010 18:04:54 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47244 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753875Ab0IQWEx (ORCPT ); Fri, 17 Sep 2010 18:04:53 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 3BE948672B; Sat, 18 Sep 2010 00:04:50 +0200 (CEST) From: Thomas Renninger To: Jean Pihet Subject: Re: [PATCH] tracing, perf: add more power related events Date: Sat, 18 Sep 2010 00:04:37 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.34.4-0.1.99.9.f8e4270-desktop; KDE/4.4.4; x86_64; ; ) Cc: Ingo Molnar , Arjan van de Ven , Peter Zijlstra , Len Brown , arjan@infradead.org, Kevin Hilman , linux-kernel@vger.kernel.org, discuss@lesswatts.org, linux-pm@lists.linux-foundation.org, linux-omap@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-trace-users@vger.kernel.org References: <201009171508.46471.trenn@suse.de> In-Reply-To: MIME-Version: 1.0 Message-Id: <201009180004.38103.trenn@suse.de> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 17 Sep 2010 22:05:21 +0000 (UTC) Index: linux-2.6.35-master/arch/x86/kernel/process.c =================================================================== --- linux-2.6.35-master.orig/arch/x86/kernel/process.c +++ linux-2.6.35-master/arch/x86/kernel/process.c @@ -375,7 +375,10 @@ static inline int hlt_use_halt(void) void default_idle(void) { if (hlt_use_halt()) { + /* trace_power_start is deprecated, remove it after a while */ trace_power_start(POWER_CSTATE, 1, smp_processor_id()); + trace_power_switch_state(POWER_CSTATE, 1, smp_processor_id()); + current_thread_info()->status &= ~TS_POLLING; /* * TS_POLLING-cleared state must be visible before we @@ -446,6 +449,8 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait); void mwait_idle_with_hints(unsigned long ax, unsigned long cx) { trace_power_start(POWER_CSTATE, (ax>>4)+1, smp_processor_id()); + trace_power_switch_state(POWER_CSTATE, (ax>>4)+1, smp_processor_id()); + if (!need_resched()) { if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) clflush((void *)¤t_thread_info()->flags); @@ -462,6 +467,8 @@ static void mwait_idle(void) { if (!need_resched()) { trace_power_start(POWER_CSTATE, 1, smp_processor_id()); + trace_power_switch_state(POWER_CSTATE, 1, smp_processor_id()); + if (cpu_has(¤t_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) clflush((void *)¤t_thread_info()->flags); @@ -482,11 +489,9 @@ static void mwait_idle(void) */ static void poll_idle(void) { - trace_power_start(POWER_CSTATE, 0, smp_processor_id()); local_irq_enable(); while (!need_resched()) cpu_relax(); - trace_power_end(0); } /* Index: linux-2.6.35-master/drivers/cpuidle/cpuidle.c =================================================================== --- linux-2.6.35-master.orig/drivers/cpuidle/cpuidle.c +++ linux-2.6.35-master/drivers/cpuidle/cpuidle.c @@ -106,7 +106,10 @@ static void cpuidle_idle_call(void) /* give the governor an opportunity to reflect on the outcome */ if (cpuidle_curr_governor->reflect) cpuidle_curr_governor->reflect(dev); + + /* trace_power_end is deprecated, remove it after a while */ trace_power_end(smp_processor_id()); + trace_power_switch_state(POWER_CSTATE, 0, smp_processor_id()); } /** Index: linux-2.6.35-master/drivers/idle/intel_idle.c =================================================================== --- linux-2.6.35-master.orig/drivers/idle/intel_idle.c +++ linux-2.6.35-master/drivers/idle/intel_idle.c @@ -192,8 +192,11 @@ static int intel_idle(struct cpuidle_dev stop_critical_timings(); #ifndef MODULE + /* trace_power_start is deprecated, remove it after a while */ trace_power_start(POWER_CSTATE, (eax >> 4) + 1, cpu); #endif + trace_power_switch_state(POWER_CSTATE, (eax >> 4) + 1, smp_processor_id()); + if (!need_resched()) { __monitor((void *)¤t_thread_info()->flags, 0, 0); Index: linux-2.6.35-master/kernel/trace/power-traces.c =================================================================== --- linux-2.6.35-master.orig/kernel/trace/power-traces.c +++ linux-2.6.35-master/kernel/trace/power-traces.c @@ -13,4 +13,4 @@ #define CREATE_TRACE_POINTS #include - +EXPORT_TRACEPOINT_SYMBOL_GPL(power_switch_state);