Power Management Device Latencies Measurement

From OMAPpedia

(Difference between revisions)
Jump to: navigation, search
(Created page with '=PM Devices constraintes measurements= ==Introduction== To correctly implmeent the device latency constraint support it is needed to get accurate measurements of the system low…')
Line 2: Line 2:
==Introduction==
==Introduction==
-
 
+
To correctly implement the device latency constraint support it is needed to get accurate measurements of the system low power modes overhead:
-
To correctly implmeent the device latency constraint support it is needed to get accurate measurements of the system low power modes overhead:
+
* Total amount of time taken for a device to become accessible, and so the time for the device to wake-up from a given low power mode.
* Total amount of time taken for a device to become accessible, and so the time for the device to wake-up from a given low power mode.
* It includes turning the clocks on, bringing the clockdomain out of inactive, power domain out of RET or OFF (with context restore) state.
* It includes turning the clocks on, bringing the clockdomain out of inactive, power domain out of RET or OFF (with context restore) state.
Line 11: Line 10:
==Kernel patches & build==
==Kernel patches & build==
-
 
Some kernel changes are required for the kernel instrumentation. The patches and config are attached to this page
Some kernel changes are required for the kernel instrumentation. The patches and config are attached to this page
-
* Starting point: linux-omap master branch at commit [[http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=a83d12a47c9a8c78a184910150797045d69a1570][a83d12a47c9a8c78a184910150797045d69a1570 Linux-omap rebuilt: Updated to v2.6.36, add 24xx uart fix]]
+
* Starting point: linux-omap master branch at commit ''a83d12a47c9a8c78a184910150797045d69a1570 Linux-omap rebuilt: Updated to v2.6.36, add 24xx uart fix'' (http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=a83d12a47c9a8c78a184910150797045d69a1570])
-
* khilman's patch to fix the low power mode: [[http://git.kernel.org/?p=linux/kernel/git/khilman/linux-omap-pm.git;a=commitdiff;h=20b9e9aa97cf811e799420b9096235eb67ef6191][1e91c5f70da4d7d108cbcf026164d001e0e688b3 OMAP: bus-level PM: enable use of runtime PM API for suspend/resume]]
+
* khilman's patch to fix the low power mode: ''1e91c5f70da4d7d108cbcf026164d001e0e688b3 OMAP: bus-level PM: enable use of runtime PM API for suspend/resume'' (http://git.kernel.org/?p=linux/kernel/git/khilman/linux-omap-pm.git;a=commitdiff;h=20b9e9aa97cf811e799420b9096235eb67ef6191)
* Tracing instrumentation patches
* Tracing instrumentation patches
-
<verbatim>
+
<pre>
2ae0c90dc76c7b96c192be1a6b7180016ecafc57 tracing, perf: add more power related events
2ae0c90dc76c7b96c192be1a6b7180016ecafc57 tracing, perf: add more power related events
e44b2e1cdf19039771e02b3f1a021f9c3c43cf68 perf: add suspend tracepoint calls
e44b2e1cdf19039771e02b3f1a021f9c3c43cf68 perf: add suspend tracepoint calls
2e7387e37300f490de6a29c231bf61849f0a8a2e OMAP3: clean up ASM idle code
2e7387e37300f490de6a29c231bf61849f0a8a2e OMAP3: clean up ASM idle code
e7eeedd4c3a5d102d57d53707b322806cd21365e OMAP3: add low power entry/exit latency trace points
e7eeedd4c3a5d102d57d53707b322806cd21365e OMAP3: add low power entry/exit latency trace points
-
</verbatim>
+
</pre>
* GPIO instrumentation
* GPIO instrumentation
-
<verbatim>
+
<pre>
17f9faf3bc2c3d643a48624779acd90d2d499f2c OMAP3: Add HW tracing code
17f9faf3bc2c3d643a48624779acd90d2d499f2c OMAP3: Add HW tracing code
-
</verbatim>
+
</pre>
* Kernel config for Beagleboard
* Kernel config for Beagleboard
Line 37: Line 35:
The trace points are connected on Beagleboard rev B7.
The trace points are connected on Beagleboard rev B7.
-
* Trace 1: on the USER button, at the connection to R36. The trigger is set on the raising edge of the signal.
+
* Trace A: on the USER button, at the connection to R36. The trigger is set on the raising edge of the signal.
-
 
