===================================================================
@@ -17,6 +17,8 @@
#include <linux/suspend.h>
#include <linux/reboot.h>
+#include <trace/events/power.h>
+
#include <asm/io.h>
#include <acpi/acpi_bus.h>
@@ -249,14 +251,19 @@ static int acpi_suspend_enter(suspend_st
unsigned long flags = 0;
u32 acpi_state = acpi_target_sleep_state;
+ trace_power_switch_state(POWER_SSTATE, acpi_state, 0);
+
ACPI_FLUSH_CPU_CACHE();
/* Do arch specific saving of state. */
if (acpi_state == ACPI_STATE_S3) {
int error = acpi_save_state_mem();
- if (error)
+ if (error) {
+ trace_power_switch_state(POWER_SSTATE,
+ ACPI_STATE_S0, 0);
return error;
+ }
}
local_irq_save(flags);
@@ -309,6 +316,8 @@ static int acpi_suspend_enter(suspend_st
suspend_nvs_restore();
+ trace_power_switch_state(POWER_SSTATE, ACPI_STATE_S0, 0);
+
return ACPI_SUCCESS(status) ? 0 : -EFAULT;
}