linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] tools, perf: new power trace API
@ 2011-01-05 18:49 jean.pihet
  2011-01-05 18:49 ` [PATCH 1/2] perf: add calls to suspend trace point jean.pihet
  2011-01-05 18:49 ` [PATCH 2/2] tools, perf: Documentation for the power events API jean.pihet
  0 siblings, 2 replies; 5+ messages in thread
From: jean.pihet @ 2011-01-05 18:49 UTC (permalink / raw)
  To: mingo, trenn, Len Brown, Pavel Machek, Rafael J. Wysocki,
	linux-pm, linux-kernel
  Cc: linux-omap, Arjan van de Ven, linux-perf-users, Jean Pihet

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

Provides:
. calls to machine_suspend trace point,
. API Documentation

The OMAP specific changes will be submitted separately on
the linux-omap ML because:
- the OMAP changes need to be rebased on the latest linux-omap 2.6.37 tree,
- more feedback is needed from the linux-omap folks.

Jean Pihet (2):
  perf: add calls to suspend trace point
  tools, perf: Documentation for the power events API

 Documentation/trace/events-power.txt |   90 ++++++++++++++++++++++++++++++++++
 kernel/power/suspend.c               |    3 +
 2 files changed, 93 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/trace/events-power.txt

-- 
1.7.2.3

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

* [PATCH 1/2] perf: add calls to suspend trace point
  2011-01-05 18:49 [PATCH 0/2] tools, perf: new power trace API jean.pihet
@ 2011-01-05 18:49 ` jean.pihet
  2011-01-05 18:49 ` [PATCH 2/2] tools, perf: Documentation for the power events API jean.pihet
  1 sibling, 0 replies; 5+ messages in thread
From: jean.pihet @ 2011-01-05 18:49 UTC (permalink / raw)
  To: mingo, trenn, Len Brown, Pavel Machek, Rafael J. Wysocki,
	linux-pm, linux-kernel
  Cc: linux-omap, Arjan van de Ven, linux-perf-users, Jean Pihet

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

Uses the machine_suspend trace point, called from the
generic kernel suspend_devices_and_enter function.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
CC: Thomas Renninger <trenn@suse.de>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 kernel/power/suspend.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index ecf7705..031d5e3 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -22,6 +22,7 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/suspend.h>
+#include <trace/events/power.h>
 
 #include "power.h"
 
@@ -201,6 +202,7 @@ int suspend_devices_and_enter(suspend_state_t state)
 	if (!suspend_ops)
 		return -ENOSYS;
 