+
* Trace B: USR1 LED (GPIO_149). This signal is set at the end of omap_sram_idle, along with ''trace_power_start(POWER_WAKEN, 7, smp_processor_id());''. This allows to synchronize the time between the HW and the SW traces.
-
* Trace 2: USR1 LED (GPIO_149). This signal is set at the end of omap_sram_idle, along with ''trace_power_start(POWER_WAKEN, 7, smp_processor_id());''. This allows to synchronize the time between the HW and the SW traces.
+
Because of the difficulty to add trace code for HW/SW tracing in the early wake-up code path, the MPU context restore code in ASM (triggered by the ROM code) until the MMU is re-enabled is considered as part of the HW wake-up sequence. This is valid for OFF mode only.
Because of the difficulty to add trace code for HW/SW tracing in the early wake-up code path, the MPU context restore code in ASM (triggered by the ROM code) until the MMU is re-enabled is considered as part of the HW wake-up sequence. This is valid for OFF mode only.
Line 47: Line 44:
The measurements from TI are used for the real HW latency.
The measurements from TI are used for the real HW latency.
-
Here are some scope screenshots showing the time delta between the wake-up event (USER button press, trace A) and the end of omap_sram_idle (USR1 Led), for both RET and OFF mode.
+
Here are some scope screenshots showing the time delta between the wake-up event (USER button press, trace A) and the end of omap_sram_idle (USR1 Led), for both RET and OFF mode:
[[File:scope_capture_ret.jpg|center|thumb|320px]]
[[File:scope_capture_ret.jpg|center|thumb|320px]]
[[File:scope_capture_off.jpg|center|thumb|320px]]
[[File:scope_capture_off.jpg|center|thumb|320px]]
Line 53: Line 50:
== SW trace usage==
== SW trace usage==
Enable the power events and dump the trace:
Enable the power events and dump the trace:
-
<verbatim>
+
<pre>
# echo 1 > /debug/tracing/events/power/enable
# echo 1 > /debug/tracing/events/power/enable
# cat /debug/tracing/trace_pipe &
# cat /debug/tracing/trace_pipe &
-
</verbatim>
+
</pre>
Trigger the suspend, RET mode:
Trigger the suspend, RET mode:
-
<verbatim>
+
<pre>
# echo 0 > /debug/pm_debug/enable_off_mode
# echo 0 > /debug/pm_debug/enable_off_mode
# echo mem > /sys/power/state
# echo mem > /sys/power/state
Line 90: Line 87:
               sh-503  [000]  3967.267120: power_start: type=5 state=7 cpu_id=0    => Last wake-up trace point, at the end of omap_sram_idle
               sh-503  [000]  3967.267120: power_start: type=5 state=7 cpu_id=0    => Last wake-up trace point, at the end of omap_sram_idle
               sh-503  [000]  3967.267181: power_start: type=3 state=0 cpu_id=0    => Exit OMAP idle function
               sh-503  [000]  3967.267181: power_start: type=3 state=0 cpu_id=0    => Exit OMAP idle function
-
</verbatim>
+
</pre>
With OFF mode enabled:
With OFF mode enabled:
-
<verbatim>
+
<pre>
# echo 1 > /debug/pm_debug/enable_off_mode
# echo 1 > /debug/pm_debug/enable_off_mode
# echo mem > /sys/power/state
# echo mem > /sys/power/state
Line 124: Line 121:
               sh-503  [000]  1900.083862: power_start: type=5 state=7 cpu_id=0    => Last wake-up trace point, at the end of omap_sram_idle
               sh-503  [000]  1900.083862: power_start: type=5 state=7 cpu_id=0    => Last wake-up trace point, at the end of omap_sram_idle
               sh-503  [000]  1900.083954: power_start: type=3 state=0 cpu_id=0    => Exit OMAP idle function
               sh-503  [000]  1900.083954: power_start: type=3 state=0 cpu_id=0    => Exit OMAP idle function
-
</verbatim>
+
</pre>
==Timings results==
==Timings results==

Revision as of 14:07, 5 November 2010

Contents

PM Devices constraintes measurements

Introduction

To correctly implement the device latency constraint support it is needed to get accurate measurements of the system low power modes overhead:

This wiki page details the measurements setup and the results. The latency data is to be fed into the constraints latency patches.

Kernel patches & build

Some kernel changes are required for the kernel instrumentation. The patches and config are attached to this page

2ae0c90dc76c7b96c192be1a6b7180016ecafc57 tracing, perf: add more power related events
e44b2e1cdf19039771e02b3f1a021f9c3c43cf68 perf: add suspend tracepoint calls
2e7387e37300f490de6a29c231bf61849f0a8a2e OMAP3: clean up ASM idle code
e7eeedd4c3a5d102d57d53707b322806cd21365e OMAP3: add low power entry/exit latency trace points
17f9faf3bc2c3d643a48624779acd90d2d499f2c OMAP3: Add HW tracing code

Changes: DSS for Beagle, Initramfs Busybox root FS

HW traces details

The trace points are connected on Beagleboard rev B7.

Because of the difficulty to add trace code for HW/SW tracing in the early wake-up code path, the MPU context restore code in ASM (triggered by the ROM code) until the MMU is re-enabled is considered as part of the HW wake-up sequence. This is valid for OFF mode only.

!Warning! The HW power supplies and external clocks are not cut off in this config (no support in l-o), so the HW latencies are lower than expected. The measurements from TI are used for the real HW latency.

Here are some scope screenshots showing the time delta between the wake-up event (USER button press, trace A) and the end of omap_sram_idle (USR1 Led), for both RET and OFF mode:

Scope capture ret.jpg
Scope capture off.jpg

SW trace usage

Enable the power events and dump the trace:

# echo 1 > /debug/tracing/events/power/enable
# cat /debug/tracing/trace_pipe &

Trigger the suspend, RET mode:

# echo 0 > /debug/pm_debug/enable_off_mode
# echo mem > /sys/power/state
[ 3966.216278] PM: Syncing filesystems ... done.
[ 3966.221557] Freezing user space processes ... (elapsed 0.02 seconds) done.
[ 3966.249267] Freezing remaining freezable tasks ... (elapsed 0.02 seconds) done.
[ 3966.281188] Suspending console(s) (use no_console_suspend to debug)
[ 3966.404327] PM: suspend of devices complete after 112.426 msecs
[ 3966.406127] PM: late suspend of devices complete after 1.739 msecs
[ 3966.406158] Disabling non-boot CPUs ...
[ 3967.267150] Successfully put all powerdomains to target state
[ 3967.267791] PM: early resume of devices complete after 0.396 msecs
[ 3967.686279] PM: resume of devices complete after 418.243 msecs
[ 3967.726715] Restarting tasks ... done.
              sh-503   [000]  3966.406433: power_start: type=3 state=3 cpu_id=0    => Enter OMAP idle function
              sh-503   [000]  3966.406494: power_start: type=4 state=1 cpu_id=0    => First suspend trace point
              sh-503   [000]  3966.406525: power_start: type=4 state=2 cpu_id=0    => ...
              sh-503   [000]  3966.406555: power_start: type=4 state=3 cpu_id=0
              sh-503   [000]  3966.406586: power_start: type=4 state=4 cpu_id=0
              sh-503   [000]  3966.406616: power_start: type=4 state=5 cpu_id=0
              sh-503   [000]  3966.406647: power_start: type=4 state=6 cpu_id=0
              sh-503   [000]  3966.406647: power_start: type=4 state=7 cpu_id=0
              sh-503   [000]  3966.406647: power_start: type=4 state=8 cpu_id=0    => Last trace for low power enter, just before WFI
              sh-503   [000]  3967.266937: power_start: type=5 state=1 cpu_id=0    => First wake-up trace point, at return from omap34xx_save_cpu_context_wfi
              sh-503   [000]  3967.266937: power_start: type=5 state=2 cpu_id=0    => ...
              sh-503   [000]  3967.266937: power_start: type=5 state=3 cpu_id=0
              sh-503   [000]  3967.266937: power_start: type=5 state=4 cpu_id=0
              sh-503   [000]  3967.267029: power_start: type=5 state=5 cpu_id=0
              sh-503   [000]  3967.267059: power_start: type=5 state=6 cpu_id=0
              sh-503   [000]  3967.267120: power_start: type=5 state=7 cpu_id=0    => Last wake-up trace point, at the end of omap_sram_idle
              sh-503   [000]  3967.267181: power_start: type=3 state=0 cpu_id=0    => Exit OMAP idle function

