From patchwork Mon Aug 30 13:08:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 142431 X-Patchwork-Delegate: khilman@deeprootsystems.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 o7UD8Mb8029853 for ; Mon, 30 Aug 2010 13:08:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755203Ab0H3NIU (ORCPT ); Mon, 30 Aug 2010 09:08:20 -0400 Received: from mail-qw0-f46.google.com ([209.85.216.46]:34615 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755016Ab0H3NIU convert rfc822-to-8bit (ORCPT ); Mon, 30 Aug 2010 09:08:20 -0400 Received: by qwh6 with SMTP id 6so4807618qwh.19 for ; Mon, 30 Aug 2010 06:08:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.96.84 with SMTP id g20mr3097583qcn.47.1283173693846; Mon, 30 Aug 2010 06:08:13 -0700 (PDT) Received: by 10.229.51.19 with HTTP; Mon, 30 Aug 2010 06:08:13 -0700 (PDT) X-Originating-IP: [87.66.152.139] In-Reply-To: <87iq2wsz2u.fsf@deeprootsystems.com> References: <87r5hmft7c.fsf@deeprootsystems.com> <87iq2wsz2u.fsf@deeprootsystems.com> Date: Mon, 30 Aug 2010 15:08:13 +0200 Message-ID: Subject: Re: [PATCH] OMAP2: add cpuidle and cpufreq events tracing From: Jean Pihet To: Kevin Hilman Cc: linux-omap@vger.kernel.org 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]); Mon, 30 Aug 2010 13:08:22 +0000 (UTC) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 3d3d035..6113bd9 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -130,6 +131,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev, local_irq_disable(); local_fiq_disable(); + trace_power_start(POWER_CSTATE, cx->type, smp_processor_id()); pwrdm_set_next_pwrst(mpu_pd, mpu_state); pwrdm_set_next_pwrst(core_pd, core_state); diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index f25bc3d..04bc758 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -588,6 +589,7 @@ static void omap3_pm_idle(void) if (omap_irq_pending() || need_resched()) goto out; + trace_power_start(POWER_CSTATE, 1, smp_processor_id()); omap_sram_idle(); out: diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c index df08829..cc4e41f 100644 --- a/arch/arm/plat-omap/cpu-omap.c +++ b/arch/arm/plat-omap/cpu-omap.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -116,8 +117,10 @@ static int omap_target(struct cpufreq_policy *policy, cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); #elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE) freq = target_freq * 1000; - if (opp_find_freq_ceil(mpu_dev, &freq)) + if (opp_find_freq_ceil(mpu_dev, &freq)) { + trace_power_frequency(POWER_PSTATE, freq, smp_processor_id()); omap_pm_cpu_set_freq(freq); + } #endif return ret; }