diff mbox

[1/3] trace points: power: remove 'cpu_id' from trace_clock_*

Message ID 1313766244-22313-1-git-send-email-tom.leiming@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ming Lei Aug. 19, 2011, 3:04 p.m. UTC
From: Ming Lei <tom.leiming@gmail.com>

This patch removes the 'cpu_id' parameter of the clock_*
trace point, based on the ideas below:

- the cpu_id which is passed to trace point is always the current
  cpu
- the current cpu info has been included into the trace result already
- smp_processor_id() can't be used safely in preemptible context.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 Documentation/trace/events-power.txt |    6 +++---
 arch/arm/mach-omap2/clock.c          |    6 +++---
 include/trace/events/power.h         |   22 ++++++++++------------
 3 files changed, 16 insertions(+), 18 deletions(-)

Comments

Steven Rostedt Aug. 19, 2011, 3:14 p.m. UTC | #1
On Fri, 2011-08-19 at 23:04 +0800, tom.leiming@gmail.com wrote:
> From: Ming Lei <tom.leiming@gmail.com>
> 
> This patch removes the 'cpu_id' parameter of the clock_*
> trace point, based on the ideas below:
> 
> - the cpu_id which is passed to trace point is always the current
>   cpu
> - the current cpu info has been included into the trace result already
> - smp_processor_id() can't be used safely in preemptible context.
> 

Do you know if these changes wont break powertop?

-- Steve


--
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
Ming Lei Aug. 19, 2011, 3:39 p.m. UTC | #2
Hi,

On Fri, Aug 19, 2011 at 11:14 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> Do you know if these changes wont break powertop?

I have run powertop 1.13 on these changes, and found it works well
just like before,
no breaks found.

thanks,
Arjan van de Ven Aug. 19, 2011, 4:16 p.m. UTC | #3
On 8/19/2011 8:39 AM, Ming Lei wrote:
> Hi,
>
> On Fri, Aug 19, 2011 at 11:14 PM, Steven Rostedt<rostedt@goodmis.org>  wrote:
>> Do you know if these changes wont break powertop?
> I have run powertop 1.13 on these changes, and found it works well
> just like before,
> no breaks found.
please use powertop 1.98 instead
1.13 does not use trace events while 1.98 does

>
> thanks,

--
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
Ming Lei Aug. 20, 2011, 2:44 a.m. UTC | #4
On Sat, Aug 20, 2011 at 12:16 AM, Arjan van de Ven
<arjan@linux.intel.com> wrote:
> On 8/19/2011 8:39 AM, Ming Lei wrote:
>>
>> Hi,
>>
>> On Fri, Aug 19, 2011 at 11:14 PM, Steven Rostedt<rostedt@goodmis.org>
>>  wrote:
>>>
>>> Do you know if these changes wont break powertop?
>>
>> I have run powertop 1.13 on these changes, and found it works well
>> just like before,
>> no breaks found.
>
> please use powertop 1.98 instead
> 1.13 does not use trace events while 1.98 does

From the link below:

       http://www.lesswatts.org/projects/powertop/download.php

It mentions that "Version 1.13 is the latest version of PowerTOP", also
no any information about 1.98. so where can I get 1.98?

thanks,
Arjan van de Ven Aug. 20, 2011, 3:59 p.m. UTC | #5
It mentions that "Version 1.13 is the latest version of PowerTOP", also 
no any information about 1.98. so where can I get 1.98? thanks,

http://www.kernel.org/pub/linux/status/powertop

--
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
diff mbox

Patch

diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt
index 96d87b6..3726ba5 100644
--- a/Documentation/trace/events-power.txt
+++ b/Documentation/trace/events-power.txt
@@ -71,9 +71,9 @@  power_start event.
 The clock events are used for clock enable/disable and for
 clock rate change.
 
-clock_enable		"%s state=%lu cpu_id=%lu"
-clock_disable		"%s state=%lu cpu_id=%lu"
-clock_set_rate		"%s state=%lu cpu_id=%lu"
+clock_enable		"%s state=%lu"
+clock_disable		"%s state=%lu"
+clock_set_rate		"%s state=%lu"
 
 The first parameter gives the clock name (e.g. "gpio1_iclk").
 The second parameter is '1' for enable, '0' for disable, the target
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 1f3481f..05111b1 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -285,7 +285,7 @@  void omap2_clk_disable(struct clk *clk)
 	pr_debug("clock: %s: disabling in hardware\n", clk->name);
 
 	if (clk->ops && clk->ops->disable) {
-		trace_clock_disable(clk->name, 0, smp_processor_id());
+		trace_clock_disable(clk->name, 0);
 		clk->ops->disable(clk);
 	}
 
@@ -339,7 +339,7 @@  int omap2_clk_enable(struct clk *clk)
 	}
 
 	if (clk->ops && clk->ops->enable) {
-		trace_clock_enable(clk->name, 1, smp_processor_id());
+		trace_clock_enable(clk->name, 1);
 		ret = clk->ops->enable(clk);
 		if (ret) {
 			WARN(1, "clock: %s: could not enable: %d\n",
@@ -380,7 +380,7 @@  int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
 
 	/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
 	if (clk->set_rate) {
-		trace_clock_set_rate(clk->name, rate, smp_processor_id());
+		trace_clock_set_rate(clk->name, rate);
 		ret = clk->set_rate(clk, rate);
 	}
 
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 1bcc2a8..e315e68 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -162,45 +162,43 @@  static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {};
  */
 DECLARE_EVENT_CLASS(clock,
 
-	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
+	TP_PROTO(const char *name, unsigned int state),
 
-	TP_ARGS(name, state, cpu_id),
+	TP_ARGS(name, state),
 
 	TP_STRUCT__entry(
 		__string(       name,           name            )
 		__field(        u64,            state           )
-		__field(        u64,            cpu_id          )
 	),
 
 	TP_fast_assign(
 		__assign_str(name, name);
 		__entry->state = state;
-		__entry->cpu_id = cpu_id;
 	),
 
-	TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
-		(unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
+	TP_printk("%s state=%lu", __get_str(name),
+		(unsigned long)__entry->state)
 );
 
 DEFINE_EVENT(clock, clock_enable,
 
-	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
+	TP_PROTO(const char *name, unsigned int state),
 
-	TP_ARGS(name, state, cpu_id)
+	TP_ARGS(name, state)
 );
 
 DEFINE_EVENT(clock, clock_disable,
 
-	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
+	TP_PROTO(const char *name, unsigned int state),
 
-	TP_ARGS(name, state, cpu_id)
+	TP_ARGS(name, state)
 );
 
 DEFINE_EVENT(clock, clock_set_rate,
 
-	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
+	TP_PROTO(const char *name, unsigned int state),
 
-	TP_ARGS(name, state, cpu_id)
+	TP_ARGS(name, state)
 );
 
 /*