With OFF mode enabled:

# echo 1 > /debug/pm_debug/enable_off_mode
# echo mem > /sys/power/state
[ 1898.722778] PM: Syncing filesystems ... done.
[ 1898.728057] Freezing user space processes ... (elapsed 0.02 seconds) done.
[ 1898.755950] Freezing remaining freezable tasks ... (elapsed 0.02 seconds) done.
[ 1898.787872] Suspending console(s) (use no_console_suspend to debug)
[ 1898.910980] PM: suspend of devices complete after 112.396 msecs
[ 1898.912780] PM: late suspend of devices complete after 1.739 msecs
[ 1898.912811] Disabling non-boot CPUs ...
[ 1900.083923] Successfully put all powerdomains to target state
[ 1900.084686] PM: early resume of devices complete after 0.488 msecs
[ 1900.514953] PM: resume of devices complete after 429.962 msecs
[ 1900.555725] Restarting tasks ... done.
              sh-503   [000]  1898.913086: power_start: type=3 state=3 cpu_id=0    => Enter OMAP idle function
              sh-503   [000]  1898.913147: power_start: type=4 state=1 cpu_id=0    => First suspend trace point
              sh-503   [000]  1898.913147: power_start: type=4 state=2 cpu_id=0    => ...
              sh-503   [000]  1898.913208: power_start: type=4 state=3 cpu_id=0
              sh-503   [000]  1898.913239: power_start: type=4 state=4 cpu_id=0
              sh-503   [000]  1898.913269: power_start: type=4 state=5 cpu_id=0
              sh-503   [000]  1898.913391: power_start: type=4 state=6 cpu_id=0
              sh-503   [000]  1898.913391: power_start: type=4 state=7 cpu_id=0
              sh-503   [000]  1898.914337: power_start: type=4 state=8 cpu_id=0    => Last trace for low power enter, just before WFI
              sh-503   [000]  1900.083405: power_start: type=5 state=1 cpu_id=0    => First wake-up trace point, at return from omap34xx_save_cpu_context_wfi
              sh-503   [000]  1900.083466: power_start: type=5 state=2 cpu_id=0    => ...
              sh-503   [000]  1900.083496: power_start: type=5 state=3 cpu_id=0
              sh-503   [000]  1900.083588: power_start: type=5 state=4 cpu_id=0
              sh-503   [000]  1900.083771: power_start: type=5 state=5 cpu_id=0
              sh-503   [000]  1900.083801: power_start: type=5 state=6 cpu_id=0
              sh-503   [000]  1900.083862: power_start: type=5 state=7 cpu_id=0    => Last wake-up trace point, at the end of omap_sram_idle
              sh-503   [000]  1900.083954: power_start: type=3 state=0 cpu_id=0    => Exit OMAP idle function

Timings results

Full RET mode

Full OFF mode

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox