All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: add OMAP support for the new power events
@ 2011-01-24 14:20 jean.pihet
  2011-01-24 14:55 ` Santosh Shilimkar
  2011-02-10 21:02 ` Kevin Hilman
  0 siblings, 2 replies; 36+ messages in thread
From: jean.pihet @ 2011-01-24 14:20 UTC (permalink / raw)
  To: Thomas Renninger, linux-omap; +Cc: Jean Pihet

From: Jean Pihet <j-pihet@ti.com>

The patch adds the new power management trace points for
the OMAP architecture.

The trace points are for:
- default idle handler. Since the cpuidle framework is
  instrumented in the generic way there is no need to
  add trace points in the OMAP specific cpuidle handler;
- cpufreq (DVFS),
- SoC clocks changes (enable, disable, set_rate),
- change of power domains next power states.

Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS

Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 arch/arm/mach-omap2/clock.c       |    8 +++++++-
 arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
 arch/arm/mach-omap2/powerdomain.c |    8 +++++++-
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 2a2f152..72af75d 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -22,7 +22,9 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/bitops.h>
+#include <trace/events/power.h>
 
+#include <asm/cpu.h>
 #include <plat/clock.h>
 #include "clockdomain.h"
 #include <plat/cpu.h>
@@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
 
 	pr_debug("clock: %s: disabling in hardware\n", clk->name);
 
+	trace_clock_disable(clk->name, 0, smp_processor_id());
 	clk->ops->disable(clk);
 
 	if (clk->clkdm)
@@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
 		}
 	}
 
+	trace_clock_enable(clk->name, 1, smp_processor_id());
 	ret = clk->ops->enable(clk);
 	if (ret) {
 		WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
@@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
 	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
 
 	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
-	if (clk->set_rate)
+	if (clk->set_rate) {
+		trace_clock_set_rate(clk->name, rate, smp_processor_id());
 		ret = clk->set_rate(clk, rate);
+	}
 
 	return ret;
 }
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 8cbbead..7c5e0ee 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -29,6 +29,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/console.h>
+#include <trace/events/power.h>
 
 #include <plat/sram.h>
 #include "clockdomain.h"
@@ -518,8 +519,14 @@ static void omap3_pm_idle(void)
 	if (omap_irq_pending() || need_resched())
 		goto out;
 
+	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
+	trace_cpu_idle(1, smp_processor_id());
+
 	omap_sram_idle();
 
+	trace_power_end(smp_processor_id());
+	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
+
 out:
 	local_fiq_enable();
 	local_irq_enable();
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index eaed0df..e1feb50 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -19,12 +19,15 @@
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include <trace/events/power.h>
+
 #include "cm2xxx_3xxx.h"
 #include "prcm44xx.h"
 #include "cm44xx.h"
 #include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
+#include <asm/cpu.h>
 #include <plat/cpu.h>
 #include "powerdomain.h"
 #include "clockdomain.h"
@@ -406,8 +409,11 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
 		 pwrdm->name, pwrst);
 
-	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
+	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
+		trace_power_domain_target(pwrdm->name, pwrst,
+					  smp_processor_id());
 		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
+	}
 
 	return ret;
 }
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* RE: [PATCH] perf: add OMAP support for the new power events
  2011-01-24 14:20 [PATCH] perf: add OMAP support for the new power events jean.pihet
@ 2011-01-24 14:55 ` Santosh Shilimkar
  2011-01-26  9:49   ` Jean Pihet
  2011-02-10 21:02 ` Kevin Hilman
  1 sibling, 1 reply; 36+ messages in thread
From: Santosh Shilimkar @ 2011-01-24 14:55 UTC (permalink / raw)
  To: jean.pihet, Thomas Renninger, linux-omap; +Cc: Jean Pihet-XID

Jean

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of jean.pihet@newoldbits.com
> Sent: Monday, January 24, 2011 7:51 PM
> To: Thomas Renninger; linux-omap@vger.kernel.org
> Cc: Jean Pihet
> Subject: [PATCH] perf: add OMAP support for the new power events
>
> From: Jean Pihet <j-pihet@ti.com>
>
> The patch adds the new power management trace points for
> the OMAP architecture.
>
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - change of power domains next power states.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS
>
[....]

> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-
> omap2/powerdomain.c
> index eaed0df..e1feb50 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -406,8 +409,11 @@ int pwrdm_set_next_pwrst(struct powerdomain
> *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to
> %0x\n",
>  		 pwrdm->name, pwrst);
>
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>
>  	return ret;
>  }
We need to track the actual power domain transitions as well
at hardware level.
Can you please look at "pwrdm_pre_transition()" and
"pwrdm_post_transition()"
This code keep track of it using the next power state
and prev-power state.

Regards,
Santosh

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-01-24 14:55 ` Santosh Shilimkar
@ 2011-01-26  9:49   ` Jean Pihet
  2011-01-26 10:06     ` Santosh Shilimkar
  0 siblings, 1 reply; 36+ messages in thread
From: Jean Pihet @ 2011-01-26  9:49 UTC (permalink / raw)
  To: Santosh Shilimkar; +Cc: Thomas Renninger, linux-omap, Jean Pihet-XID

On Mon, Jan 24, 2011 at 3:55 PM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
> Jean
>
>> -----Original Message-----
>> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>> owner@vger.kernel.org] On Behalf Of jean.pihet@newoldbits.com
>> Sent: Monday, January 24, 2011 7:51 PM
>> To: Thomas Renninger; linux-omap@vger.kernel.org
>> Cc: Jean Pihet
>> Subject: [PATCH] perf: add OMAP support for the new power events
>>
>> From: Jean Pihet <j-pihet@ti.com>
>>
>> The patch adds the new power management trace points for
>> the OMAP architecture.
>>
>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>>   instrumented in the generic way there is no need to
>>   add trace points in the OMAP specific cpuidle handler;
>> - cpufreq (DVFS),
>> - SoC clocks changes (enable, disable, set_rate),
>> - change of power domains next power states.
>>
>> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS
>>
> [....]
>
>> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-
>> omap2/powerdomain.c
>> index eaed0df..e1feb50 100644
>> --- a/arch/arm/mach-omap2/powerdomain.c
>> +++ b/arch/arm/mach-omap2/powerdomain.c
>> @@ -19,12 +19,15 @@
>>  #include <linux/list.h>
>>  #include <linux/errno.h>
>>  #include <linux/string.h>
>> +#include <trace/events/power.h>
>> +
>>  #include "cm2xxx_3xxx.h"
>>  #include "prcm44xx.h"
>>  #include "cm44xx.h"
>>  #include "prm2xxx_3xxx.h"
>>  #include "prm44xx.h"
>>
>> +#include <asm/cpu.h>
>>  #include <plat/cpu.h>
>>  #include "powerdomain.h"
>>  #include "clockdomain.h"
>> @@ -406,8 +409,11 @@ int pwrdm_set_next_pwrst(struct powerdomain
>> *pwrdm, u8 pwrst)
>>       pr_debug("powerdomain: setting next powerstate for %s to
>> %0x\n",
>>                pwrdm->name, pwrst);
>>
>> -     if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
>> +     if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
>> +             trace_power_domain_target(pwrdm->name, pwrst,
>> +                                       smp_processor_id());
>>               ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
>> +     }
>>
>>       return ret;
>>  }
> We need to track the actual power domain transitions as well
> at hardware level.
Agree

> Can you please look at "pwrdm_pre_transition()" and
> "pwrdm_post_transition()"
> This code keep track of it using the next power state
> and prev-power state.
The current API only has 'trace_power_domain_target' which tracks the
desired target state.
I think we need an extra tracer 'trace_power_domain_hitstate' so that
the trace parser can compare the desired ('target') and actually hit
('hitstate') states.

Thanks,
Jean

>
> Regards,
> Santosh
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH] perf: add OMAP support for the new power events
  2011-01-26  9:49   ` Jean Pihet
@ 2011-01-26 10:06     ` Santosh Shilimkar
  2011-02-07 16:05       ` Jean Pihet
  0 siblings, 1 reply; 36+ messages in thread
From: Santosh Shilimkar @ 2011-01-26 10:06 UTC (permalink / raw)
  To: Jean Pihet; +Cc: Thomas Renninger, linux-omap, Jean Pihet-XID

> -----Original Message-----
> From: Jean Pihet [mailto:jean.pihet@newoldbits.com]
> Sent: Wednesday, January 26, 2011 3:20 PM
> To: Santosh Shilimkar
> Cc: Thomas Renninger; linux-omap@vger.kernel.org; Jean Pihet-XID
> Subject: Re: [PATCH] perf: add OMAP support for the new power events
>
[...]

> > We need to track the actual power domain transitions as well
> > at hardware level.
> Agree
>
> > Can you please look at "pwrdm_pre_transition()" and
> > "pwrdm_post_transition()"
> > This code keep track of it using the next power state
> > and prev-power state.
> The current API only has 'trace_power_domain_target' which tracks
> the
> desired target state.
> I think we need an extra tracer 'trace_power_domain_hitstate' so
> that
> the trace parser can compare the desired ('target') and actually hit
> ('hitstate') states.
>
We use next state and previous state. 'hitstate' doesn't sound
well that's really secondary.

Do you plan to add that additional trace then ?

Regards,
Santosh

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-01-26 10:06     ` Santosh Shilimkar
@ 2011-02-07 16:05       ` Jean Pihet
  2011-02-07 16:12         ` Santosh Shilimkar
  0 siblings, 1 reply; 36+ messages in thread
From: Jean Pihet @ 2011-02-07 16:05 UTC (permalink / raw)
  To: Santosh Shilimkar, Tony Lindgren
  Cc: Thomas Renninger, linux-omap, Jean Pihet-XID

Hi Santosh, Tony,

On Wed, Jan 26, 2011 at 11:06 AM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
>> -----Original Message-----
>> From: Jean Pihet [mailto:jean.pihet@newoldbits.com]
>> Sent: Wednesday, January 26, 2011 3:20 PM
>> To: Santosh Shilimkar
>> Cc: Thomas Renninger; linux-omap@vger.kernel.org; Jean Pihet-XID
>> Subject: Re: [PATCH] perf: add OMAP support for the new power events
>>
> [...]
>
>> > We need to track the actual power domain transitions as well
>> > at hardware level.
>> Agree
>>
>> > Can you please look at "pwrdm_pre_transition()" and
>> > "pwrdm_post_transition()"
>> > This code keep track of it using the next power state
>> > and prev-power state.
>> The current API only has 'trace_power_domain_target' which tracks
>> the
>> desired target state.
>> I think we need an extra tracer 'trace_power_domain_hitstate' so
>> that
>> the trace parser can compare the desired ('target') and actually hit
>> ('hitstate') states.
>>
> We use next state and previous state. 'hitstate' doesn't sound
> well that's really secondary.
>
> Do you plan to add that additional trace then ?
Yes that is idea, although adding new events in the power trace API
has been proved as quite difficult to get accepted. In any case this
will be done separately (iow it is not part of this patch).

Also this patch also supports OMAP4 since the changes are in the
generic PM frameworks. Thanks to the OMAP PM arch guys ;p

Is the patch OK? If so can it be queued in the l-o tree?

>
> Regards,
> Santosh
>

Regards,
Jean

^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH] perf: add OMAP support for the new power events
  2011-02-07 16:05       ` Jean Pihet
@ 2011-02-07 16:12         ` Santosh Shilimkar
  2011-02-11 14:38           ` Are there CPU sleep residency HW counters in OMAP? Was: " Thomas Renninger
  0 siblings, 1 reply; 36+ messages in thread
From: Santosh Shilimkar @ 2011-02-07 16:12 UTC (permalink / raw)
  To: Jean Pihet, Tony Lindgren; +Cc: Thomas Renninger, linux-omap, Jean Pihet-XID

Jean,
> -----Original Message-----
> From: Jean Pihet [mailto:jean.pihet@newoldbits.com]
> Sent: Monday, February 07, 2011 9:36 PM
> To: Santosh Shilimkar; Tony Lindgren
> Cc: Thomas Renninger; linux-omap@vger.kernel.org; Jean Pihet-XID
> Subject: Re: [PATCH] perf: add OMAP support for the new power events
>
> Hi Santosh, Tony,
>
> On Wed, Jan 26, 2011 at 11:06 AM, Santosh Shilimkar
> <santosh.shilimkar@ti.com> wrote:
> >> -----Original Message-----
> >> From: Jean Pihet [mailto:jean.pihet@newoldbits.com]
> >> Sent: Wednesday, January 26, 2011 3:20 PM
> >> To: Santosh Shilimkar
> >> Cc: Thomas Renninger; linux-omap@vger.kernel.org; Jean Pihet-XID
> >> Subject: Re: [PATCH] perf: add OMAP support for the new power
> events
> >>
> > [...]
> >
> >> > We need to track the actual power domain transitions as well
> >> > at hardware level.
> >> Agree
> >>
> >> > Can you please look at "pwrdm_pre_transition()" and
> >> > "pwrdm_post_transition()"
> >> > This code keep track of it using the next power state
> >> > and prev-power state.
> >> The current API only has 'trace_power_domain_target' which tracks
> >> the
> >> desired target state.
> >> I think we need an extra tracer 'trace_power_domain_hitstate' so
> >> that
> >> the trace parser can compare the desired ('target') and actually
> hit
> >> ('hitstate') states.
> >>
> > We use next state and previous state. 'hitstate' doesn't sound
> > well that's really secondary.
> >
> > Do you plan to add that additional trace then ?
> Yes that is idea, although adding new events in the power trace API
> has been proved as quite difficult to get accepted. In any case this
> will be done separately (iow it is not part of this patch).
>
> Also this patch also supports OMAP4 since the changes are in the
> generic PM frameworks. Thanks to the OMAP PM arch guys ;p
>
> Is the patch OK? If so can it be queued in the l-o tree?
>
I just looked at from the current need of DEBUG counters
and commented what needs to be supported.

Am ok with the patch, but that means we still need to keep using
and supporting PM debug counters till we support the additional
trace events.

May be Kevin/Paul can take a call on this.

Regards,
Santosh

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-01-24 14:20 [PATCH] perf: add OMAP support for the new power events jean.pihet
  2011-01-24 14:55 ` Santosh Shilimkar
@ 2011-02-10 21:02 ` Kevin Hilman
  2011-02-18 18:14   ` Jean Pihet
  1 sibling, 1 reply; 36+ messages in thread
From: Kevin Hilman @ 2011-02-10 21:02 UTC (permalink / raw)
  To: jean.pihet; +Cc: Thomas Renninger, linux-omap, Jean Pihet

jean.pihet@newoldbits.com writes:

> From: Jean Pihet <j-pihet@ti.com>
>
> The patch adds the new power management trace points for
> the OMAP architecture.
>
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - change of power domains next power states.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>

Looks good to me.  Please post one more time with linux-arm-kernel in Cc.
After that, unless there are objections, I'll queue for 2.6.39.

Kevin

> ---
>  arch/arm/mach-omap2/clock.c       |    8 +++++++-
>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>  arch/arm/mach-omap2/powerdomain.c |    8 +++++++-
>  3 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> index 2a2f152..72af75d 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -22,7 +22,9 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/bitops.h>
> +#include <trace/events/power.h>
>  
> +#include <asm/cpu.h>
>  #include <plat/clock.h>
>  #include "clockdomain.h"
>  #include <plat/cpu.h>
> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>  
>  	pr_debug("clock: %s: disabling in hardware\n", clk->name);
>  
> +	trace_clock_disable(clk->name, 0, smp_processor_id());
>  	clk->ops->disable(clk);
>  
>  	if (clk->clkdm)
> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>  		}
>  	}
>  
> +	trace_clock_enable(clk->name, 1, smp_processor_id());
>  	ret = clk->ops->enable(clk);
>  	if (ret) {
>  		WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
>  	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
>  
>  	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
> -	if (clk->set_rate)
> +	if (clk->set_rate) {
> +		trace_clock_set_rate(clk->name, rate, smp_processor_id());
>  		ret = clk->set_rate(clk, rate);
> +	}
>  
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 8cbbead..7c5e0ee 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -29,6 +29,7 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/console.h>
> +#include <trace/events/power.h>
>  
>  #include <plat/sram.h>
>  #include "clockdomain.h"
> @@ -518,8 +519,14 @@ static void omap3_pm_idle(void)
>  	if (omap_irq_pending() || need_resched())
>  		goto out;
>  
> +	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> +	trace_cpu_idle(1, smp_processor_id());
> +
>  	omap_sram_idle();
>  
> +	trace_power_end(smp_processor_id());
> +	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
> +
>  out:
>  	local_fiq_enable();
>  	local_irq_enable();
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index eaed0df..e1feb50 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>  
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -406,8 +409,11 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
>  		 pwrdm->name, pwrst);
>  
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>  
>  	return ret;
>  }

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Are there CPU sleep residency HW counters in OMAP?    Was: Re: [PATCH] perf: add OMAP support for the new power events
  2011-02-07 16:12         ` Santosh Shilimkar
@ 2011-02-11 14:38           ` Thomas Renninger
  2011-02-11 15:07             ` Santosh Shilimkar
  0 siblings, 1 reply; 36+ messages in thread
From: Thomas Renninger @ 2011-02-11 14:38 UTC (permalink / raw)
  To: Santosh Shilimkar; +Cc: Tony Lindgren, linux-omap, Jean Pihet-XID

Hi,

I use this thread as I expect people following it, is exactly
the audience I am looking out for.

I am currently implementing a generic framework for CPU idle
state accounting.

X86 CPUs can do quite some magic behind the OS and might enter
deeper sleep states or might not enter them, even the OS requested
(not) to do so.

Intel and AMD provide, depending on the CPU family, different HW
counters to read out which state the HW really entered.

One can also use some counters which are not explicitly made for
that. For example in X86 there is the mperf counter ticking at
max frequency like TSC, but unlike the TSC it stops when entering
any sleep state. This for example will also be one of the counters
to account C0 vs Cx time the HW really resided in.

The stuff is intended for the cpupowerutils (new branch on the
cpufrequtils tree) package. It should replace the turbostat tool
which is doing this for some Intel x86 cpus only and recently got
merged into the kernel:
linux-2.6/tools/power/x86/turbostat/

I still have to make sure to compile out X86 specific stuff
(accessing MSRs, cpuid..) for other archs and with a next, cleaned up 
patch series the accounting statistics from 
/sys/devices/system/cpu/cpu*/cpuidle/* should work on other archs as 
well.

Anyway, if there are facilities to read out sleep state residency from
HW for omap based cpus and you like to have a tool showing them,
it would be great if someone likes to help with the implementation.

The framework will be there already, I would just need some help with
a omap_monitor.c file filling up some callback functions and there could
be one tool with the same format for all archs showing sleep states...

Thanks,

     Thomas


On Monday, February 07, 2011 05:12:18 PM Santosh Shilimkar wrote:
> Jean,
> > -----Original Message-----
> > From: Jean Pihet [mailto:jean.pihet@newoldbits.com]
> > Sent: Monday, February 07, 2011 9:36 PM
> > To: Santosh Shilimkar; Tony Lindgren
> > Cc: Thomas Renninger; linux-omap@vger.kernel.org; Jean Pihet-XID
> > Subject: Re: [PATCH] perf: add OMAP support for the new power events
> >
> > Hi Santosh, Tony,
> >
> > On Wed, Jan 26, 2011 at 11:06 AM, Santosh Shilimkar
> > <santosh.shilimkar@ti.com> wrote:
> > >> -----Original Message-----
> > >> From: Jean Pihet [mailto:jean.pihet@newoldbits.com]
> > >> Sent: Wednesday, January 26, 2011 3:20 PM
> > >> To: Santosh Shilimkar
> > >> Cc: Thomas Renninger; linux-omap@vger.kernel.org; Jean Pihet-XID
> > >> Subject: Re: [PATCH] perf: add OMAP support for the new power
> > events
> > >>
> > > [...]
> > >
> > >> > We need to track the actual power domain transitions as well
> > >> > at hardware level.
> > >> Agree
> > >>
> > >> > Can you please look at "pwrdm_pre_transition()" and
> > >> > "pwrdm_post_transition()"
> > >> > This code keep track of it using the next power state
> > >> > and prev-power state.
> > >> The current API only has 'trace_power_domain_target' which tracks
> > >> the
> > >> desired target state.
> > >> I think we need an extra tracer 'trace_power_domain_hitstate' so
> > >> that
> > >> the trace parser can compare the desired ('target') and actually
> > hit
> > >> ('hitstate') states.
> > >>
> > > We use next state and previous state. 'hitstate' doesn't sound
> > > well that's really secondary.
> > >
> > > Do you plan to add that additional trace then ?
> > Yes that is idea, although adding new events in the power trace API
> > has been proved as quite difficult to get accepted. In any case this
> > will be done separately (iow it is not part of this patch).
> >
> > Also this patch also supports OMAP4 since the changes are in the
> > generic PM frameworks. Thanks to the OMAP PM arch guys ;p
> >
> > Is the patch OK? If so can it be queued in the l-o tree?
> >
> I just looked at from the current need of DEBUG counters
> and commented what needs to be supported.
> 
> Am ok with the patch, but that means we still need to keep using
> and supporting PM debug counters till we support the additional
> trace events.
> 
> May be Kevin/Paul can take a call on this.
> 
> Regards,
> Santosh
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: Are there CPU sleep residency HW counters in OMAP? Was: Re: [PATCH] perf: add OMAP support for the new power events
  2011-02-11 14:38           ` Are there CPU sleep residency HW counters in OMAP? Was: " Thomas Renninger
@ 2011-02-11 15:07             ` Santosh Shilimkar
  0 siblings, 0 replies; 36+ messages in thread
From: Santosh Shilimkar @ 2011-02-11 15:07 UTC (permalink / raw)
  To: Thomas Renninger, Kevin Hilman, Paul Walmsley
  Cc: Tony Lindgren, linux-omap, Jean Pihet-XID

(+ Kevin, Paul)

> -----Original Message-----
> From: Thomas Renninger [mailto:trenn@suse.de]
> Sent: Friday, February 11, 2011 8:09 PM
> To: Santosh Shilimkar
> Cc: Tony Lindgren; linux-omap@vger.kernel.org; Jean Pihet-XID
> Subject: Are there CPU sleep residency HW counters in OMAP? Was: Re:
> [PATCH] perf: add OMAP support for the new power events
>
> Hi,
>
> I use this thread as I expect people following it, is exactly
> the audience I am looking out for.
>
> I am currently implementing a generic framework for CPU idle
> state accounting.
>
> X86 CPUs can do quite some magic behind the OS and might enter
> deeper sleep states or might not enter them, even the OS requested
> (not) to do so.
>
> Intel and AMD provide, depending on the CPU family, different HW
> counters to read out which state the HW really entered.
>
> One can also use some counters which are not explicitly made for
> that. For example in X86 there is the mperf counter ticking at
> max frequency like TSC, but unlike the TSC it stops when entering
> any sleep state. This for example will also be one of the counters
> to account C0 vs Cx time the HW really resided in.
>
I assume HW means CPU here. The current OMAP's doesn't have
hardware counter registers to measure CPU residency time in
deeper sleep states. Intrusive instrumentation using always
running counter is possible buts no good. Hence Jean is
trying to have common trace framework do some of these.

> The stuff is intended for the cpupowerutils (new branch on the
> cpufrequtils tree) package. It should replace the turbostat tool
> which is doing this for some Intel x86 cpus only and recently got
> merged into the kernel:
> linux-2.6/tools/power/x86/turbostat/
>
> I still have to make sure to compile out X86 specific stuff
> (accessing MSRs, cpuid..) for other archs and with a next, cleaned
> up
> patch series the accounting statistics from
> /sys/devices/system/cpu/cpu*/cpuidle/* should work on other archs as
> well.
>
> Anyway, if there are facilities to read out sleep state residency
> from
> HW for omap based cpus and you like to have a tool showing them,
> it would be great if someone likes to help with the implementation.
>
> The framework will be there already, I would just need some help
> with
> a omap_monitor.c file filling up some callback functions and there
> could
> be one tool with the same format for all archs showing sleep
> states...
>

Various IPs in OMAP are grouped in different Powerdomains. The
Powerdomain states targeted and reached can be read from the
hardware registers and that's what we use more often. Currently
some debug counters can show these stats.

For e.g
OMAP CPU supports below power domains.
1. CPU PD ON/INACTIVE
2. CPU PD RETENTION (2 levels)
3. CPU PD OFF.

C-states can attempt one of these states based available sleep
time and up down latencies. Whether attempted target CPU PD
states was reached or not can be read  using hardware registers.
But then we still can't read the exact CPU residency time in
a particular sleep state.

Hope this gives some idea about what's supported by OMAP
hardware for cpuidle residency measurements.

I let Kevin/Pual comment more in case I have missed some
information.

Regards,
Santosh

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-02-10 21:02 ` Kevin Hilman
@ 2011-02-18 18:14   ` Jean Pihet
  0 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-02-18 18:14 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Thomas Renninger, linux-omap, Jean Pihet

On Thu, Feb 10, 2011 at 10:02 PM, Kevin Hilman <khilman@ti.com> wrote:
> jean.pihet@newoldbits.com writes:
>
>> From: Jean Pihet <j-pihet@ti.com>
>>
>> The patch adds the new power management trace points for
>> the OMAP architecture.
>>
>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>>   instrumented in the generic way there is no need to
>>   add trace points in the OMAP specific cpuidle handler;
>> - cpufreq (DVFS),
>> - SoC clocks changes (enable, disable, set_rate),
>> - change of power domains next power states.
>>
>> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS
>>
>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
>
> Looks good to me.  Please post one more time with linux-arm-kernel in Cc.
> After that, unless there are objections, I'll queue for 2.6.39.
Ok thanks for reviewing the patch.
I sent the updated patch. The change is an extra trace point in the
case a power domain did not hit the desired target state. This allows
the parsing/GUI tools to trace the desired and actually hit states.

Regards,
Jean

>
> Kevin
>
>> ---
>>  arch/arm/mach-omap2/clock.c       |    8 +++++++-
>>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>>  arch/arm/mach-omap2/powerdomain.c |    8 +++++++-
>>  3 files changed, 21 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
>> index 2a2f152..72af75d 100644
>> --- a/arch/arm/mach-omap2/clock.c
>> +++ b/arch/arm/mach-omap2/clock.c
>> @@ -22,7 +22,9 @@
>>  #include <linux/clk.h>
>>  #include <linux/io.h>
>>  #include <linux/bitops.h>
>> +#include <trace/events/power.h>
>>
>> +#include <asm/cpu.h>
>>  #include <plat/clock.h>
>>  #include "clockdomain.h"
>>  #include <plat/cpu.h>
>> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>>
>>       pr_debug("clock: %s: disabling in hardware\n", clk->name);
>>
>> +     trace_clock_disable(clk->name, 0, smp_processor_id());
>>       clk->ops->disable(clk);
>>
>>       if (clk->clkdm)
>> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>>               }
>>       }
>>
>> +     trace_clock_enable(clk->name, 1, smp_processor_id());
>>       ret = clk->ops->enable(clk);
>>       if (ret) {
>>               WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
>> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
>>       pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
>>
>>       /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
>> -     if (clk->set_rate)
>> +     if (clk->set_rate) {
>> +             trace_clock_set_rate(clk->name, rate, smp_processor_id());
>>               ret = clk->set_rate(clk, rate);
>> +     }
>>
>>       return ret;
>>  }
>> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
>> index 8cbbead..7c5e0ee 100644
>> --- a/arch/arm/mach-omap2/pm34xx.c
>> +++ b/arch/arm/mach-omap2/pm34xx.c
>> @@ -29,6 +29,7 @@
>>  #include <linux/delay.h>
>>  #include <linux/slab.h>
>>  #include <linux/console.h>
>> +#include <trace/events/power.h>
>>
>>  #include <plat/sram.h>
>>  #include "clockdomain.h"
>> @@ -518,8 +519,14 @@ static void omap3_pm_idle(void)
>>       if (omap_irq_pending() || need_resched())
>>               goto out;
>>
>> +     trace_power_start(POWER_CSTATE, 1, smp_processor_id());
>> +     trace_cpu_idle(1, smp_processor_id());
>> +
>>       omap_sram_idle();
>>
>> +     trace_power_end(smp_processor_id());
>> +     trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
>> +
>>  out:
>>       local_fiq_enable();
>>       local_irq_enable();
>> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
>> index eaed0df..e1feb50 100644
>> --- a/arch/arm/mach-omap2/powerdomain.c
>> +++ b/arch/arm/mach-omap2/powerdomain.c
>> @@ -19,12 +19,15 @@
>>  #include <linux/list.h>
>>  #include <linux/errno.h>
>>  #include <linux/string.h>
>> +#include <trace/events/power.h>
>> +
>>  #include "cm2xxx_3xxx.h"
>>  #include "prcm44xx.h"
>>  #include "cm44xx.h"
>>  #include "prm2xxx_3xxx.h"
>>  #include "prm44xx.h"
>>
>> +#include <asm/cpu.h>
>>  #include <plat/cpu.h>
>>  #include "powerdomain.h"
>>  #include "clockdomain.h"
>> @@ -406,8 +409,11 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
>>       pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
>>                pwrdm->name, pwrst);
>>
>> -     if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
>> +     if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
>> +             trace_power_domain_target(pwrdm->name, pwrst,
>> +                                       smp_processor_id());
>>               ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
>> +     }
>>
>>       return ret;
>>  }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-03-10  8:09       ` Jean Pihet
@ 2011-03-10 18:15         ` Kevin Hilman
  -1 siblings, 0 replies; 36+ messages in thread
From: Kevin Hilman @ 2011-03-10 18:15 UTC (permalink / raw)
  To: Jean Pihet; +Cc: Thomas Renninger, linux-omap, linux-arm-kernel, Jean Pihet

Jean Pihet <jean.pihet@newoldbits.com> writes:

> On Thu, Mar 10, 2011 at 1:08 AM, Kevin Hilman <khilman@ti.com> wrote:
>> Jean Pihet <jean.pihet@newoldbits.com> writes:
>>
>>> The patch adds the new power management trace points for
>>> the OMAP architecture.
>>>
>>> The trace points are for:
>>> - default idle handler. Since the cpuidle framework is
>>>   instrumented in the generic way there is no need to
>>>   add trace points in the OMAP specific cpuidle handler;
>>> - cpufreq (DVFS),
>>
>> Minor: AFAICT, this patch doesn't instrument CPUfreq.
> The generic framework provides a cpu_frequency event. Furthermore the
> clock_set_rate events are reporting the various SoC clock rate
> changes.
> Indeed the changelog is not accurate enough. Is '- cpufreq (DVFS)
> events are covered by the generic cpu_frequency events and the SoC
> clock changes events' better?

I'd prefer to just leave this out as either way, I find it confusing
based on the content of this patch.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-03-10 18:15         ` Kevin Hilman
  0 siblings, 0 replies; 36+ messages in thread
From: Kevin Hilman @ 2011-03-10 18:15 UTC (permalink / raw)
  To: linux-arm-kernel

Jean Pihet <jean.pihet@newoldbits.com> writes:

> On Thu, Mar 10, 2011 at 1:08 AM, Kevin Hilman <khilman@ti.com> wrote:
>> Jean Pihet <jean.pihet@newoldbits.com> writes:
>>
>>> The patch adds the new power management trace points for
>>> the OMAP architecture.
>>>
>>> The trace points are for:
>>> - default idle handler. Since the cpuidle framework is
>>> ? instrumented in the generic way there is no need to
>>> ? add trace points in the OMAP specific cpuidle handler;
>>> - cpufreq (DVFS),
>>
>> Minor: AFAICT, this patch doesn't instrument CPUfreq.
> The generic framework provides a cpu_frequency event. Furthermore the
> clock_set_rate events are reporting the various SoC clock rate
> changes.
> Indeed the changelog is not accurate enough. Is '- cpufreq (DVFS)
> events are covered by the generic cpu_frequency events and the SoC
> clock changes events' better?

I'd prefer to just leave this out as either way, I find it confusing
based on the content of this patch.

Kevin

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-03-10  1:04     ` Paul Walmsley
@ 2011-03-10  8:17       ` Jean Pihet
  -1 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-03-10  8:17 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Thomas Renninger, linux-omap, linux-arm-kernel, Kevin Hilman, Jean Pihet

Hi Paul,

On Thu, Mar 10, 2011 at 2:04 AM, Paul Walmsley <paul@pwsan.com> wrote:
> On Thu, 3 Mar 2011, Jean Pihet wrote:
>
>> The patch adds the new power management trace points for
>> the OMAP architecture.
>>
>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>>   instrumented in the generic way there is no need to
>>   add trace points in the OMAP specific cpuidle handler;
>> - cpufreq (DVFS),
>> - SoC clocks changes (enable, disable, set_rate),
>> - power domain states: the desired target state and -if different-
>>   the actually hit state.
>>
>> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
>>
>> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>>
>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
>
> In terms of tracing powerdomain state changes, since OMAP powerdomains can
> potentially transition without the MPU knowing about it, some powerdomain
> transitions will be missed by these.  (The software counters miss them
> too.)  The only way to be certain about these is to watch the debug
> observability lines.  Still, it is the rare board that brings out debobs
> lines.  So this seems reasonable, as long as people don't expect 100%
> coverage.
OK that is correct. The events are tracing SW events only, i.e. a
trace is generated when a decision is made wrt next power states,
clock changes etc.
A remark: the OMAP4+ HW tracing modules do support the changes of
power domains states. There definitely is more to come on that topic!

Thanks for reviewing!
Jean

>
> For the clock and powerdomain changes,
>
> Acked-by: Paul Walmsley <paul@pwsan.com>
>
>
> - Paul
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-03-10  8:17       ` Jean Pihet
  0 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-03-10  8:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On Thu, Mar 10, 2011 at 2:04 AM, Paul Walmsley <paul@pwsan.com> wrote:
> On Thu, 3 Mar 2011, Jean Pihet wrote:
>
>> The patch adds the new power management trace points for
>> the OMAP architecture.
>>
>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>> ? instrumented in the generic way there is no need to
>> ? add trace points in the OMAP specific cpuidle handler;
>> - cpufreq (DVFS),
>> - SoC clocks changes (enable, disable, set_rate),
>> - power domain states: the desired target state and -if different-
>> ? the actually hit state.
>>
>> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
>>
>> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>>
>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
>
> In terms of tracing powerdomain state changes, since OMAP powerdomains can
> potentially transition without the MPU knowing about it, some powerdomain
> transitions will be missed by these. ?(The software counters miss them
> too.) ?The only way to be certain about these is to watch the debug
> observability lines. ?Still, it is the rare board that brings out debobs
> lines. ?So this seems reasonable, as long as people don't expect 100%
> coverage.
OK that is correct. The events are tracing SW events only, i.e. a
trace is generated when a decision is made wrt next power states,
clock changes etc.
A remark: the OMAP4+ HW tracing modules do support the changes of
power domains states. There definitely is more to come on that topic!

Thanks for reviewing!
Jean

>
> For the clock and powerdomain changes,
>
> Acked-by: Paul Walmsley <paul@pwsan.com>
>
>
> - Paul
>

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-03-10  0:08     ` Kevin Hilman
@ 2011-03-10  8:09       ` Jean Pihet
  -1 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-03-10  8:09 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Thomas Renninger, linux-omap, linux-arm-kernel, Jean Pihet

On Thu, Mar 10, 2011 at 1:08 AM, Kevin Hilman <khilman@ti.com> wrote:
> Jean Pihet <jean.pihet@newoldbits.com> writes:
>
>> The patch adds the new power management trace points for
>> the OMAP architecture.
>>
>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>>   instrumented in the generic way there is no need to
>>   add trace points in the OMAP specific cpuidle handler;
>> - cpufreq (DVFS),
>
> Minor: AFAICT, this patch doesn't instrument CPUfreq.
The generic framework provides a cpu_frequency event. Furthermore the
clock_set_rate events are reporting the various SoC clock rate
changes.
Indeed the changelog is not accurate enough. Is '- cpufreq (DVFS)
events are covered by the generic cpu_frequency events and the SoC
clock changes events' better?

>
>> - SoC clocks changes (enable, disable, set_rate),
>> - power domain states: the desired target state and -if different-
>>   the actually hit state.
>>
>> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
>>
>> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>>
>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
>
> With Paul's ack on the powerdomain changes, I'll queue this for 2.6.39
> after making the above change in the changelog.

Thanks!
Jean

>
> Kevin
>
>
>> ---
>>  arch/arm/mach-omap2/clock.c       |   11 +++++++++--
>>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>>  3 files changed, 39 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
>> index 46d03cc..180299e 100644
>> --- a/arch/arm/mach-omap2/clock.c
>> +++ b/arch/arm/mach-omap2/clock.c
>> @@ -22,7 +22,9 @@
>>  #include <linux/clk.h>
>>  #include <linux/io.h>
>>  #include <linux/bitops.h>
>> +#include <trace/events/power.h>
>>
>> +#include <asm/cpu.h>
>>  #include <plat/clock.h>
>>  #include "clockdomain.h"
>>  #include <plat/cpu.h>
>> @@ -261,8 +263,10 @@ void omap2_clk_disable(struct clk *clk)
>>
>>       pr_debug("clock: %s: disabling in hardware\n", clk->name);
>>
>> -     if (clk->ops && clk->ops->disable)
>> +     if (clk->ops && clk->ops->disable) {
>> +             trace_clock_disable(clk->name, 0, smp_processor_id());
>>               clk->ops->disable(clk);
>> +     }
>>
>>       if (clk->clkdm)
>>               clkdm_clk_disable(clk->clkdm, clk);
>> @@ -314,6 +318,7 @@ int omap2_clk_enable(struct clk *clk)
>>       }
>>
>>       if (clk->ops && clk->ops->enable) {
>> +             trace_clock_enable(clk->name, 1, smp_processor_id());
>>               ret = clk->ops->enable(clk);
>>               if (ret) {
>>                       WARN(1, "clock: %s: could not enable: %d\n",
>> @@ -353,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
>>       pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
>>
>>       /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
>> -     if (clk->set_rate)
>> +     if (clk->set_rate) {
>> +             trace_clock_set_rate(clk->name, rate, smp_processor_id());
>>               ret = clk->set_rate(clk, rate);
>> +     }
>>
>>       return ret;
>>  }
>> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
>> index bd610bc..d46b9ff 100644
>> --- a/arch/arm/mach-omap2/pm34xx.c
>> +++ b/arch/arm/mach-omap2/pm34xx.c
>> @@ -29,6 +29,7 @@
>>  #include <linux/delay.h>
>>  #include <linux/slab.h>
>>  #include <linux/console.h>
>> +#include <trace/events/power.h>
>>
>>  #include <plat/sram.h>
>>  #include "clockdomain.h"
>> @@ -514,8 +515,14 @@ static void omap3_pm_idle(void)
>>       if (omap_irq_pending() || need_resched())
>>               goto out;
>>
>> +     trace_power_start(POWER_CSTATE, 1, smp_processor_id());
>> +     trace_cpu_idle(1, smp_processor_id());
>> +
>>       omap_sram_idle();
>>
>> +     trace_power_end(smp_processor_id());
>> +     trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
>> +
>>  out:
>>       local_fiq_enable();
>>       local_irq_enable();
>> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
>> index eaed0df..1495eed 100644
>> --- a/arch/arm/mach-omap2/powerdomain.c
>> +++ b/arch/arm/mach-omap2/powerdomain.c
>> @@ -19,12 +19,15 @@
>>  #include <linux/list.h>
>>  #include <linux/errno.h>
>>  #include <linux/string.h>
>> +#include <trace/events/power.h>
>> +
>>  #include "cm2xxx_3xxx.h"
>>  #include "prcm44xx.h"
>>  #include "cm44xx.h"
>>  #include "prm2xxx_3xxx.h"
>>  #include "prm44xx.h"
>>
>> +#include <asm/cpu.h>
>>  #include <plat/cpu.h>
>>  #include "powerdomain.h"
>>  #include "clockdomain.h"
>> @@ -32,6 +35,8 @@
>>
>>  #include "pm.h"
>>
>> +#define PWRDM_TRACE_STATES_FLAG      (1<<31)
>> +
>>  enum {
>>       PWRDM_STATE_NOW = 0,
>>       PWRDM_STATE_PREV,
>> @@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
>>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>>  {
>>
>> -     int prev;
>> -     int state;
>> +     int prev, state, trace_state = 0;
>>
>>       if (pwrdm == NULL)
>>               return -EINVAL;
>> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>>                       pwrdm->state_counter[prev]++;
>>               if (prev == PWRDM_POWER_RET)
>>                       _update_logic_membank_counters(pwrdm);
>> +             /*
>> +              * If the power domain did not hit the desired state,
>> +              * generate a trace event with both the desired and hit states
>> +              */
>> +             if (state != prev) {
>> +                     trace_state = (PWRDM_TRACE_STATES_FLAG |
>> +                                    ((state & OMAP_POWERSTATE_MASK) << 8) |
>> +                                    ((prev & OMAP_POWERSTATE_MASK) << 0));
>> +                     trace_power_domain_target(pwrdm->name, trace_state,
>> +                                               smp_processor_id());
>> +             }
>>               break;
>>       default:
>>               return -EINVAL;
>> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
>>       pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
>>                pwrdm->name, pwrst);
>>
>> -     if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
>> +     if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
>> +             /* Trace the pwrdm desired target state */
>> +             trace_power_domain_target(pwrdm->name, pwrst,
>> +                                       smp_processor_id());
>> +             /* Program the pwrdm desired target state */
>>               ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
>> +     }
>>
>>       return ret;
>>  }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-03-10  8:09       ` Jean Pihet
  0 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-03-10  8:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 10, 2011 at 1:08 AM, Kevin Hilman <khilman@ti.com> wrote:
> Jean Pihet <jean.pihet@newoldbits.com> writes:
>
>> The patch adds the new power management trace points for
>> the OMAP architecture.
>>
>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>> ? instrumented in the generic way there is no need to
>> ? add trace points in the OMAP specific cpuidle handler;
>> - cpufreq (DVFS),
>
> Minor: AFAICT, this patch doesn't instrument CPUfreq.
The generic framework provides a cpu_frequency event. Furthermore the
clock_set_rate events are reporting the various SoC clock rate
changes.
Indeed the changelog is not accurate enough. Is '- cpufreq (DVFS)
events are covered by the generic cpu_frequency events and the SoC
clock changes events' better?

>
>> - SoC clocks changes (enable, disable, set_rate),
>> - power domain states: the desired target state and -if different-
>> ? the actually hit state.
>>
>> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
>>
>> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>>
>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
>
> With Paul's ack on the powerdomain changes, I'll queue this for 2.6.39
> after making the above change in the changelog.

Thanks!
Jean

>
> Kevin
>
>
>> ---
>> ?arch/arm/mach-omap2/clock.c ? ? ? | ? 11 +++++++++--
>> ?arch/arm/mach-omap2/pm34xx.c ? ? ?| ? ?7 +++++++
>> ?arch/arm/mach-omap2/powerdomain.c | ? 26 +++++++++++++++++++++++---
>> ?3 files changed, 39 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
>> index 46d03cc..180299e 100644
>> --- a/arch/arm/mach-omap2/clock.c
>> +++ b/arch/arm/mach-omap2/clock.c
>> @@ -22,7 +22,9 @@
>> ?#include <linux/clk.h>
>> ?#include <linux/io.h>
>> ?#include <linux/bitops.h>
>> +#include <trace/events/power.h>
>>
>> +#include <asm/cpu.h>
>> ?#include <plat/clock.h>
>> ?#include "clockdomain.h"
>> ?#include <plat/cpu.h>
>> @@ -261,8 +263,10 @@ void omap2_clk_disable(struct clk *clk)
>>
>> ? ? ? pr_debug("clock: %s: disabling in hardware\n", clk->name);
>>
>> - ? ? if (clk->ops && clk->ops->disable)
>> + ? ? if (clk->ops && clk->ops->disable) {
>> + ? ? ? ? ? ? trace_clock_disable(clk->name, 0, smp_processor_id());
>> ? ? ? ? ? ? ? clk->ops->disable(clk);
>> + ? ? }
>>
>> ? ? ? if (clk->clkdm)
>> ? ? ? ? ? ? ? clkdm_clk_disable(clk->clkdm, clk);
>> @@ -314,6 +318,7 @@ int omap2_clk_enable(struct clk *clk)
>> ? ? ? }
>>
>> ? ? ? if (clk->ops && clk->ops->enable) {
>> + ? ? ? ? ? ? trace_clock_enable(clk->name, 1, smp_processor_id());
>> ? ? ? ? ? ? ? ret = clk->ops->enable(clk);
>> ? ? ? ? ? ? ? if (ret) {
>> ? ? ? ? ? ? ? ? ? ? ? WARN(1, "clock: %s: could not enable: %d\n",
>> @@ -353,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
>> ? ? ? pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
>>
>> ? ? ? /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
>> - ? ? if (clk->set_rate)
>> + ? ? if (clk->set_rate) {
>> + ? ? ? ? ? ? trace_clock_set_rate(clk->name, rate, smp_processor_id());
>> ? ? ? ? ? ? ? ret = clk->set_rate(clk, rate);
>> + ? ? }
>>
>> ? ? ? return ret;
>> ?}
>> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
>> index bd610bc..d46b9ff 100644
>> --- a/arch/arm/mach-omap2/pm34xx.c
>> +++ b/arch/arm/mach-omap2/pm34xx.c
>> @@ -29,6 +29,7 @@
>> ?#include <linux/delay.h>
>> ?#include <linux/slab.h>
>> ?#include <linux/console.h>
>> +#include <trace/events/power.h>
>>
>> ?#include <plat/sram.h>
>> ?#include "clockdomain.h"
>> @@ -514,8 +515,14 @@ static void omap3_pm_idle(void)
>> ? ? ? if (omap_irq_pending() || need_resched())
>> ? ? ? ? ? ? ? goto out;
>>
>> + ? ? trace_power_start(POWER_CSTATE, 1, smp_processor_id());
>> + ? ? trace_cpu_idle(1, smp_processor_id());
>> +
>> ? ? ? omap_sram_idle();
>>
>> + ? ? trace_power_end(smp_processor_id());
>> + ? ? trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
>> +
>> ?out:
>> ? ? ? local_fiq_enable();
>> ? ? ? local_irq_enable();
>> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
>> index eaed0df..1495eed 100644
>> --- a/arch/arm/mach-omap2/powerdomain.c
>> +++ b/arch/arm/mach-omap2/powerdomain.c
>> @@ -19,12 +19,15 @@
>> ?#include <linux/list.h>
>> ?#include <linux/errno.h>
>> ?#include <linux/string.h>
>> +#include <trace/events/power.h>
>> +
>> ?#include "cm2xxx_3xxx.h"
>> ?#include "prcm44xx.h"
>> ?#include "cm44xx.h"
>> ?#include "prm2xxx_3xxx.h"
>> ?#include "prm44xx.h"
>>
>> +#include <asm/cpu.h>
>> ?#include <plat/cpu.h>
>> ?#include "powerdomain.h"
>> ?#include "clockdomain.h"
>> @@ -32,6 +35,8 @@
>>
>> ?#include "pm.h"
>>
>> +#define PWRDM_TRACE_STATES_FLAG ? ? ?(1<<31)
>> +
>> ?enum {
>> ? ? ? PWRDM_STATE_NOW = 0,
>> ? ? ? PWRDM_STATE_PREV,
>> @@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
>> ?static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>> ?{
>>
>> - ? ? int prev;
>> - ? ? int state;
>> + ? ? int prev, state, trace_state = 0;
>>
>> ? ? ? if (pwrdm == NULL)
>> ? ? ? ? ? ? ? return -EINVAL;
>> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>> ? ? ? ? ? ? ? ? ? ? ? pwrdm->state_counter[prev]++;
>> ? ? ? ? ? ? ? if (prev == PWRDM_POWER_RET)
>> ? ? ? ? ? ? ? ? ? ? ? _update_logic_membank_counters(pwrdm);
>> + ? ? ? ? ? ? /*
>> + ? ? ? ? ? ? ?* If the power domain did not hit the desired state,
>> + ? ? ? ? ? ? ?* generate a trace event with both the desired and hit states
>> + ? ? ? ? ? ? ?*/
>> + ? ? ? ? ? ? if (state != prev) {
>> + ? ? ? ? ? ? ? ? ? ? trace_state = (PWRDM_TRACE_STATES_FLAG |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((state & OMAP_POWERSTATE_MASK) << 8) |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((prev & OMAP_POWERSTATE_MASK) << 0));
>> + ? ? ? ? ? ? ? ? ? ? trace_power_domain_target(pwrdm->name, trace_state,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? smp_processor_id());
>> + ? ? ? ? ? ? }
>> ? ? ? ? ? ? ? break;
>> ? ? ? default:
>> ? ? ? ? ? ? ? return -EINVAL;
>> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
>> ? ? ? pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
>> ? ? ? ? ? ? ? ?pwrdm->name, pwrst);
>>
>> - ? ? if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
>> + ? ? if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
>> + ? ? ? ? ? ? /* Trace the pwrdm desired target state */
>> + ? ? ? ? ? ? trace_power_domain_target(pwrdm->name, pwrst,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? smp_processor_id());
>> + ? ? ? ? ? ? /* Program the pwrdm desired target state */
>> ? ? ? ? ? ? ? ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
>> + ? ? }
>>
>> ? ? ? return ret;
>> ?}
>

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-03-03 10:25   ` Jean Pihet
@ 2011-03-10  1:04     ` Paul Walmsley
  -1 siblings, 0 replies; 36+ messages in thread
From: Paul Walmsley @ 2011-03-10  1:04 UTC (permalink / raw)
  To: Jean Pihet
  Cc: Thomas Renninger, linux-omap, linux-arm-kernel, Kevin Hilman, Jean Pihet

On Thu, 3 Mar 2011, Jean Pihet wrote:

> The patch adds the new power management trace points for
> the OMAP architecture.
> 
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
> 
> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
> 
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
> 
> Signed-off-by: Jean Pihet <j-pihet@ti.com>

In terms of tracing powerdomain state changes, since OMAP powerdomains can 
potentially transition without the MPU knowing about it, some powerdomain 
transitions will be missed by these.  (The software counters miss them 
too.)  The only way to be certain about these is to watch the debug 
observability lines.  Still, it is the rare board that brings out debobs 
lines.  So this seems reasonable, as long as people don't expect 100% 
coverage.

For the clock and powerdomain changes,

Acked-by: Paul Walmsley <paul@pwsan.com>


- Paul

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-03-10  1:04     ` Paul Walmsley
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Walmsley @ 2011-03-10  1:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 3 Mar 2011, Jean Pihet wrote:

> The patch adds the new power management trace points for
> the OMAP architecture.
> 
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
> 
> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
> 
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
> 
> Signed-off-by: Jean Pihet <j-pihet@ti.com>

In terms of tracing powerdomain state changes, since OMAP powerdomains can 
potentially transition without the MPU knowing about it, some powerdomain 
transitions will be missed by these.  (The software counters miss them 
too.)  The only way to be certain about these is to watch the debug 
observability lines.  Still, it is the rare board that brings out debobs 
lines.  So this seems reasonable, as long as people don't expect 100% 
coverage.

For the clock and powerdomain changes,

Acked-by: Paul Walmsley <paul@pwsan.com>


- Paul

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-03-03 10:25   ` Jean Pihet
@ 2011-03-10  0:08     ` Kevin Hilman
  -1 siblings, 0 replies; 36+ messages in thread
From: Kevin Hilman @ 2011-03-10  0:08 UTC (permalink / raw)
  To: Jean Pihet; +Cc: Thomas Renninger, linux-omap, linux-arm-kernel, Jean Pihet

Jean Pihet <jean.pihet@newoldbits.com> writes:

> The patch adds the new power management trace points for
> the OMAP architecture.
>
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),

Minor: AFAICT, this patch doesn't instrument CPUfreq.

> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
>
> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>

With Paul's ack on the powerdomain changes, I'll queue this for 2.6.39
after making the above change in the changelog.

Kevin


> ---
>  arch/arm/mach-omap2/clock.c       |   11 +++++++++--
>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>  3 files changed, 39 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> index 46d03cc..180299e 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -22,7 +22,9 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/bitops.h>
> +#include <trace/events/power.h>
>  
> +#include <asm/cpu.h>
>  #include <plat/clock.h>
>  #include "clockdomain.h"
>  #include <plat/cpu.h>
> @@ -261,8 +263,10 @@ void omap2_clk_disable(struct clk *clk)
>  
>  	pr_debug("clock: %s: disabling in hardware\n", clk->name);
>  
> -	if (clk->ops && clk->ops->disable)
> +	if (clk->ops && clk->ops->disable) {
> +		trace_clock_disable(clk->name, 0, smp_processor_id());
>  		clk->ops->disable(clk);
> +	}
>  
>  	if (clk->clkdm)
>  		clkdm_clk_disable(clk->clkdm, clk);
> @@ -314,6 +318,7 @@ int omap2_clk_enable(struct clk *clk)
>  	}
>  
>  	if (clk->ops && clk->ops->enable) {
> +		trace_clock_enable(clk->name, 1, smp_processor_id());
>  		ret = clk->ops->enable(clk);
>  		if (ret) {
>  			WARN(1, "clock: %s: could not enable: %d\n",
> @@ -353,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
>  	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
>  
>  	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
> -	if (clk->set_rate)
> +	if (clk->set_rate) {
> +		trace_clock_set_rate(clk->name, rate, smp_processor_id());
>  		ret = clk->set_rate(clk, rate);
> +	}
>  
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index bd610bc..d46b9ff 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -29,6 +29,7 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/console.h>
> +#include <trace/events/power.h>
>  
>  #include <plat/sram.h>
>  #include "clockdomain.h"
> @@ -514,8 +515,14 @@ static void omap3_pm_idle(void)
>  	if (omap_irq_pending() || need_resched())
>  		goto out;
>  
> +	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> +	trace_cpu_idle(1, smp_processor_id());
> +
>  	omap_sram_idle();
>  
> +	trace_power_end(smp_processor_id());
> +	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
> +
>  out:
>  	local_fiq_enable();
>  	local_irq_enable();
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index eaed0df..1495eed 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>  
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -32,6 +35,8 @@
>  
>  #include "pm.h"
>  
> +#define PWRDM_TRACE_STATES_FLAG	(1<<31)
> +
>  enum {
>  	PWRDM_STATE_NOW = 0,
>  	PWRDM_STATE_PREV,
> @@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  {
>  
> -	int prev;
> -	int state;
> +	int prev, state, trace_state = 0;
>  
>  	if (pwrdm == NULL)
>  		return -EINVAL;
> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  			pwrdm->state_counter[prev]++;
>  		if (prev == PWRDM_POWER_RET)
>  			_update_logic_membank_counters(pwrdm);
> +		/*
> +		 * If the power domain did not hit the desired state,
> +		 * generate a trace event with both the desired and hit states
> +		 */
> +		if (state != prev) {
> +			trace_state = (PWRDM_TRACE_STATES_FLAG |
> +				       ((state & OMAP_POWERSTATE_MASK) << 8) |
> +				       ((prev & OMAP_POWERSTATE_MASK) << 0));
> +			trace_power_domain_target(pwrdm->name, trace_state,
> +						  smp_processor_id());
> +		}
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
>  		 pwrdm->name, pwrst);
>  
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		/* Trace the pwrdm desired target state */
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
> +		/* Program the pwrdm desired target state */
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>  
>  	return ret;
>  }

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-03-10  0:08     ` Kevin Hilman
  0 siblings, 0 replies; 36+ messages in thread
From: Kevin Hilman @ 2011-03-10  0:08 UTC (permalink / raw)
  To: linux-arm-kernel

Jean Pihet <jean.pihet@newoldbits.com> writes:

> The patch adds the new power management trace points for
> the OMAP architecture.
>
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),

Minor: AFAICT, this patch doesn't instrument CPUfreq.

> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
>
> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>

With Paul's ack on the powerdomain changes, I'll queue this for 2.6.39
after making the above change in the changelog.

Kevin


> ---
>  arch/arm/mach-omap2/clock.c       |   11 +++++++++--
>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>  3 files changed, 39 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> index 46d03cc..180299e 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -22,7 +22,9 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/bitops.h>
> +#include <trace/events/power.h>
>  
> +#include <asm/cpu.h>
>  #include <plat/clock.h>
>  #include "clockdomain.h"
>  #include <plat/cpu.h>
> @@ -261,8 +263,10 @@ void omap2_clk_disable(struct clk *clk)
>  
>  	pr_debug("clock: %s: disabling in hardware\n", clk->name);
>  
> -	if (clk->ops && clk->ops->disable)
> +	if (clk->ops && clk->ops->disable) {
> +		trace_clock_disable(clk->name, 0, smp_processor_id());
>  		clk->ops->disable(clk);
> +	}
>  
>  	if (clk->clkdm)
>  		clkdm_clk_disable(clk->clkdm, clk);
> @@ -314,6 +318,7 @@ int omap2_clk_enable(struct clk *clk)
>  	}
>  
>  	if (clk->ops && clk->ops->enable) {
> +		trace_clock_enable(clk->name, 1, smp_processor_id());
>  		ret = clk->ops->enable(clk);
>  		if (ret) {
>  			WARN(1, "clock: %s: could not enable: %d\n",
> @@ -353,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
>  	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
>  
>  	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
> -	if (clk->set_rate)
> +	if (clk->set_rate) {
> +		trace_clock_set_rate(clk->name, rate, smp_processor_id());
>  		ret = clk->set_rate(clk, rate);
> +	}
>  
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index bd610bc..d46b9ff 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -29,6 +29,7 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/console.h>
> +#include <trace/events/power.h>
>  
>  #include <plat/sram.h>
>  #include "clockdomain.h"
> @@ -514,8 +515,14 @@ static void omap3_pm_idle(void)
>  	if (omap_irq_pending() || need_resched())
>  		goto out;
>  
> +	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> +	trace_cpu_idle(1, smp_processor_id());
> +
>  	omap_sram_idle();
>  
> +	trace_power_end(smp_processor_id());
> +	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
> +
>  out:
>  	local_fiq_enable();
>  	local_irq_enable();
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index eaed0df..1495eed 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>  
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -32,6 +35,8 @@
>  
>  #include "pm.h"
>  
> +#define PWRDM_TRACE_STATES_FLAG	(1<<31)
> +
>  enum {
>  	PWRDM_STATE_NOW = 0,
>  	PWRDM_STATE_PREV,
> @@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  {
>  
> -	int prev;
> -	int state;
> +	int prev, state, trace_state = 0;
>  
>  	if (pwrdm == NULL)
>  		return -EINVAL;
> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  			pwrdm->state_counter[prev]++;
>  		if (prev == PWRDM_POWER_RET)
>  			_update_logic_membank_counters(pwrdm);
> +		/*
> +		 * If the power domain did not hit the desired state,
> +		 * generate a trace event with both the desired and hit states
> +		 */
> +		if (state != prev) {
> +			trace_state = (PWRDM_TRACE_STATES_FLAG |
> +				       ((state & OMAP_POWERSTATE_MASK) << 8) |
> +				       ((prev & OMAP_POWERSTATE_MASK) << 0));
> +			trace_power_domain_target(pwrdm->name, trace_state,
> +						  smp_processor_id());
> +		}
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
>  		 pwrdm->name, pwrst);
>  
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		/* Trace the pwrdm desired target state */
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
> +		/* Program the pwrdm desired target state */
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>  
>  	return ret;
>  }

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
  2011-02-18 18:10 ` jean.pihet at newoldbits.com
@ 2011-03-03 10:25   ` Jean Pihet
  -1 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-03-03 10:25 UTC (permalink / raw)
  To: Thomas Renninger, linux-omap, linux-arm-kernel, Kevin Hilman; +Cc: Jean Pihet

The patch adds the new power management trace points for
the OMAP architecture.

The trace points are for:
- default idle handler. Since the cpuidle framework is
  instrumented in the generic way there is no need to
  add trace points in the OMAP specific cpuidle handler;
- cpufreq (DVFS),
- SoC clocks changes (enable, disable, set_rate),
- power domain states: the desired target state and -if different-
  the actually hit state.

Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.

Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 arch/arm/mach-omap2/clock.c       |   11 +++++++++--
 arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
 arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
 3 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 46d03cc..180299e 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -22,7 +22,9 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/bitops.h>
+#include <trace/events/power.h>
 
+#include <asm/cpu.h>
 #include <plat/clock.h>
 #include "clockdomain.h"
 #include <plat/cpu.h>
@@ -261,8 +263,10 @@ void omap2_clk_disable(struct clk *clk)
 
 	pr_debug("clock: %s: disabling in hardware\n", clk->name);
 
-	if (clk->ops && clk->ops->disable)
+	if (clk->ops && clk->ops->disable) {
+		trace_clock_disable(clk->name, 0, smp_processor_id());
 		clk->ops->disable(clk);
+	}
 
 	if (clk->clkdm)
 		clkdm_clk_disable(clk->clkdm, clk);
@@ -314,6 +318,7 @@ int omap2_clk_enable(struct clk *clk)
 	}
 
 	if (clk->ops && clk->ops->enable) {
+		trace_clock_enable(clk->name, 1, smp_processor_id());
 		ret = clk->ops->enable(clk);
 		if (ret) {
 			WARN(1, "clock: %s: could not enable: %d\n",
@@ -353,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
 	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
 
 	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
-	if (clk->set_rate)
+	if (clk->set_rate) {
+		trace_clock_set_rate(clk->name, rate, smp_processor_id());
 		ret = clk->set_rate(clk, rate);
+	}
 
 	return ret;
 }
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index bd610bc..d46b9ff 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -29,6 +29,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/console.h>
+#include <trace/events/power.h>
 
 #include <plat/sram.h>
 #include "clockdomain.h"
@@ -514,8 +515,14 @@ static void omap3_pm_idle(void)
 	if (omap_irq_pending() || need_resched())
 		goto out;
 
+	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
+	trace_cpu_idle(1, smp_processor_id());
+
 	omap_sram_idle();
 
+	trace_power_end(smp_processor_id());
+	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
+
 out:
 	local_fiq_enable();
 	local_irq_enable();
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index eaed0df..1495eed 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -19,12 +19,15 @@
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include <trace/events/power.h>
+
 #include "cm2xxx_3xxx.h"
 #include "prcm44xx.h"
 #include "cm44xx.h"
 #include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
+#include <asm/cpu.h>
 #include <plat/cpu.h>
 #include "powerdomain.h"
 #include "clockdomain.h"
@@ -32,6 +35,8 @@
 
 #include "pm.h"
 
+#define PWRDM_TRACE_STATES_FLAG	(1<<31)
+
 enum {
 	PWRDM_STATE_NOW = 0,
 	PWRDM_STATE_PREV,
@@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
 static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 {
 
-	int prev;
-	int state;
+	int prev, state, trace_state = 0;
 
 	if (pwrdm == NULL)
 		return -EINVAL;
@@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 			pwrdm->state_counter[prev]++;
 		if (prev == PWRDM_POWER_RET)
 			_update_logic_membank_counters(pwrdm);
+		/*
+		 * If the power domain did not hit the desired state,
+		 * generate a trace event with both the desired and hit states
+		 */
+		if (state != prev) {
+			trace_state = (PWRDM_TRACE_STATES_FLAG |
+				       ((state & OMAP_POWERSTATE_MASK) << 8) |
+				       ((prev & OMAP_POWERSTATE_MASK) << 0));
+			trace_power_domain_target(pwrdm->name, trace_state,
+						  smp_processor_id());
+		}
 		break;
 	default:
 		return -EINVAL;
@@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
 		 pwrdm->name, pwrst);
 
-	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
+	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
+		/* Trace the pwrdm desired target state */
+		trace_power_domain_target(pwrdm->name, pwrst,
+					  smp_processor_id());
+		/* Program the pwrdm desired target state */
 		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
+	}
 
 	return ret;
 }
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-03-03 10:25   ` Jean Pihet
  0 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-03-03 10:25 UTC (permalink / raw)
  To: linux-arm-kernel

The patch adds the new power management trace points for
the OMAP architecture.

The trace points are for:
- default idle handler. Since the cpuidle framework is
  instrumented in the generic way there is no need to
  add trace points in the OMAP specific cpuidle handler;
- cpufreq (DVFS),
- SoC clocks changes (enable, disable, set_rate),
- power domain states: the desired target state and -if different-
  the actually hit state.

Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.

Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 arch/arm/mach-omap2/clock.c       |   11 +++++++++--
 arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
 arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
 3 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 46d03cc..180299e 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -22,7 +22,9 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/bitops.h>
+#include <trace/events/power.h>
 
+#include <asm/cpu.h>
 #include <plat/clock.h>
 #include "clockdomain.h"
 #include <plat/cpu.h>
@@ -261,8 +263,10 @@ void omap2_clk_disable(struct clk *clk)
 
 	pr_debug("clock: %s: disabling in hardware\n", clk->name);
 
-	if (clk->ops && clk->ops->disable)
+	if (clk->ops && clk->ops->disable) {
+		trace_clock_disable(clk->name, 0, smp_processor_id());
 		clk->ops->disable(clk);
+	}
 
 	if (clk->clkdm)
 		clkdm_clk_disable(clk->clkdm, clk);
@@ -314,6 +318,7 @@ int omap2_clk_enable(struct clk *clk)
 	}
 
 	if (clk->ops && clk->ops->enable) {
+		trace_clock_enable(clk->name, 1, smp_processor_id());
 		ret = clk->ops->enable(clk);
 		if (ret) {
 			WARN(1, "clock: %s: could not enable: %d\n",
@@ -353,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
 	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
 
 	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
-	if (clk->set_rate)
+	if (clk->set_rate) {
+		trace_clock_set_rate(clk->name, rate, smp_processor_id());
 		ret = clk->set_rate(clk, rate);
+	}
 
 	return ret;
 }
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index bd610bc..d46b9ff 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -29,6 +29,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/console.h>
+#include <trace/events/power.h>
 
 #include <plat/sram.h>
 #include "clockdomain.h"
@@ -514,8 +515,14 @@ static void omap3_pm_idle(void)
 	if (omap_irq_pending() || need_resched())
 		goto out;
 
+	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
+	trace_cpu_idle(1, smp_processor_id());
+
 	omap_sram_idle();
 
+	trace_power_end(smp_processor_id());
+	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
+
 out:
 	local_fiq_enable();
 	local_irq_enable();
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index eaed0df..1495eed 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -19,12 +19,15 @@
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include <trace/events/power.h>
+
 #include "cm2xxx_3xxx.h"
 #include "prcm44xx.h"
 #include "cm44xx.h"
 #include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
+#include <asm/cpu.h>
 #include <plat/cpu.h>
 #include "powerdomain.h"
 #include "clockdomain.h"
@@ -32,6 +35,8 @@
 
 #include "pm.h"
 
+#define PWRDM_TRACE_STATES_FLAG	(1<<31)
+
 enum {
 	PWRDM_STATE_NOW = 0,
 	PWRDM_STATE_PREV,
@@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
 static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 {
 
-	int prev;
-	int state;
+	int prev, state, trace_state = 0;
 
 	if (pwrdm == NULL)
 		return -EINVAL;
@@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 			pwrdm->state_counter[prev]++;
 		if (prev == PWRDM_POWER_RET)
 			_update_logic_membank_counters(pwrdm);
+		/*
+		 * If the power domain did not hit the desired state,
+		 * generate a trace event with both the desired and hit states
+		 */
+		if (state != prev) {
+			trace_state = (PWRDM_TRACE_STATES_FLAG |
+				       ((state & OMAP_POWERSTATE_MASK) << 8) |
+				       ((prev & OMAP_POWERSTATE_MASK) << 0));
+			trace_power_domain_target(pwrdm->name, trace_state,
+						  smp_processor_id());
+		}
 		break;
 	default:
 		return -EINVAL;
@@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
 		 pwrdm->name, pwrst);
 
-	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
+	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
+		/* Trace the pwrdm desired target state */
+		trace_power_domain_target(pwrdm->name, pwrst,
+					  smp_processor_id());
+		/* Program the pwrdm desired target state */
 		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
+	}
 
 	return ret;
 }
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-02-18 18:10 ` jean.pihet at newoldbits.com
@ 2011-03-03  0:43   ` Kevin Hilman
  -1 siblings, 0 replies; 36+ messages in thread
From: Kevin Hilman @ 2011-03-03  0:43 UTC (permalink / raw)
  To: jean.pihet; +Cc: Thomas Renninger, linux-omap, linux-arm-kernel, Jean Pihet

Hi Jean,

jean.pihet@newoldbits.com writes:

> From: Jean Pihet <j-pihet@ti.com>
>
> The patch adds the new power management trace points for
> the OMAP architecture.

There are some other core clock/powerdomain changes queued for 2.6.39
ahead of this that conflict with your patch.

Could you rebase this against my pm-core branch where these other
changes are queued?

Thanks,

Kevin

> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
>
> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ---
>  arch/arm/mach-omap2/clock.c       |    8 +++++++-
>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>  3 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> index 2a2f152..72af75d 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -22,7 +22,9 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/bitops.h>
> +#include <trace/events/power.h>
>  
> +#include <asm/cpu.h>
>  #include <plat/clock.h>
>  #include "clockdomain.h"
>  #include <plat/cpu.h>
> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>  
>  	pr_debug("clock: %s: disabling in hardware\n", clk->name);
>  
> +	trace_clock_disable(clk->name, 0, smp_processor_id());
>  	clk->ops->disable(clk);
>  
>  	if (clk->clkdm)
> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>  		}
>  	}
>  
> +	trace_clock_enable(clk->name, 1, smp_processor_id());
>  	ret = clk->ops->enable(clk);
>  	if (ret) {
>  		WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
>  	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
>  
>  	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
> -	if (clk->set_rate)
> +	if (clk->set_rate) {
> +		trace_clock_set_rate(clk->name, rate, smp_processor_id());
>  		ret = clk->set_rate(clk, rate);
> +	}
>  
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 2f864e4..d1cc3f4 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -29,6 +29,7 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/console.h>
> +#include <trace/events/power.h>
>  
>  #include <plat/sram.h>
>  #include "clockdomain.h"
> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>  	if (omap_irq_pending() || need_resched())
>  		goto out;
>  
> +	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> +	trace_cpu_idle(1, smp_processor_id());
> +
>  	omap_sram_idle();
>  
> +	trace_power_end(smp_processor_id());
> +	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
> +
>  out:
>  	local_fiq_enable();
>  	local_irq_enable();
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index eaed0df..1495eed 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>  
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -32,6 +35,8 @@
>  
>  #include "pm.h"
>  
> +#define PWRDM_TRACE_STATES_FLAG	(1<<31)
> +
>  enum {
>  	PWRDM_STATE_NOW = 0,
>  	PWRDM_STATE_PREV,
> @@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  {
>  
> -	int prev;
> -	int state;
> +	int prev, state, trace_state = 0;
>  
>  	if (pwrdm == NULL)
>  		return -EINVAL;
> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  			pwrdm->state_counter[prev]++;
>  		if (prev == PWRDM_POWER_RET)
>  			_update_logic_membank_counters(pwrdm);
> +		/*
> +		 * If the power domain did not hit the desired state,
> +		 * generate a trace event with both the desired and hit states
> +		 */
> +		if (state != prev) {
> +			trace_state = (PWRDM_TRACE_STATES_FLAG |
> +				       ((state & OMAP_POWERSTATE_MASK) << 8) |
> +				       ((prev & OMAP_POWERSTATE_MASK) << 0));
> +			trace_power_domain_target(pwrdm->name, trace_state,
> +						  smp_processor_id());
> +		}
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
>  		 pwrdm->name, pwrst);
>  
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		/* Trace the pwrdm desired target state */
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
> +		/* Program the pwrdm desired target state */
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>  
>  	return ret;
>  }

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-03-03  0:43   ` Kevin Hilman
  0 siblings, 0 replies; 36+ messages in thread
From: Kevin Hilman @ 2011-03-03  0:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jean,

jean.pihet at newoldbits.com writes:

> From: Jean Pihet <j-pihet@ti.com>
>
> The patch adds the new power management trace points for
> the OMAP architecture.

There are some other core clock/powerdomain changes queued for 2.6.39
ahead of this that conflict with your patch.

Could you rebase this against my pm-core branch where these other
changes are queued?

Thanks,

Kevin

> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
>
> Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ---
>  arch/arm/mach-omap2/clock.c       |    8 +++++++-
>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>  3 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> index 2a2f152..72af75d 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -22,7 +22,9 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/bitops.h>
> +#include <trace/events/power.h>
>  
> +#include <asm/cpu.h>
>  #include <plat/clock.h>
>  #include "clockdomain.h"
>  #include <plat/cpu.h>
> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>  
>  	pr_debug("clock: %s: disabling in hardware\n", clk->name);
>  
> +	trace_clock_disable(clk->name, 0, smp_processor_id());
>  	clk->ops->disable(clk);
>  
>  	if (clk->clkdm)
> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>  		}
>  	}
>  
> +	trace_clock_enable(clk->name, 1, smp_processor_id());
>  	ret = clk->ops->enable(clk);
>  	if (ret) {
>  		WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
>  	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
>  
>  	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
> -	if (clk->set_rate)
> +	if (clk->set_rate) {
> +		trace_clock_set_rate(clk->name, rate, smp_processor_id());
>  		ret = clk->set_rate(clk, rate);
> +	}
>  
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 2f864e4..d1cc3f4 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -29,6 +29,7 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/console.h>
> +#include <trace/events/power.h>
>  
>  #include <plat/sram.h>
>  #include "clockdomain.h"
> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>  	if (omap_irq_pending() || need_resched())
>  		goto out;
>  
> +	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> +	trace_cpu_idle(1, smp_processor_id());
> +
>  	omap_sram_idle();
>  
> +	trace_power_end(smp_processor_id());
> +	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
> +
>  out:
>  	local_fiq_enable();
>  	local_irq_enable();
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index eaed0df..1495eed 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>  
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -32,6 +35,8 @@
>  
>  #include "pm.h"
>  
> +#define PWRDM_TRACE_STATES_FLAG	(1<<31)
> +
>  enum {
>  	PWRDM_STATE_NOW = 0,
>  	PWRDM_STATE_PREV,
> @@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  {
>  
> -	int prev;
> -	int state;
> +	int prev, state, trace_state = 0;
>  
>  	if (pwrdm == NULL)
>  		return -EINVAL;
> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  			pwrdm->state_counter[prev]++;
>  		if (prev == PWRDM_POWER_RET)
>  			_update_logic_membank_counters(pwrdm);
> +		/*
> +		 * If the power domain did not hit the desired state,
> +		 * generate a trace event with both the desired and hit states
> +		 */
> +		if (state != prev) {
> +			trace_state = (PWRDM_TRACE_STATES_FLAG |
> +				       ((state & OMAP_POWERSTATE_MASK) << 8) |
> +				       ((prev & OMAP_POWERSTATE_MASK) << 0));
> +			trace_power_domain_target(pwrdm->name, trace_state,
> +						  smp_processor_id());
> +		}
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
>  		 pwrdm->name, pwrst);
>  
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		/* Trace the pwrdm desired target state */
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
> +		/* Program the pwrdm desired target state */
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>  
>  	return ret;
>  }

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-02-21  8:53       ` Santosh Shilimkar
@ 2011-02-28 16:33         ` Jean Pihet
  -1 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-02-28 16:33 UTC (permalink / raw)
  To: Santosh Shilimkar, Kevin Hilman
  Cc: Thomas Renninger, linux-omap, linux-arm-kernel, Jean Pihet-XID

Hi Kevin,

Can you please check this patch? From the previous discussions I
understood it was OK.
This one has been submitted to and l-o and l-a-k MLs. How will this
one be merged in?

Thanks,
Jean

On Mon, Feb 21, 2011 at 9:53 AM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
>> -----Original Message-----
>> From: Jean Pihet [mailto:jean.pihet@newoldbits.com]
>> Sent: Monday, February 21, 2011 2:14 PM
>> To: Santosh Shilimkar
>> Cc: Kevin Hilman; Thomas Renninger; linux-omap@vger.kernel.org;
>> linux-arm-kernel@lists.infradead.org; Jean Pihet-XID
>> Subject: Re: [PATCH] perf: add OMAP support for the new power events
>>
>> Hi Santosh,
>>
>
> [...]
>
>> >> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
>> >> omap2/pm34xx.c
>> >> index 2f864e4..d1cc3f4 100644
>> >> --- a/arch/arm/mach-omap2/pm34xx.c
>> >> +++ b/arch/arm/mach-omap2/pm34xx.c
>> >> @@ -29,6 +29,7 @@
>> >>  #include <linux/delay.h>
>> >>  #include <linux/slab.h>
>> >>  #include <linux/console.h>
>> >> +#include <trace/events/power.h>
>> >>
>> >>  #include <plat/sram.h>
>> >>  #include "clockdomain.h"
>> >> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>> >>       if (omap_irq_pending() || need_resched())
>> >>               goto out;
>> >>
>> >> +     trace_power_start(POWER_CSTATE, 1, smp_processor_id());
>> >> +     trace_cpu_idle(1, smp_processor_id());
>> >> +
>> >
>> > This default idle code won't be used when you enable the
>> > CONFIG_CPUIDLE. That case the cpuidle34xx.c idle code gets
>> > registered.
>> That is correct. OMAP has a default idle handler (omap3_pm_idle) and
>> a
>> cpuidle handler (omap3_enter_idle in
>> arch/arm/mach-omap2/cpuidle34xx.c).
>>
>> > Shouldn't you patch that code instead? This is more or less
>> > dead code and it is just like default idle code when idle
>> > drivers isn't registered.
>> The cpuidle framework already is instrumented in a generic way. This
>> code adds the instrumentation to the default idle handler so that
>> all
>> cases are covered. BTW the patch description gives that information.
>>
>> If there is dead code then it is not only the code from this patch
>> but
>> all the code for the default idle handler.
>>
> I read your change log. It says.
>
>>> The trace points are for:
>>> - default idle handler. Since the cpuidle framework is
>>>   instrumented in the generic way there is no need to
>>>   add trace points in the OMAP specific cpuidle handler;
> Now code in cpuilde34xx.c is also OMAP specific and hence the
> confusion at least for me.
> Regarding dead code, I meant existing code of default handler.
>
> Thanks for clarification.
>
> Regards,
> Santosh
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-02-28 16:33         ` Jean Pihet
  0 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-02-28 16:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kevin,

Can you please check this patch? From the previous discussions I
understood it was OK.
This one has been submitted to and l-o and l-a-k MLs. How will this
one be merged in?

Thanks,
Jean

On Mon, Feb 21, 2011 at 9:53 AM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
>> -----Original Message-----
>> From: Jean Pihet [mailto:jean.pihet at newoldbits.com]
>> Sent: Monday, February 21, 2011 2:14 PM
>> To: Santosh Shilimkar
>> Cc: Kevin Hilman; Thomas Renninger; linux-omap at vger.kernel.org;
>> linux-arm-kernel at lists.infradead.org; Jean Pihet-XID
>> Subject: Re: [PATCH] perf: add OMAP support for the new power events
>>
>> Hi Santosh,
>>
>
> [...]
>
>> >> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
>> >> omap2/pm34xx.c
>> >> index 2f864e4..d1cc3f4 100644
>> >> --- a/arch/arm/mach-omap2/pm34xx.c
>> >> +++ b/arch/arm/mach-omap2/pm34xx.c
>> >> @@ -29,6 +29,7 @@
>> >> ?#include <linux/delay.h>
>> >> ?#include <linux/slab.h>
>> >> ?#include <linux/console.h>
>> >> +#include <trace/events/power.h>
>> >>
>> >> ?#include <plat/sram.h>
>> >> ?#include "clockdomain.h"
>> >> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>> >> ? ? ? if (omap_irq_pending() || need_resched())
>> >> ? ? ? ? ? ? ? goto out;
>> >>
>> >> + ? ? trace_power_start(POWER_CSTATE, 1, smp_processor_id());
>> >> + ? ? trace_cpu_idle(1, smp_processor_id());
>> >> +
>> >
>> > This default idle code won't be used when you enable the
>> > CONFIG_CPUIDLE. That case the cpuidle34xx.c idle code gets
>> > registered.
>> That is correct. OMAP has a default idle handler (omap3_pm_idle) and
>> a
>> cpuidle handler (omap3_enter_idle in
>> arch/arm/mach-omap2/cpuidle34xx.c).
>>
>> > Shouldn't you patch that code instead? This is more or less
>> > dead code and it is just like default idle code when idle
>> > drivers isn't registered.
>> The cpuidle framework already is instrumented in a generic way. This
>> code adds the instrumentation to the default idle handler so that
>> all
>> cases are covered. BTW the patch description gives that information.
>>
>> If there is dead code then it is not only the code from this patch
>> but
>> all the code for the default idle handler.
>>
> I read your change log. It says.
>
>>> The trace points are for:
>>> - default idle handler. Since the cpuidle framework is
>>> ? instrumented in the generic way there is no need to
>>> ? add trace points in the OMAP specific cpuidle handler;
> Now code in cpuilde34xx.c is also OMAP specific and hence the
> confusion at least for me.
> Regarding dead code, I meant existing code of default handler.
>
> Thanks for clarification.
>
> Regards,
> Santosh
>

^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH] perf: add OMAP support for the new power events
  2011-02-21  8:44     ` Jean Pihet
@ 2011-02-21  8:53       ` Santosh Shilimkar
  -1 siblings, 0 replies; 36+ messages in thread
From: Santosh Shilimkar @ 2011-02-21  8:53 UTC (permalink / raw)
  To: Jean Pihet
  Cc: Kevin Hilman, Thomas Renninger, linux-omap, linux-arm-kernel,
	Jean Pihet-XID

> -----Original Message-----
> From: Jean Pihet [mailto:jean.pihet@newoldbits.com]
> Sent: Monday, February 21, 2011 2:14 PM
> To: Santosh Shilimkar
> Cc: Kevin Hilman; Thomas Renninger; linux-omap@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; Jean Pihet-XID
> Subject: Re: [PATCH] perf: add OMAP support for the new power events
>
> Hi Santosh,
>

[...]

> >> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
> >> omap2/pm34xx.c
> >> index 2f864e4..d1cc3f4 100644
> >> --- a/arch/arm/mach-omap2/pm34xx.c
> >> +++ b/arch/arm/mach-omap2/pm34xx.c
> >> @@ -29,6 +29,7 @@
> >>  #include <linux/delay.h>
> >>  #include <linux/slab.h>
> >>  #include <linux/console.h>
> >> +#include <trace/events/power.h>
> >>
> >>  #include <plat/sram.h>
> >>  #include "clockdomain.h"
> >> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
> >>       if (omap_irq_pending() || need_resched())
> >>               goto out;
> >>
> >> +     trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> >> +     trace_cpu_idle(1, smp_processor_id());
> >> +
> >
> > This default idle code won't be used when you enable the
> > CONFIG_CPUIDLE. That case the cpuidle34xx.c idle code gets
> > registered.
> That is correct. OMAP has a default idle handler (omap3_pm_idle) and
> a
> cpuidle handler (omap3_enter_idle in
> arch/arm/mach-omap2/cpuidle34xx.c).
>
> > Shouldn't you patch that code instead? This is more or less
> > dead code and it is just like default idle code when idle
> > drivers isn't registered.
> The cpuidle framework already is instrumented in a generic way. This
> code adds the instrumentation to the default idle handler so that
> all
> cases are covered. BTW the patch description gives that information.
>
> If there is dead code then it is not only the code from this patch
> but
> all the code for the default idle handler.
>
I read your change log. It says.

>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>>   instrumented in the generic way there is no need to
>>   add trace points in the OMAP specific cpuidle handler;
Now code in cpuilde34xx.c is also OMAP specific and hence the
confusion at least for me.
Regarding dead code, I meant existing code of default handler.

Thanks for clarification.

Regards,
Santosh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-02-21  8:53       ` Santosh Shilimkar
  0 siblings, 0 replies; 36+ messages in thread
From: Santosh Shilimkar @ 2011-02-21  8:53 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: Jean Pihet [mailto:jean.pihet at newoldbits.com]
> Sent: Monday, February 21, 2011 2:14 PM
> To: Santosh Shilimkar
> Cc: Kevin Hilman; Thomas Renninger; linux-omap at vger.kernel.org;
> linux-arm-kernel at lists.infradead.org; Jean Pihet-XID
> Subject: Re: [PATCH] perf: add OMAP support for the new power events
>
> Hi Santosh,
>

[...]

> >> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
> >> omap2/pm34xx.c
> >> index 2f864e4..d1cc3f4 100644
> >> --- a/arch/arm/mach-omap2/pm34xx.c
> >> +++ b/arch/arm/mach-omap2/pm34xx.c
> >> @@ -29,6 +29,7 @@
> >> ?#include <linux/delay.h>
> >> ?#include <linux/slab.h>
> >> ?#include <linux/console.h>
> >> +#include <trace/events/power.h>
> >>
> >> ?#include <plat/sram.h>
> >> ?#include "clockdomain.h"
> >> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
> >> ? ? ? if (omap_irq_pending() || need_resched())
> >> ? ? ? ? ? ? ? goto out;
> >>
> >> + ? ? trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> >> + ? ? trace_cpu_idle(1, smp_processor_id());
> >> +
> >
> > This default idle code won't be used when you enable the
> > CONFIG_CPUIDLE. That case the cpuidle34xx.c idle code gets
> > registered.
> That is correct. OMAP has a default idle handler (omap3_pm_idle) and
> a
> cpuidle handler (omap3_enter_idle in
> arch/arm/mach-omap2/cpuidle34xx.c).
>
> > Shouldn't you patch that code instead? This is more or less
> > dead code and it is just like default idle code when idle
> > drivers isn't registered.
> The cpuidle framework already is instrumented in a generic way. This
> code adds the instrumentation to the default idle handler so that
> all
> cases are covered. BTW the patch description gives that information.
>
> If there is dead code then it is not only the code from this patch
> but
> all the code for the default idle handler.
>
I read your change log. It says.

>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>> ? instrumented in the generic way there is no need to
>> ? add trace points in the OMAP specific cpuidle handler;
Now code in cpuilde34xx.c is also OMAP specific and hence the
confusion at least for me.
Regarding dead code, I meant existing code of default handler.

Thanks for clarification.

Regards,
Santosh

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH] perf: add OMAP support for the new power events
  2011-02-19 18:55   ` Santosh Shilimkar
@ 2011-02-21  8:44     ` Jean Pihet
  -1 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-02-21  8:44 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: Kevin Hilman, Thomas Renninger, linux-omap, linux-arm-kernel,
	Jean Pihet-XID

Hi Santosh,

On Sat, Feb 19, 2011 at 7:55 PM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
>> -----Original Message-----
>> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>> owner@vger.kernel.org] On Behalf Of jean.pihet@newoldbits.com
>> Sent: Friday, February 18, 2011 11:41 PM
>> To: Kevin Hilman; Thomas Renninger; linux-omap@vger.kernel.org;
>> linux-arm-kernel@lists.infradead.org
>> Cc: Jean Pihet
>> Subject: [PATCH] perf: add OMAP support for the new power events
>>
>> From: Jean Pihet <j-pihet@ti.com>
>>
>> The patch adds the new power management trace points for
>> the OMAP architecture.
>>
>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>>   instrumented in the generic way there is no need to
>>   add trace points in the OMAP specific cpuidle handler;
>> - cpufreq (DVFS),
>> - SoC clocks changes (enable, disable, set_rate),
>> - power domain states: the desired target state and -if different-
>>   the actually hit state.
>>
>> Because of the generic nature of the changes, OMAP3 and OMAP4 are
>> supported.
>>
>> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>>
>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
>> ---
>>  arch/arm/mach-omap2/clock.c       |    8 +++++++-
>>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>>  3 files changed, 37 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-
>> omap2/clock.c
>> index 2a2f152..72af75d 100644
>> --- a/arch/arm/mach-omap2/clock.c
>> +++ b/arch/arm/mach-omap2/clock.c
>> @@ -22,7 +22,9 @@
>>  #include <linux/clk.h>
>>  #include <linux/io.h>
>>  #include <linux/bitops.h>
>> +#include <trace/events/power.h>
>>
>> +#include <asm/cpu.h>
>>  #include <plat/clock.h>
>>  #include "clockdomain.h"
>>  #include <plat/cpu.h>
>> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>>
>>       pr_debug("clock: %s: disabling in hardware\n", clk->name);
>>
>> +     trace_clock_disable(clk->name, 0, smp_processor_id());
>>       clk->ops->disable(clk);
>>
>>       if (clk->clkdm)
>> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>>               }
>>       }
>>
>> +     trace_clock_enable(clk->name, 1, smp_processor_id());
>>       ret = clk->ops->enable(clk);
>>       if (ret) {
>>               WARN(1, "clock: %s: could not enable: %d\n", clk->name,
>> ret);
>> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk,
>> unsigned long rate)
>>       pr_debug("clock: set_rate for clock %s to rate %ld\n", clk-
>> >name, rate);
>>
>>       /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
>> -     if (clk->set_rate)
>> +     if (clk->set_rate) {
>> +             trace_clock_set_rate(clk->name, rate,
>> smp_processor_id());
>>               ret = clk->set_rate(clk, rate);
>> +     }
>>
>>       return ret;
>>  }
>> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
>> omap2/pm34xx.c
>> index 2f864e4..d1cc3f4 100644
>> --- a/arch/arm/mach-omap2/pm34xx.c
>> +++ b/arch/arm/mach-omap2/pm34xx.c
>> @@ -29,6 +29,7 @@
>>  #include <linux/delay.h>
>>  #include <linux/slab.h>
>>  #include <linux/console.h>
>> +#include <trace/events/power.h>
>>
>>  #include <plat/sram.h>
>>  #include "clockdomain.h"
>> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>>       if (omap_irq_pending() || need_resched())
>>               goto out;
>>
>> +     trace_power_start(POWER_CSTATE, 1, smp_processor_id());
>> +     trace_cpu_idle(1, smp_processor_id());
>> +
>
> This default idle code won't be used when you enable the
> CONFIG_CPUIDLE. That case the cpuidle34xx.c idle code gets
> registered.
That is correct. OMAP has a default idle handler (omap3_pm_idle) and a
cpuidle handler (omap3_enter_idle in
arch/arm/mach-omap2/cpuidle34xx.c).

> Shouldn't you patch that code instead? This is more or less
> dead code and it is just like default idle code when idle
> drivers isn't registered.
The cpuidle framework already is instrumented in a generic way. This
code adds the instrumentation to the default idle handler so that all
cases are covered. BTW the patch description gives that information.

If there is dead code then it is not only the code from this patch but
all the code for the default idle handler.

Thanks for reviewing.

Regards,
Jean

>
>
>>       omap_sram_idle();
>>
>> +     trace_power_end(smp_processor_id());
>> +     trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
>> +
>>  out:
>>       local_fiq_enable();
>>       local_irq_enable();
>> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-
>> omap2/powerdomain.c
>> index eaed0df..1495eed 100644
>> --- a/arch/arm/mach-omap2/powerdomain.c
>> +++ b/arch/arm/mach-omap2/powerdomain.c
>> @@ -19,12 +19,15 @@
>>  #include <linux/list.h>
>>  #include <linux/errno.h>
>>  #include <linux/string.h>
>> +#include <trace/events/power.h>
>> +
>>  #include "cm2xxx_3xxx.h"
>>  #include "prcm44xx.h"
>>  #include "cm44xx.h"
>>  #include "prm2xxx_3xxx.h"
>>  #include "prm44xx.h"
>>
>> +#include <asm/cpu.h>
>>  #include <plat/cpu.h>
>>  #include "powerdomain.h"
>>  #include "clockdomain.h"
>> @@ -32,6 +35,8 @@
>>
>>  #include "pm.h"
>>
>> +#define PWRDM_TRACE_STATES_FLAG      (1<<31)
>> +
>>  enum {
>>       PWRDM_STATE_NOW = 0,
>>       PWRDM_STATE_PREV,
>> @@ -130,8 +135,7 @@ static void
>> _update_logic_membank_counters(struct powerdomain *pwrdm)
>>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>>  {
>>
>> -     int prev;
>> -     int state;
>> +     int prev, state, trace_state = 0;
>>
>>       if (pwrdm == NULL)
>>               return -EINVAL;
>> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct
>> powerdomain *pwrdm, int flag)
>>                       pwrdm->state_counter[prev]++;
>>               if (prev == PWRDM_POWER_RET)
>>                       _update_logic_membank_counters(pwrdm);
>> +             /*
>> +              * If the power domain did not hit the desired state,
>> +              * generate a trace event with both the desired and hit
>> states
>> +              */
>> +             if (state != prev) {
>> +                     trace_state = (PWRDM_TRACE_STATES_FLAG |
>> +                                    ((state & OMAP_POWERSTATE_MASK) <<
> 8)
>> |
>> +                                    ((prev & OMAP_POWERSTATE_MASK) <<
>> 0));
>> +                     trace_power_domain_target(pwrdm->name,
>> trace_state,
>> +                                               smp_processor_id());
>> +             }
>>               break;
>>       default:
>>               return -EINVAL;
>> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain
>> *pwrdm, u8 pwrst)
>>       pr_debug("powerdomain: setting next powerstate for %s to
>> %0x\n",
>>                pwrdm->name, pwrst);
>>
>> -     if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
>> +     if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
>> +             /* Trace the pwrdm desired target state */
>> +             trace_power_domain_target(pwrdm->name, pwrst,
>> +                                       smp_processor_id());
>> +             /* Program the pwrdm desired target state */
>>               ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
>> +     }
>>
>>       return ret;
>>  }
>> --
>> 1.7.2.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-
>> omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-02-21  8:44     ` Jean Pihet
  0 siblings, 0 replies; 36+ messages in thread
From: Jean Pihet @ 2011-02-21  8:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Santosh,

On Sat, Feb 19, 2011 at 7:55 PM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
>> -----Original Message-----
>> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
>> owner at vger.kernel.org] On Behalf Of jean.pihet at newoldbits.com
>> Sent: Friday, February 18, 2011 11:41 PM
>> To: Kevin Hilman; Thomas Renninger; linux-omap at vger.kernel.org;
>> linux-arm-kernel at lists.infradead.org
>> Cc: Jean Pihet
>> Subject: [PATCH] perf: add OMAP support for the new power events
>>
>> From: Jean Pihet <j-pihet@ti.com>
>>
>> The patch adds the new power management trace points for
>> the OMAP architecture.
>>
>> The trace points are for:
>> - default idle handler. Since the cpuidle framework is
>> ? instrumented in the generic way there is no need to
>> ? add trace points in the OMAP specific cpuidle handler;
>> - cpufreq (DVFS),
>> - SoC clocks changes (enable, disable, set_rate),
>> - power domain states: the desired target state and -if different-
>> ? the actually hit state.
>>
>> Because of the generic nature of the changes, OMAP3 and OMAP4 are
>> supported.
>>
>> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>>
>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
>> ---
>> ?arch/arm/mach-omap2/clock.c ? ? ? | ? ?8 +++++++-
>> ?arch/arm/mach-omap2/pm34xx.c ? ? ?| ? ?7 +++++++
>> ?arch/arm/mach-omap2/powerdomain.c | ? 26 +++++++++++++++++++++++---
>> ?3 files changed, 37 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-
>> omap2/clock.c
>> index 2a2f152..72af75d 100644
>> --- a/arch/arm/mach-omap2/clock.c
>> +++ b/arch/arm/mach-omap2/clock.c
>> @@ -22,7 +22,9 @@
>> ?#include <linux/clk.h>
>> ?#include <linux/io.h>
>> ?#include <linux/bitops.h>
>> +#include <trace/events/power.h>
>>
>> +#include <asm/cpu.h>
>> ?#include <plat/clock.h>
>> ?#include "clockdomain.h"
>> ?#include <plat/cpu.h>
>> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>>
>> ? ? ? pr_debug("clock: %s: disabling in hardware\n", clk->name);
>>
>> + ? ? trace_clock_disable(clk->name, 0, smp_processor_id());
>> ? ? ? clk->ops->disable(clk);
>>
>> ? ? ? if (clk->clkdm)
>> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>> ? ? ? ? ? ? ? }
>> ? ? ? }
>>
>> + ? ? trace_clock_enable(clk->name, 1, smp_processor_id());
>> ? ? ? ret = clk->ops->enable(clk);
>> ? ? ? if (ret) {
>> ? ? ? ? ? ? ? WARN(1, "clock: %s: could not enable: %d\n", clk->name,
>> ret);
>> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk,
>> unsigned long rate)
>> ? ? ? pr_debug("clock: set_rate for clock %s to rate %ld\n", clk-
>> >name, rate);
>>
>> ? ? ? /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
>> - ? ? if (clk->set_rate)
>> + ? ? if (clk->set_rate) {
>> + ? ? ? ? ? ? trace_clock_set_rate(clk->name, rate,
>> smp_processor_id());
>> ? ? ? ? ? ? ? ret = clk->set_rate(clk, rate);
>> + ? ? }
>>
>> ? ? ? return ret;
>> ?}
>> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
>> omap2/pm34xx.c
>> index 2f864e4..d1cc3f4 100644
>> --- a/arch/arm/mach-omap2/pm34xx.c
>> +++ b/arch/arm/mach-omap2/pm34xx.c
>> @@ -29,6 +29,7 @@
>> ?#include <linux/delay.h>
>> ?#include <linux/slab.h>
>> ?#include <linux/console.h>
>> +#include <trace/events/power.h>
>>
>> ?#include <plat/sram.h>
>> ?#include "clockdomain.h"
>> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>> ? ? ? if (omap_irq_pending() || need_resched())
>> ? ? ? ? ? ? ? goto out;
>>
>> + ? ? trace_power_start(POWER_CSTATE, 1, smp_processor_id());
>> + ? ? trace_cpu_idle(1, smp_processor_id());
>> +
>
> This default idle code won't be used when you enable the
> CONFIG_CPUIDLE. That case the cpuidle34xx.c idle code gets
> registered.
That is correct. OMAP has a default idle handler (omap3_pm_idle) and a
cpuidle handler (omap3_enter_idle in
arch/arm/mach-omap2/cpuidle34xx.c).

> Shouldn't you patch that code instead? This is more or less
> dead code and it is just like default idle code when idle
> drivers isn't registered.
The cpuidle framework already is instrumented in a generic way. This
code adds the instrumentation to the default idle handler so that all
cases are covered. BTW the patch description gives that information.

If there is dead code then it is not only the code from this patch but
all the code for the default idle handler.

Thanks for reviewing.

Regards,
Jean

>
>
>> ? ? ? omap_sram_idle();
>>
>> + ? ? trace_power_end(smp_processor_id());
>> + ? ? trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
>> +
>> ?out:
>> ? ? ? local_fiq_enable();
>> ? ? ? local_irq_enable();
>> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-
>> omap2/powerdomain.c
>> index eaed0df..1495eed 100644
>> --- a/arch/arm/mach-omap2/powerdomain.c
>> +++ b/arch/arm/mach-omap2/powerdomain.c
>> @@ -19,12 +19,15 @@
>> ?#include <linux/list.h>
>> ?#include <linux/errno.h>
>> ?#include <linux/string.h>
>> +#include <trace/events/power.h>
>> +
>> ?#include "cm2xxx_3xxx.h"
>> ?#include "prcm44xx.h"
>> ?#include "cm44xx.h"
>> ?#include "prm2xxx_3xxx.h"
>> ?#include "prm44xx.h"
>>
>> +#include <asm/cpu.h>
>> ?#include <plat/cpu.h>
>> ?#include "powerdomain.h"
>> ?#include "clockdomain.h"
>> @@ -32,6 +35,8 @@
>>
>> ?#include "pm.h"
>>
>> +#define PWRDM_TRACE_STATES_FLAG ? ? ?(1<<31)
>> +
>> ?enum {
>> ? ? ? PWRDM_STATE_NOW = 0,
>> ? ? ? PWRDM_STATE_PREV,
>> @@ -130,8 +135,7 @@ static void
>> _update_logic_membank_counters(struct powerdomain *pwrdm)
>> ?static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>> ?{
>>
>> - ? ? int prev;
>> - ? ? int state;
>> + ? ? int prev, state, trace_state = 0;
>>
>> ? ? ? if (pwrdm == NULL)
>> ? ? ? ? ? ? ? return -EINVAL;
>> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct
>> powerdomain *pwrdm, int flag)
>> ? ? ? ? ? ? ? ? ? ? ? pwrdm->state_counter[prev]++;
>> ? ? ? ? ? ? ? if (prev == PWRDM_POWER_RET)
>> ? ? ? ? ? ? ? ? ? ? ? _update_logic_membank_counters(pwrdm);
>> + ? ? ? ? ? ? /*
>> + ? ? ? ? ? ? ?* If the power domain did not hit the desired state,
>> + ? ? ? ? ? ? ?* generate a trace event with both the desired and hit
>> states
>> + ? ? ? ? ? ? ?*/
>> + ? ? ? ? ? ? if (state != prev) {
>> + ? ? ? ? ? ? ? ? ? ? trace_state = (PWRDM_TRACE_STATES_FLAG |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((state & OMAP_POWERSTATE_MASK) <<
> 8)
>> |
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?((prev & OMAP_POWERSTATE_MASK) <<
>> 0));
>> + ? ? ? ? ? ? ? ? ? ? trace_power_domain_target(pwrdm->name,
>> trace_state,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? smp_processor_id());
>> + ? ? ? ? ? ? }
>> ? ? ? ? ? ? ? break;
>> ? ? ? default:
>> ? ? ? ? ? ? ? return -EINVAL;
>> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain
>> *pwrdm, u8 pwrst)
>> ? ? ? pr_debug("powerdomain: setting next powerstate for %s to
>> %0x\n",
>> ? ? ? ? ? ? ? ?pwrdm->name, pwrst);
>>
>> - ? ? if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
>> + ? ? if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
>> + ? ? ? ? ? ? /* Trace the pwrdm desired target state */
>> + ? ? ? ? ? ? trace_power_domain_target(pwrdm->name, pwrst,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? smp_processor_id());
>> + ? ? ? ? ? ? /* Program the pwrdm desired target state */
>> ? ? ? ? ? ? ? ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
>> + ? ? }
>>
>> ? ? ? return ret;
>> ?}
>> --
>> 1.7.2.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-
>> omap" in
>> the body of a message to majordomo at vger.kernel.org
>> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH] perf: add OMAP support for the new power events
  2011-02-18 18:10 ` jean.pihet at newoldbits.com
@ 2011-02-19 18:55   ` Santosh Shilimkar
  -1 siblings, 0 replies; 36+ messages in thread
From: Santosh Shilimkar @ 2011-02-19 18:55 UTC (permalink / raw)
  To: jean.pihet, Kevin Hilman, Thomas Renninger, linux-omap, linux-arm-kernel
  Cc: Jean Pihet-XID

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of jean.pihet@newoldbits.com
> Sent: Friday, February 18, 2011 11:41 PM
> To: Kevin Hilman; Thomas Renninger; linux-omap@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org
> Cc: Jean Pihet
> Subject: [PATCH] perf: add OMAP support for the new power events
>
> From: Jean Pihet <j-pihet@ti.com>
>
> The patch adds the new power management trace points for
> the OMAP architecture.
>
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
>
> Because of the generic nature of the changes, OMAP3 and OMAP4 are
> supported.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ---
>  arch/arm/mach-omap2/clock.c       |    8 +++++++-
>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>  3 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-
> omap2/clock.c
> index 2a2f152..72af75d 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -22,7 +22,9 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/bitops.h>
> +#include <trace/events/power.h>
>
> +#include <asm/cpu.h>
>  #include <plat/clock.h>
>  #include "clockdomain.h"
>  #include <plat/cpu.h>
> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>
>  	pr_debug("clock: %s: disabling in hardware\n", clk->name);
>
> +	trace_clock_disable(clk->name, 0, smp_processor_id());
>  	clk->ops->disable(clk);
>
>  	if (clk->clkdm)
> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>  		}
>  	}
>
> +	trace_clock_enable(clk->name, 1, smp_processor_id());
>  	ret = clk->ops->enable(clk);
>  	if (ret) {
>  		WARN(1, "clock: %s: could not enable: %d\n", clk->name,
> ret);
> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk,
> unsigned long rate)
>  	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk-
> >name, rate);
>
>  	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
> -	if (clk->set_rate)
> +	if (clk->set_rate) {
> +		trace_clock_set_rate(clk->name, rate,
> smp_processor_id());
>  		ret = clk->set_rate(clk, rate);
> +	}
>
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
> omap2/pm34xx.c
> index 2f864e4..d1cc3f4 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -29,6 +29,7 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/console.h>
> +#include <trace/events/power.h>
>
>  #include <plat/sram.h>
>  #include "clockdomain.h"
> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>  	if (omap_irq_pending() || need_resched())
>  		goto out;
>
> +	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> +	trace_cpu_idle(1, smp_processor_id());
> +

This default idle code won't be used when you enable the
CONFIG_CPUIDLE. That case the cpuidle34xx.c idle code gets
registered.

Shouldn't you patch that code instead? This is more or less
dead code and it is just like default idle code when idle
drivers isn't registered.


>  	omap_sram_idle();
>
> +	trace_power_end(smp_processor_id());
> +	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
> +
>  out:
>  	local_fiq_enable();
>  	local_irq_enable();
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-
> omap2/powerdomain.c
> index eaed0df..1495eed 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -32,6 +35,8 @@
>
>  #include "pm.h"
>
> +#define PWRDM_TRACE_STATES_FLAG	(1<<31)
> +
>  enum {
>  	PWRDM_STATE_NOW = 0,
>  	PWRDM_STATE_PREV,
> @@ -130,8 +135,7 @@ static void
> _update_logic_membank_counters(struct powerdomain *pwrdm)
>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  {
>
> -	int prev;
> -	int state;
> +	int prev, state, trace_state = 0;
>
>  	if (pwrdm == NULL)
>  		return -EINVAL;
> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct
> powerdomain *pwrdm, int flag)
>  			pwrdm->state_counter[prev]++;
>  		if (prev == PWRDM_POWER_RET)
>  			_update_logic_membank_counters(pwrdm);
> +		/*
> +		 * If the power domain did not hit the desired state,
> +		 * generate a trace event with both the desired and hit
> states
> +		 */
> +		if (state != prev) {
> +			trace_state = (PWRDM_TRACE_STATES_FLAG |
> +				       ((state & OMAP_POWERSTATE_MASK) <<
8)
> |
> +				       ((prev & OMAP_POWERSTATE_MASK) <<
> 0));
> +			trace_power_domain_target(pwrdm->name,
> trace_state,
> +						  smp_processor_id());
> +		}
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain
> *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to
> %0x\n",
>  		 pwrdm->name, pwrst);
>
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		/* Trace the pwrdm desired target state */
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
> +		/* Program the pwrdm desired target state */
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>
>  	return ret;
>  }
> --
> 1.7.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-02-19 18:55   ` Santosh Shilimkar
  0 siblings, 0 replies; 36+ messages in thread
From: Santosh Shilimkar @ 2011-02-19 18:55 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
> owner at vger.kernel.org] On Behalf Of jean.pihet at newoldbits.com
> Sent: Friday, February 18, 2011 11:41 PM
> To: Kevin Hilman; Thomas Renninger; linux-omap at vger.kernel.org;
> linux-arm-kernel at lists.infradead.org
> Cc: Jean Pihet
> Subject: [PATCH] perf: add OMAP support for the new power events
>
> From: Jean Pihet <j-pihet@ti.com>
>
> The patch adds the new power management trace points for
> the OMAP architecture.
>
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
>
> Because of the generic nature of the changes, OMAP3 and OMAP4 are
> supported.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ---
>  arch/arm/mach-omap2/clock.c       |    8 +++++++-
>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>  3 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-
> omap2/clock.c
> index 2a2f152..72af75d 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -22,7 +22,9 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/bitops.h>
> +#include <trace/events/power.h>
>
> +#include <asm/cpu.h>
>  #include <plat/clock.h>
>  #include "clockdomain.h"
>  #include <plat/cpu.h>
> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>
>  	pr_debug("clock: %s: disabling in hardware\n", clk->name);
>
> +	trace_clock_disable(clk->name, 0, smp_processor_id());
>  	clk->ops->disable(clk);
>
>  	if (clk->clkdm)
> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>  		}
>  	}
>
> +	trace_clock_enable(clk->name, 1, smp_processor_id());
>  	ret = clk->ops->enable(clk);
>  	if (ret) {
>  		WARN(1, "clock: %s: could not enable: %d\n", clk->name,
> ret);
> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk,
> unsigned long rate)
>  	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk-
> >name, rate);
>
>  	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
> -	if (clk->set_rate)
> +	if (clk->set_rate) {
> +		trace_clock_set_rate(clk->name, rate,
> smp_processor_id());
>  		ret = clk->set_rate(clk, rate);
> +	}
>
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
> omap2/pm34xx.c
> index 2f864e4..d1cc3f4 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -29,6 +29,7 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/console.h>
> +#include <trace/events/power.h>
>
>  #include <plat/sram.h>
>  #include "clockdomain.h"
> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>  	if (omap_irq_pending() || need_resched())
>  		goto out;
>
> +	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> +	trace_cpu_idle(1, smp_processor_id());
> +

This default idle code won't be used when you enable the
CONFIG_CPUIDLE. That case the cpuidle34xx.c idle code gets
registered.

Shouldn't you patch that code instead? This is more or less
dead code and it is just like default idle code when idle
drivers isn't registered.


>  	omap_sram_idle();
>
> +	trace_power_end(smp_processor_id());
> +	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
> +
>  out:
>  	local_fiq_enable();
>  	local_irq_enable();
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-
> omap2/powerdomain.c
> index eaed0df..1495eed 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -32,6 +35,8 @@
>
>  #include "pm.h"
>
> +#define PWRDM_TRACE_STATES_FLAG	(1<<31)
> +
>  enum {
>  	PWRDM_STATE_NOW = 0,
>  	PWRDM_STATE_PREV,
> @@ -130,8 +135,7 @@ static void
> _update_logic_membank_counters(struct powerdomain *pwrdm)
>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  {
>
> -	int prev;
> -	int state;
> +	int prev, state, trace_state = 0;
>
>  	if (pwrdm == NULL)
>  		return -EINVAL;
> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct
> powerdomain *pwrdm, int flag)
>  			pwrdm->state_counter[prev]++;
>  		if (prev == PWRDM_POWER_RET)
>  			_update_logic_membank_counters(pwrdm);
> +		/*
> +		 * If the power domain did not hit the desired state,
> +		 * generate a trace event with both the desired and hit
> states
> +		 */
> +		if (state != prev) {
> +			trace_state = (PWRDM_TRACE_STATES_FLAG |
> +				       ((state & OMAP_POWERSTATE_MASK) <<
8)
> |
> +				       ((prev & OMAP_POWERSTATE_MASK) <<
> 0));
> +			trace_power_domain_target(pwrdm->name,
> trace_state,
> +						  smp_processor_id());
> +		}
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain
> *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to
> %0x\n",
>  		 pwrdm->name, pwrst);
>
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		/* Trace the pwrdm desired target state */
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
> +		/* Program the pwrdm desired target state */
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>
>  	return ret;
>  }
> --
> 1.7.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* RE: [PATCH] perf: add OMAP support for the new power events
  2011-02-18 18:10 ` jean.pihet at newoldbits.com
@ 2011-02-18 18:21   ` Santosh Shilimkar
  -1 siblings, 0 replies; 36+ messages in thread
From: Santosh Shilimkar @ 2011-02-18 18:21 UTC (permalink / raw)
  To: jean.pihet, Kevin Hilman, Thomas Renninger, linux-omap, linux-arm-kernel
  Cc: Jean Pihet-XID

Jean,
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of jean.pihet@newoldbits.com
> Sent: Friday, February 18, 2011 11:41 PM
> To: Kevin Hilman; Thomas Renninger; linux-omap@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org
> Cc: Jean Pihet
> Subject: [PATCH] perf: add OMAP support for the new power events
>
> From: Jean Pihet <j-pihet@ti.com>
>
> The patch adds the new power management trace points for
> the OMAP architecture.
>
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
>
> Because of the generic nature of the changes, OMAP3 and OMAP4 are
> supported.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>

Thanks for additional power domain trace point as per
discussion.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

