ARM: tegra: pm: suspend trace event
Sivaram Nair [Wed, 9 May 2012 16:51:38 +0000 (19:51 +0300)]
A new trace event is added for tracing cpu suspend start and end

Change-Id: I2506e3aed0692c44fb4325e9d381cea53228b0c3
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/101748
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

arch/arm/mach-tegra/pm.c
include/trace/events/power.h

index 72ae30a..896e957 100644 (file)
@@ -878,6 +878,8 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
 
        local_fiq_disable();
 
+       trace_cpu_suspend(CPU_SUSPEND_START);
+
        cpu_pm_enter();
        cpu_complex_pm_enter();
 
@@ -941,6 +943,8 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
        if (pdata && pdata->board_resume)
                pdata->board_resume(mode, TEGRA_RESUME_AFTER_CPU);
 
+       trace_cpu_suspend(CPU_SUSPEND_DONE);
+
        local_fiq_enable();
 
        tegra_common_resume();
index 9c9699a..5b503e9 100644 (file)
@@ -41,6 +41,11 @@ DEFINE_EVENT(cpu, cpu_idle,
 #define PWR_EVENT_EXIT -1
 
 enum {
+       CPU_SUSPEND_START,
+       CPU_SUSPEND_DONE
+};
+
+enum {
        POWER_CPU_UP_START,
        POWER_CPU_UP_DONE,
        POWER_CPU_DOWN_START,
@@ -59,6 +64,23 @@ enum {
 
 #endif
 
+TRACE_EVENT(cpu_suspend,
+
+       TP_PROTO(unsigned int state),
+
+       TP_ARGS(state),
+
+       TP_STRUCT__entry(
+               __field(u32, state)
+       ),
+
+       TP_fast_assign(
+               __entry->state = state;
+       ),
+
+       TP_printk("state=%lu", (unsigned long)__entry->state)
+);
+
 TRACE_EVENT(cpu_hotplug,
 
        TP_PROTO(unsigned int cpu_id, int state),