+	trace_machine_suspend(state);
 	if (suspend_ops->begin) {
 		error = suspend_ops->begin(state);
 		if (error)
@@ -229,6 +231,7 @@ int suspend_devices_and_enter(suspend_state_t state)
  Close:
 	if (suspend_ops->end)
 		suspend_ops->end();
+	trace_machine_suspend(PWR_EVENT_EXIT);
 	return error;
 
  Recover_platform:
-- 
1.7.2.3

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

* [PATCH 2/2] tools, perf: Documentation for the power events API
  2011-01-05 18:49 [PATCH 0/2] tools, perf: new power trace API jean.pihet
  2011-01-05 18:49 ` [PATCH 1/2] perf: add calls to suspend trace point jean.pihet
@ 2011-01-05 18:49 ` jean.pihet
  2011-01-07  5:50   ` Eduardo Valentin
  1 sibling, 1 reply; 5+ messages in thread
From: jean.pihet @ 2011-01-05 18:49 UTC (permalink / raw)
  To: mingo, trenn, Len Brown, Pavel Machek, Rafael J. Wysocki,
	linux-pm, linux-kernel
  Cc: linux-omap, Arjan van de Ven, linux-perf-users, Jean Pihet

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

Provides documentation for the following:
- the new power trace API,
- the old (legacy) power trace API,
- the DEPRECATED Kconfig option usage.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 Documentation/trace/events-power.txt |   90 ++++++++++++++++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/trace/events-power.txt

diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt
new file mode 100644
index 0000000..96d87b6
--- /dev/null
+++ b/Documentation/trace/events-power.txt
@@ -0,0 +1,90 @@
+
+			Subsystem Trace Points: power
+
+The power tracing system captures events related to power transitions
+within the kernel. Broadly speaking there are three major subheadings:
+
+  o Power state switch which reports events related to suspend (S-states),
+     cpuidle (C-states) and cpufreq (P-states)
+  o System clock related changes
+  o Power domains related changes and transitions
+
+This document describes what each of the tracepoints is and why they
+might be useful.
+
+Cf. include/trace/events/power.h for the events definitions.
+
+1. Power state switch events
+============================
+
+1.1 New trace API
+-----------------
+
+A 'cpu' event class gathers the CPU-related events: cpuidle and
+cpufreq.
+
+cpu_idle		"state=%lu cpu_id=%lu"
+cpu_frequency		"state=%lu cpu_id=%lu"
+
+A suspend event is used to indicate the system going in and out of the
+suspend mode:
+
+machine_suspend		"state=%lu"
+
+
+Note: the value of '-1' or '4294967295' for state means an exit from the current state,
+i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
+enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
+means that the system exits the previous idle state.
+
+The event which has 'state=4294967295' in the trace is very important to the user
+space tools which are using it to detect the end of the current state, and so to
+correctly draw the states diagrams and to calculate accurate statistics etc.
+
+1.2 DEPRECATED trace API
+------------------------
+
+A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of
+'y' has been created. This allows the legacy trace power API to be used conjointly
+with the new trace API.
+The Kconfig option, the old trace API (in include/trace/events/power.h) and the
+old trace points will disappear in a future release (namely 2.6.41).
+
+power_start		"type=%lu state=%lu cpu_id=%lu"
+power_frequency		"type=%lu state=%lu cpu_id=%lu"
+power_end		"cpu_id=%lu"
+
+The 'type' parameter takes one of those macros:
+ . POWER_NONE	= 0,
+ . POWER_CSTATE	= 1,	/* C-State */
+ . POWER_PSTATE	= 2,	/* Fequency change or DVFS */
+
+The 'state' parameter is set depending on the type:
+ . Target C-state for type=POWER_CSTATE,
+ . Target frequency for type=POWER_PSTATE,
+
+power_end is used to indicate the exit of a state, corresponding to the latest
+power_start event.
+
+2. Clocks events
+================
+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"
+
+The first parameter gives the clock name (e.g. "gpio1_iclk").
+The second parameter is '1' for enable, '0' for disable, the target
+clock rate for set_rate.
+
+3. Power domains events
+=======================
+The power domain events are used for power domains transitions
+
+power_domain_target	"%s state=%lu cpu_id=%lu"
+
+The first parameter gives the power domain name (e.g. "mpu_pwrdm").
+The second parameter is the power domain target state.
+
-- 
1.7.2.3

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

* Re: [PATCH 2/2] tools, perf: Documentation for the power events API
  2011-01-05 18:49 ` [PATCH 2/2] tools, perf: Documentation for the power events API jean.pihet
@ 2011-01-07  5:50   ` Eduardo Valentin
  2011-01-10 10:10     ` Jean Pihet
  0 siblings, 1 reply; 5+ messages in thread
From: Eduardo Valentin @ 2011-01-07  5:50 UTC (permalink / raw)
  To: ext jean.pihet@newoldbits.com
  Cc: mingo, trenn, Len Brown, Pavel Machek, Rafael J. Wysocki,
	linux-pm, linux-kernel, linux-omap, Arjan van de Ven,
	linux-perf-users, Jean Pihet

Hello Jean,

On Wed, Jan 05, 2011 at 07:49:02PM +0100, ext jean.pihet@newoldbits.com wrote:
> From: Jean Pihet <j-pihet@ti.com>
> 
> Provides documentation for the following:
> - the new power trace API,
> - the old (legacy) power trace API,
> - the DEPRECATED Kconfig option usage.
> 
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> ---
>  Documentation/trace/events-power.txt |   90 ++++++++++++++++++++++++++++++++++
>  1 files changed, 90 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/trace/events-power.txt
> 
> diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt
> new file mode 100644
> index 0000000..96d87b6
> --- /dev/null
> +++ b/Documentation/trace/events-power.txt
> @@ -0,0 +1,90 @@
> +
> +			Subsystem Trace Points: power
> +
> +The power tracing system captures events related to power transitions
> +within the kernel. Broadly speaking there are three major subheadings:
> +
> +  o Power state switch which reports events related to suspend (S-states),
> +     cpuidle (C-states) and cpufreq (P-states)
> +  o System clock related changes

What do you mean by system clock here? I see that you are covering cpu rate
changes and system clock (?) here. How about memory clock changes?
Would it make sense to have a major subheading for it? Maybe you are
targeting it be traced by means of clocks event (item 2. bellow)..

> +  o Power domains related changes and transitions
> +
> +This document describes what each of the tracepoints is and why they
> +might be useful.
> +
> +Cf. include/trace/events/power.h for the events definitions.
> +
> +1. Power state switch events
> +============================
> +
> +1.1 New trace API
> +-----------------
> +
> +A 'cpu' event class gathers the CPU-related events: cpuidle and
> +cpufreq.
> +
> +cpu_idle		"state=%lu cpu_id=%lu"
> +cpu_frequency		"state=%lu cpu_id=%lu"
> +
> +A suspend event is used to indicate the system going in and out of the
> +suspend mode:
> +
> +machine_suspend		"state=%lu"
> +
> +
> +Note: the value of '-1' or '4294967295' for state means an exit from the current state,
> +i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
> +enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
> +means that the system exits the previous idle state.
> +
> +The event which has 'state=4294967295' in the trace is very important to the user
> +space tools which are using it to detect the end of the current state, and so to
> +correctly draw the states diagrams and to calculate accurate statistics etc.
> +
> +1.2 DEPRECATED trace API
> +------------------------
> +
> +A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of
> +'y' has been created. This allows the legacy trace power API to be used conjointly
> +with the new trace API.
> +The Kconfig option, the old trace API (in include/trace/events/power.h) and the
> +old trace points will disappear in a future release (namely 2.6.41).
> +
> +power_start		"type=%lu state=%lu cpu_id=%lu"
> +power_frequency		"type=%lu state=%lu cpu_id=%lu"
> +power_end		"cpu_id=%lu"
> +
> +The 'type' parameter takes one of those macros:
> + . POWER_NONE	= 0,
> + . POWER_CSTATE	= 1,	/* C-State */
> + . POWER_PSTATE	= 2,	/* Fequency change or DVFS */
> +
> +The 'state' parameter is set depending on the type:
> + . Target C-state for type=POWER_CSTATE,
> + . Target frequency for type=POWER_PSTATE,
> +
> +power_end is used to indicate the exit of a state, corresponding to the latest
> +power_start event.
> +
> +2. Clocks events
> +================
> +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"
> +
> +The first parameter gives the clock name (e.g. "gpio1_iclk").
> +The second parameter is '1' for enable, '0' for disable, the target
> +clock rate for set_rate.
> +
> +3. Power domains events
> +=======================
> +The power domain events are used for power domains transitions
> +
> +power_domain_target	"%s state=%lu cpu_id=%lu"
> +
> +The first parameter gives the power domain name (e.g. "mpu_pwrdm").
> +The second parameter is the power domain target state.
> +
> -- 
> 1.7.2.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Eduardo Valentin

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

* Re: [PATCH 2/2] tools, perf: Documentation for the power events API
  2011-01-07  5:50   ` Eduardo Valentin
@ 2011-01-10 10:10     ` Jean Pihet
  0 siblings, 0 replies; 5+ messages in thread
From: Jean Pihet @ 2011-01-10 10:10 UTC (permalink / raw)
  To: eduardo.valentin
  Cc: mingo, trenn, Len Brown, Pavel Machek, Rafael J. Wysocki,
	linux-pm, linux-kernel, linux-omap, Arjan van de Ven,
	linux-perf-users, Jean Pihet

Hello Eduardo,

On Fri, Jan 7, 2011 at 6:50 AM, Eduardo Valentin
<eduardo.valentin@nokia.com> wrote:
> Hello Jean,
>
> On Wed, Jan 05, 2011 at 07:49:02PM +0100, ext jean.pihet@newoldbits.com wrote:
>> From: Jean Pihet <j-pihet@ti.com>
>>
>> Provides documentation for the following:
>> - the new power trace API,
>> - the old (legacy) power trace API,
>> - the DEPRECATED Kconfig option usage.
>>
>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
>> ---
>>  Documentation/trace/events-power.txt |   90 ++++++++++++++++++++++++++++++++++
>>  1 files changed, 90 insertions(+), 0 deletions(-)
>>  create mode 100644 Documentation/trace/events-power.txt
>>
>> diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt
>> new file mode 100644
>> index 0000000..96d87b6
>> --- /dev/null
>> +++ b/Documentation/trace/events-power.txt
>> @@ -0,0 +1,90 @@
>> +
>> +                     Subsystem Trace Points: power
>> +
>> +The power tracing system captures events related to power transitions
>> +within the kernel. Broadly speaking there are three major subheadings:
>> +
>> +  o Power state switch which reports events related to suspend (S-states),
>> +     cpuidle (C-states) and cpufreq (P-states)
>> +  o System clock related changes
>
> What do you mean by system clock here? I see that you are covering cpu rate
> changes and system clock (?) here. How about memory clock changes?
> Would it make sense to have a major subheading for it? Maybe you are
> targeting it be traced by means of clocks event (item 2. bellow)..
The meaning is to trace the system clocks changes, i.e. clocks that
the CPUs can control. Maybe 'SoC clocks' is a better name for it.
Indeed 'System clock related changes' is for '2. Clocks events'

Thanks for the review!

Regards,
Jean

>
>> +  o Power domains related changes and transitions
>> +
>> +This document describes what each of the tracepoints is and why they
>> +might be useful.
>> +
>> +Cf. include/trace/events/power.h for the events definitions.
>> +
>> +1. Power state switch events
>> +============================
>> +
>> +1.1 New trace API
>> +-----------------
>> +
>> +A 'cpu' event class gathers the CPU-related events: cpuidle and
>> +cpufreq.
>> +
>> +cpu_idle             "state=%lu cpu_id=%lu"
>> +cpu_frequency                "state=%lu cpu_id=%lu"
>> +
>> +A suspend event is used to indicate the system going in and out of the
>> +suspend mode:
>> +
>> +machine_suspend              "state=%lu"
>> +
>> +
>> +Note: the value of '-1' or '4294967295' for state means an exit from the current state,
>> +i.e. trace_cpu_idle(4, smp_processor_id()) means that the system
>> +enters the idle state 4, while trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id())
>> +means that the system exits the previous idle state.
>> +
>> +The event which has 'state=4294967295' in the trace is very important to the user
>> +space tools which are using it to detect the end of the current state, and so to
>> +correctly draw the states diagrams and to calculate accurate statistics etc.
>> +
>> +1.2 DEPRECATED trace API
>> +------------------------
>> +
>> +A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of
>> +'y' has been created. This allows the legacy trace power API to be used conjointly
>> +with the new trace API.
>> +The Kconfig option, the old trace API (in include/trace/events/power.h) and the
>> +old trace points will disappear in a future release (namely 2.6.41).
>> +
>> +power_start          "type=%lu state=%lu cpu_id=%lu"
>> +power_frequency              "type=%lu state=%lu cpu_id=%lu"
>> +power_end            "cpu_id=%lu"
>> +
>> +The 'type' parameter takes one of those macros:
>> + . POWER_NONE        = 0,
>> + . POWER_CSTATE      = 1,    /* C-State */
>> + . POWER_PSTATE      = 2,    /* Fequency change or DVFS */
>> +
>> +The 'state' parameter is set depending on the type:
>> + . Target C-state for type=POWER_CSTATE,
>> + . Target frequency for type=POWER_PSTATE,
>> +
>> +power_end is used to indicate the exit of a state, corresponding to the latest
>> +power_start event.
>> +
>> +2. Clocks events
>> +================
>> +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"
>> +
>> +The first parameter gives the clock name (e.g. "gpio1_iclk").
>> +The second parameter is '1' for enable, '0' for disable, the target
>> +clock rate for set_rate.
>> +
>> +3. Power domains events
>> +=======================
>> +The power domain events are used for power domains transitions
>> +
>> +power_domain_target  "%s state=%lu cpu_id=%lu"
>> +
>> +The first parameter gives the power domain name (e.g. "mpu_pwrdm").
>> +The second parameter is the power domain target state.
>> +
>> --
>> 1.7.2.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>
> --
> Eduardo Valentin
>

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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 18:49 [PATCH 0/2] tools, perf: new power trace API jean.pihet
2011-01-05 18:49 ` [PATCH 1/2] perf: add calls to suspend trace point jean.pihet
2011-01-05 18:49 ` [PATCH 2/2] tools, perf: Documentation for the power events API jean.pihet
2011-01-07  5:50   ` Eduardo Valentin
2011-01-10 10:10     ` Jean Pihet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).