> ---
>  arch/arm/mach-omap2/clock.c       |    8 +++++++-
>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>  3 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-
> omap2/clock.c
> index 2a2f152..72af75d 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -22,7 +22,9 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/bitops.h>
> +#include <trace/events/power.h>
>
> +#include <asm/cpu.h>
>  #include <plat/clock.h>
>  #include "clockdomain.h"
>  #include <plat/cpu.h>
> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>
>  	pr_debug("clock: %s: disabling in hardware\n", clk->name);
>
> +	trace_clock_disable(clk->name, 0, smp_processor_id());
>  	clk->ops->disable(clk);
>
>  	if (clk->clkdm)
> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>  		}
>  	}
>
> +	trace_clock_enable(clk->name, 1, smp_processor_id());
>  	ret = clk->ops->enable(clk);
>  	if (ret) {
>  		WARN(1, "clock: %s: could not enable: %d\n", clk->name,
> ret);
> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk,
> unsigned long rate)
>  	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk-
> >name, rate);
>
>  	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
> -	if (clk->set_rate)
> +	if (clk->set_rate) {
> +		trace_clock_set_rate(clk->name, rate,
> smp_processor_id());
>  		ret = clk->set_rate(clk, rate);
> +	}
>
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
> omap2/pm34xx.c
> index 2f864e4..d1cc3f4 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -29,6 +29,7 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/console.h>
> +#include <trace/events/power.h>
>
>  #include <plat/sram.h>
>  #include "clockdomain.h"
> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>  	if (omap_irq_pending() || need_resched())
>  		goto out;
>
> +	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> +	trace_cpu_idle(1, smp_processor_id());
> +
>  	omap_sram_idle();
>
> +	trace_power_end(smp_processor_id());
> +	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
> +
>  out:
>  	local_fiq_enable();
>  	local_irq_enable();
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-
> omap2/powerdomain.c
> index eaed0df..1495eed 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -32,6 +35,8 @@
>
>  #include "pm.h"
>
> +#define PWRDM_TRACE_STATES_FLAG	(1<<31)
> +
>  enum {
>  	PWRDM_STATE_NOW = 0,
>  	PWRDM_STATE_PREV,
> @@ -130,8 +135,7 @@ static void
> _update_logic_membank_counters(struct powerdomain *pwrdm)
>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  {
>
> -	int prev;
> -	int state;
> +	int prev, state, trace_state = 0;
>
>  	if (pwrdm == NULL)
>  		return -EINVAL;
> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct
> powerdomain *pwrdm, int flag)
>  			pwrdm->state_counter[prev]++;
>  		if (prev == PWRDM_POWER_RET)
>  			_update_logic_membank_counters(pwrdm);
> +		/*
> +		 * If the power domain did not hit the desired state,
> +		 * generate a trace event with both the desired and hit
> states
> +		 */
> +		if (state != prev) {
> +			trace_state = (PWRDM_TRACE_STATES_FLAG |
> +				       ((state & OMAP_POWERSTATE_MASK) <<
8)
> |
> +				       ((prev & OMAP_POWERSTATE_MASK) <<
> 0));
> +			trace_power_domain_target(pwrdm->name,
> trace_state,
> +						  smp_processor_id());
> +		}
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain
> *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to
> %0x\n",
>  		 pwrdm->name, pwrst);
>
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		/* Trace the pwrdm desired target state */
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
> +		/* Program the pwrdm desired target state */
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>
>  	return ret;
>  }
> --
> 1.7.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-02-18 18:21   ` Santosh Shilimkar
  0 siblings, 0 replies; 36+ messages in thread
From: Santosh Shilimkar @ 2011-02-18 18:21 UTC (permalink / raw)
  To: linux-arm-kernel

Jean,
> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-
> owner at vger.kernel.org] On Behalf Of jean.pihet at newoldbits.com
> Sent: Friday, February 18, 2011 11:41 PM
> To: Kevin Hilman; Thomas Renninger; linux-omap at vger.kernel.org;
> linux-arm-kernel at lists.infradead.org
> Cc: Jean Pihet
> Subject: [PATCH] perf: add OMAP support for the new power events
>
> From: Jean Pihet <j-pihet@ti.com>
>
> The patch adds the new power management trace points for
> the OMAP architecture.
>
> The trace points are for:
> - default idle handler. Since the cpuidle framework is
>   instrumented in the generic way there is no need to
>   add trace points in the OMAP specific cpuidle handler;
> - cpufreq (DVFS),
> - SoC clocks changes (enable, disable, set_rate),
> - power domain states: the desired target state and -if different-
>   the actually hit state.
>
> Because of the generic nature of the changes, OMAP3 and OMAP4 are
> supported.
>
> Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.
>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>

Thanks for additional power domain trace point as per
discussion.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

> ---
>  arch/arm/mach-omap2/clock.c       |    8 +++++++-
>  arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
>  arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
>  3 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-
> omap2/clock.c
> index 2a2f152..72af75d 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -22,7 +22,9 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  #include <linux/bitops.h>
> +#include <trace/events/power.h>
>
> +#include <asm/cpu.h>
>  #include <plat/clock.h>
>  #include "clockdomain.h"
>  #include <plat/cpu.h>
> @@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
>
>  	pr_debug("clock: %s: disabling in hardware\n", clk->name);
>
> +	trace_clock_disable(clk->name, 0, smp_processor_id());
>  	clk->ops->disable(clk);
>
>  	if (clk->clkdm)
> @@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
>  		}
>  	}
>
> +	trace_clock_enable(clk->name, 1, smp_processor_id());
>  	ret = clk->ops->enable(clk);
>  	if (ret) {
>  		WARN(1, "clock: %s: could not enable: %d\n", clk->name,
> ret);
> @@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk,
> unsigned long rate)
>  	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk-
> >name, rate);
>
>  	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
> -	if (clk->set_rate)
> +	if (clk->set_rate) {
> +		trace_clock_set_rate(clk->name, rate,
> smp_processor_id());
>  		ret = clk->set_rate(clk, rate);
> +	}
>
>  	return ret;
>  }
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-
> omap2/pm34xx.c
> index 2f864e4..d1cc3f4 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -29,6 +29,7 @@
>  #include <linux/delay.h>
>  #include <linux/slab.h>
>  #include <linux/console.h>
> +#include <trace/events/power.h>
>
>  #include <plat/sram.h>
>  #include "clockdomain.h"
> @@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
>  	if (omap_irq_pending() || need_resched())
>  		goto out;
>
> +	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
> +	trace_cpu_idle(1, smp_processor_id());
> +
>  	omap_sram_idle();
>
> +	trace_power_end(smp_processor_id());
> +	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
> +
>  out:
>  	local_fiq_enable();
>  	local_irq_enable();
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-
> omap2/powerdomain.c
> index eaed0df..1495eed 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -19,12 +19,15 @@
>  #include <linux/list.h>
>  #include <linux/errno.h>
>  #include <linux/string.h>
> +#include <trace/events/power.h>
> +
>  #include "cm2xxx_3xxx.h"
>  #include "prcm44xx.h"
>  #include "cm44xx.h"
>  #include "prm2xxx_3xxx.h"
>  #include "prm44xx.h"
>
> +#include <asm/cpu.h>
>  #include <plat/cpu.h>
>  #include "powerdomain.h"
>  #include "clockdomain.h"
> @@ -32,6 +35,8 @@
>
>  #include "pm.h"
>
> +#define PWRDM_TRACE_STATES_FLAG	(1<<31)
> +
>  enum {
>  	PWRDM_STATE_NOW = 0,
>  	PWRDM_STATE_PREV,
> @@ -130,8 +135,7 @@ static void
> _update_logic_membank_counters(struct powerdomain *pwrdm)
>  static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  {
>
> -	int prev;
> -	int state;
> +	int prev, state, trace_state = 0;
>
>  	if (pwrdm == NULL)
>  		return -EINVAL;
> @@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct
> powerdomain *pwrdm, int flag)
>  			pwrdm->state_counter[prev]++;
>  		if (prev == PWRDM_POWER_RET)
>  			_update_logic_membank_counters(pwrdm);
> +		/*
> +		 * If the power domain did not hit the desired state,
> +		 * generate a trace event with both the desired and hit
> states
> +		 */
> +		if (state != prev) {
> +			trace_state = (PWRDM_TRACE_STATES_FLAG |
> +				       ((state & OMAP_POWERSTATE_MASK) <<
8)
> |
> +				       ((prev & OMAP_POWERSTATE_MASK) <<
> 0));
> +			trace_power_domain_target(pwrdm->name,
> trace_state,
> +						  smp_processor_id());
> +		}
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain
> *pwrdm, u8 pwrst)
>  	pr_debug("powerdomain: setting next powerstate for %s to
> %0x\n",
>  		 pwrdm->name, pwrst);
>
> -	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
> +	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
> +		/* Trace the pwrdm desired target state */
> +		trace_power_domain_target(pwrdm->name, pwrst,
> +					  smp_processor_id());
> +		/* Program the pwrdm desired target state */
>  		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
> +	}
>
>  	return ret;
>  }
> --
> 1.7.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-02-18 18:10 ` jean.pihet at newoldbits.com
  0 siblings, 0 replies; 36+ messages in thread
From: jean.pihet @ 2011-02-18 18:10 UTC (permalink / raw)
  To: Kevin Hilman, Thomas Renninger, linux-omap, linux-arm-kernel; +Cc: Jean Pihet

From: Jean Pihet <j-pihet@ti.com>

The patch adds the new power management trace points for
the OMAP architecture.

The trace points are for:
- default idle handler. Since the cpuidle framework is
  instrumented in the generic way there is no need to
  add trace points in the OMAP specific cpuidle handler;
- cpufreq (DVFS),
- SoC clocks changes (enable, disable, set_rate),
- power domain states: the desired target state and -if different-
  the actually hit state.

Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.

Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 arch/arm/mach-omap2/clock.c       |    8 +++++++-
 arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
 arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 2a2f152..72af75d 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -22,7 +22,9 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/bitops.h>
+#include <trace/events/power.h>
 
+#include <asm/cpu.h>
 #include <plat/clock.h>
 #include "clockdomain.h"
 #include <plat/cpu.h>
@@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
 
 	pr_debug("clock: %s: disabling in hardware\n", clk->name);
 
+	trace_clock_disable(clk->name, 0, smp_processor_id());
 	clk->ops->disable(clk);
 
 	if (clk->clkdm)
@@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
 		}
 	}
 
+	trace_clock_enable(clk->name, 1, smp_processor_id());
 	ret = clk->ops->enable(clk);
 	if (ret) {
 		WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
@@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
 	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
 
 	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
-	if (clk->set_rate)
+	if (clk->set_rate) {
+		trace_clock_set_rate(clk->name, rate, smp_processor_id());
 		ret = clk->set_rate(clk, rate);
+	}
 
 	return ret;
 }
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 2f864e4..d1cc3f4 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -29,6 +29,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/console.h>
+#include <trace/events/power.h>
 
 #include <plat/sram.h>
 #include "clockdomain.h"
@@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
 	if (omap_irq_pending() || need_resched())
 		goto out;
 
+	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
+	trace_cpu_idle(1, smp_processor_id());
+
 	omap_sram_idle();
 
+	trace_power_end(smp_processor_id());
+	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
+
 out:
 	local_fiq_enable();
 	local_irq_enable();
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index eaed0df..1495eed 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -19,12 +19,15 @@
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include <trace/events/power.h>
+
 #include "cm2xxx_3xxx.h"
 #include "prcm44xx.h"
 #include "cm44xx.h"
 #include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
+#include <asm/cpu.h>
 #include <plat/cpu.h>
 #include "powerdomain.h"
 #include "clockdomain.h"
@@ -32,6 +35,8 @@
 
 #include "pm.h"
 
+#define PWRDM_TRACE_STATES_FLAG	(1<<31)
+
 enum {
 	PWRDM_STATE_NOW = 0,
 	PWRDM_STATE_PREV,
@@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
 static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 {
 
-	int prev;
-	int state;
+	int prev, state, trace_state = 0;
 
 	if (pwrdm == NULL)
 		return -EINVAL;
@@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 			pwrdm->state_counter[prev]++;
 		if (prev == PWRDM_POWER_RET)
 			_update_logic_membank_counters(pwrdm);
+		/*
+		 * If the power domain did not hit the desired state,
+		 * generate a trace event with both the desired and hit states
+		 */
+		if (state != prev) {
+			trace_state = (PWRDM_TRACE_STATES_FLAG |
+				       ((state & OMAP_POWERSTATE_MASK) << 8) |
+				       ((prev & OMAP_POWERSTATE_MASK) << 0));
+			trace_power_domain_target(pwrdm->name, trace_state,
+						  smp_processor_id());
+		}
 		break;
 	default:
 		return -EINVAL;
@@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
 		 pwrdm->name, pwrst);
 
-	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
+	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
+		/* Trace the pwrdm desired target state */
+		trace_power_domain_target(pwrdm->name, pwrst,
+					  smp_processor_id());
+		/* Program the pwrdm desired target state */
 		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
+	}
 
 	return ret;
 }
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH] perf: add OMAP support for the new power events
@ 2011-02-18 18:10 ` jean.pihet at newoldbits.com
  0 siblings, 0 replies; 36+ messages in thread
From: jean.pihet at newoldbits.com @ 2011-02-18 18:10 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jean Pihet <j-pihet@ti.com>

The patch adds the new power management trace points for
the OMAP architecture.

The trace points are for:
- default idle handler. Since the cpuidle framework is
  instrumented in the generic way there is no need to
  add trace points in the OMAP specific cpuidle handler;
- cpufreq (DVFS),
- SoC clocks changes (enable, disable, set_rate),
- power domain states: the desired target state and -if different-
  the actually hit state.

Because of the generic nature of the changes, OMAP3 and OMAP4 are supported.

Tested on OMAP3 with suspend/resume, cpuidle, basic DVFS.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 arch/arm/mach-omap2/clock.c       |    8 +++++++-
 arch/arm/mach-omap2/pm34xx.c      |    7 +++++++
 arch/arm/mach-omap2/powerdomain.c |   26 +++++++++++++++++++++++---
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 2a2f152..72af75d 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -22,7 +22,9 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/bitops.h>
+#include <trace/events/power.h>
 
+#include <asm/cpu.h>
 #include <plat/clock.h>
 #include "clockdomain.h"
 #include <plat/cpu.h>
@@ -261,6 +263,7 @@ void omap2_clk_disable(struct clk *clk)
 
 	pr_debug("clock: %s: disabling in hardware\n", clk->name);
 
+	trace_clock_disable(clk->name, 0, smp_processor_id());
 	clk->ops->disable(clk);
 
 	if (clk->clkdm)
@@ -312,6 +315,7 @@ int omap2_clk_enable(struct clk *clk)
 		}
 	}
 
+	trace_clock_enable(clk->name, 1, smp_processor_id());
 	ret = clk->ops->enable(clk);
 	if (ret) {
 		WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
@@ -349,8 +353,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
 	pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
 
 	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
-	if (clk->set_rate)
+	if (clk->set_rate) {
+		trace_clock_set_rate(clk->name, rate, smp_processor_id());
 		ret = clk->set_rate(clk, rate);
+	}
 
 	return ret;
 }
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 2f864e4..d1cc3f4 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -29,6 +29,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/console.h>
+#include <trace/events/power.h>
 
 #include <plat/sram.h>
 #include "clockdomain.h"
@@ -519,8 +520,14 @@ static void omap3_pm_idle(void)
 	if (omap_irq_pending() || need_resched())
 		goto out;
 
+	trace_power_start(POWER_CSTATE, 1, smp_processor_id());
+	trace_cpu_idle(1, smp_processor_id());
+
 	omap_sram_idle();
 
+	trace_power_end(smp_processor_id());
+	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
+
 out:
 	local_fiq_enable();
 	local_irq_enable();
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index eaed0df..1495eed 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -19,12 +19,15 @@
 #include <linux/list.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include <trace/events/power.h>
+
 #include "cm2xxx_3xxx.h"
 #include "prcm44xx.h"
 #include "cm44xx.h"
 #include "prm2xxx_3xxx.h"
 #include "prm44xx.h"
 
+#include <asm/cpu.h>
 #include <plat/cpu.h>
 #include "powerdomain.h"
 #include "clockdomain.h"
@@ -32,6 +35,8 @@
 
 #include "pm.h"
 
+#define PWRDM_TRACE_STATES_FLAG	(1<<31)
+
 enum {
 	PWRDM_STATE_NOW = 0,
 	PWRDM_STATE_PREV,
@@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
 static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 {
 
-	int prev;
-	int state;
+	int prev, state, trace_state = 0;
 
 	if (pwrdm == NULL)
 		return -EINVAL;
@@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
 			pwrdm->state_counter[prev]++;
 		if (prev == PWRDM_POWER_RET)
 			_update_logic_membank_counters(pwrdm);
+		/*
+		 * If the power domain did not hit the desired state,
+		 * generate a trace event with both the desired and hit states
+		 */
+		if (state != prev) {
+			trace_state = (PWRDM_TRACE_STATES_FLAG |
+				       ((state & OMAP_POWERSTATE_MASK) << 8) |
+				       ((prev & OMAP_POWERSTATE_MASK) << 0));
+			trace_power_domain_target(pwrdm->name, trace_state,
+						  smp_processor_id());
+		}
 		break;
 	default:
 		return -EINVAL;
@@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 	pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
 		 pwrdm->name, pwrst);
 
-	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
+	if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
+		/* Trace the pwrdm desired target state */
+		trace_power_domain_target(pwrdm->name, pwrst,
+					  smp_processor_id());
+		/* Program the pwrdm desired target state */
 		ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
+	}
 
 	return ret;
 }
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2011-03-10 18:15 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 14:20 [PATCH] perf: add OMAP support for the new power events jean.pihet
2011-01-24 14:55 ` Santosh Shilimkar
2011-01-26  9:49   ` Jean Pihet
2011-01-26 10:06     ` Santosh Shilimkar
2011-02-07 16:05       ` Jean Pihet
2011-02-07 16:12         ` Santosh Shilimkar
2011-02-11 14:38           ` Are there CPU sleep residency HW counters in OMAP? Was: " Thomas Renninger
2011-02-11 15:07             ` Santosh Shilimkar
2011-02-10 21:02 ` Kevin Hilman
2011-02-18 18:14   ` Jean Pihet
2011-02-18 18:10 jean.pihet
2011-02-18 18:10 ` jean.pihet at newoldbits.com
2011-02-18 18:21 ` Santosh Shilimkar
2011-02-18 18:21   ` Santosh Shilimkar
2011-02-19 18:55 ` Santosh Shilimkar
2011-02-19 18:55   ` Santosh Shilimkar
2011-02-21  8:44   ` Jean Pihet
2011-02-21  8:44     ` Jean Pihet
2011-02-21  8:53     ` Santosh Shilimkar
2011-02-21  8:53       ` Santosh Shilimkar
2011-02-28 16:33       ` Jean Pihet
2011-02-28 16:33         ` Jean Pihet
2011-03-03  0:43 ` Kevin Hilman
2011-03-03  0:43   ` Kevin Hilman
2011-03-03 10:25 ` Jean Pihet
2011-03-03 10:25   ` Jean Pihet
2011-03-10  0:08   ` Kevin Hilman
2011-03-10  0:08     ` Kevin Hilman
2011-03-10  8:09     ` Jean Pihet
2011-03-10  8:09       ` Jean Pihet
2011-03-10 18:15       ` Kevin Hilman
2011-03-10 18:15         ` Kevin Hilman
2011-03-10  1:04   ` Paul Walmsley
2011-03-10  1:04     ` Paul Walmsley
2011-03-10  8:17     ` Jean Pihet
2011-03-10  8:17       ` Jean Pihet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.