The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] trace: power: add trace_clock_set_parent
@ 2012-05-09 23:21 Colin Cross
  2012-05-09 23:50 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Colin Cross @ 2012-05-09 23:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Colin Cross, Steven Rostedt, Frederic Weisbecker, Ingo Molnar,
	Jesper Juhl, Jiri Kosina, Paul E. McKenney, Josh Triplett

Adds a new trace event to be called from clk_set_parent.  Some
cpufreq drivers, including Tegra, reparent the cpu clock to a
slower clock while the main pll is relocking, tracing
clk_set_parent allows traces to show how for long the cpu is
running slower.

Uses a separate TRACE_EVENT instead of the clock event class to
allow the event to contain string names for the child and the
parent.

Signed-off-by: Colin Cross <ccross@android.com>
---
 include/trace/events/power.h |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index cae9a94..2b81df6 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -204,6 +204,25 @@ enum {
 	TP_ARGS(name, state, cpu_id)
 );
 
+TRACE_EVENT(clock_set_parent,
+
+	TP_PROTO(const char *name, const char *parent_name),
+
+	TP_ARGS(name, parent_name),
+
+	TP_STRUCT__entry(
+		__string(       name,           name            )
+		__string(       parent_name,    parent_name     )
+	),
+
+	TP_fast_assign(
+		__assign_str(name, name);
+		__assign_str(name, parent_name);
+	),
+
+	TP_printk("%s parent=%s", __get_str(name), __get_str(parent_name))
+);
+
 /*
  * The power domain events are used for power domains transitions
  */
-- 
1.7.7.3


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

* Re: [PATCH] trace: power: add trace_clock_set_parent
  2012-05-09 23:21 [PATCH] trace: power: add trace_clock_set_parent Colin Cross
@ 2012-05-09 23:50 ` Steven Rostedt
  2012-05-09 23:53   ` Colin Cross
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2012-05-09 23:50 UTC (permalink / raw)
  To: Colin Cross
  Cc: linux-kernel, Frederic Weisbecker, Ingo Molnar, Jesper Juhl,
	Jiri Kosina, Paul E. McKenney, Josh Triplett

On Wed, 2012-05-09 at 16:21 -0700, Colin Cross wrote:
> Adds a new trace event to be called from clk_set_parent.  Some
> cpufreq drivers, including Tegra, reparent the cpu clock to a
> slower clock while the main pll is relocking, tracing
> clk_set_parent allows traces to show how for long the cpu is
> running slower.
> 
> Uses a separate TRACE_EVENT instead of the clock event class to
> allow the event to contain string names for the child and the
> parent.
> 
> Signed-off-by: Colin Cross <ccross@android.com>
> ---
>  include/trace/events/power.h |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/include/trace/events/power.h b/include/trace/events/power.h
> index cae9a94..2b81df6 100644
> --- a/include/trace/events/power.h
> +++ b/include/trace/events/power.h
> @@ -204,6 +204,25 @@ enum {
>  	TP_ARGS(name, state, cpu_id)
>  );
>  
> +TRACE_EVENT(clock_set_parent,
> +
> +	TP_PROTO(const char *name, const char *parent_name),
> +
> +	TP_ARGS(name, parent_name),
> +
> +	TP_STRUCT__entry(
> +		__string(       name,           name            )
> +		__string(       parent_name,    parent_name     )
> +	),
> +
> +	TP_fast_assign(
> +		__assign_str(name, name);
> +		__assign_str(name, parent_name);

Don't you mean: __assign_str(parent_name, parent_name); ?

-- Steve

> +	),
> +
> +	TP_printk("%s parent=%s", __get_str(name), __get_str(parent_name))
> +);
> +
>  /*
>   * The power domain events are used for power domains transitions
>   */



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

* Re: [PATCH] trace: power: add trace_clock_set_parent
  2012-05-09 23:50 ` Steven Rostedt
@ 2012-05-09 23:53   ` Colin Cross
  0 siblings, 0 replies; 3+ messages in thread
From: Colin Cross @ 2012-05-09 23:53 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-kernel, Frederic Weisbecker, Ingo Molnar, Jesper Juhl,
	Jiri Kosina, Paul E. McKenney, Josh Triplett

On Wed, May 9, 2012 at 4:50 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Wed, 2012-05-09 at 16:21 -0700, Colin Cross wrote:
>> Adds a new trace event to be called from clk_set_parent.  Some
>> cpufreq drivers, including Tegra, reparent the cpu clock to a
>> slower clock while the main pll is relocking, tracing
>> clk_set_parent allows traces to show how for long the cpu is
>> running slower.
>>
>> Uses a separate TRACE_EVENT instead of the clock event class to
>> allow the event to contain string names for the child and the
>> parent.
>>
>> Signed-off-by: Colin Cross <ccross@android.com>
>> ---
>>  include/trace/events/power.h |   19 +++++++++++++++++++
>>  1 files changed, 19 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/trace/events/power.h b/include/trace/events/power.h
>> index cae9a94..2b81df6 100644
>> --- a/include/trace/events/power.h
>> +++ b/include/trace/events/power.h
>> @@ -204,6 +204,25 @@ enum {
>>       TP_ARGS(name, state, cpu_id)
>>  );
>>
>> +TRACE_EVENT(clock_set_parent,
>> +
>> +     TP_PROTO(const char *name, const char *parent_name),
>> +
>> +     TP_ARGS(name, parent_name),
>> +
>> +     TP_STRUCT__entry(
>> +             __string(       name,           name            )
>> +             __string(       parent_name,    parent_name     )
>> +     ),
>> +
>> +     TP_fast_assign(
>> +             __assign_str(name, name);
>> +             __assign_str(name, parent_name);
>
> Don't you mean: __assign_str(parent_name, parent_name); ?

Yep, just noticed that in my traces, I'll send an updated patch.

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

end of thread, other threads:[~2012-05-09 23:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09 23:21 [PATCH] trace: power: add trace_clock_set_parent Colin Cross
2012-05-09 23:50 ` Steven Rostedt
2012-05-09 23:53   ` Colin Cross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox