summaryrefslogtreecommitdiff
path: root/lib/psci/psci_suspend.c
diff options
context:
space:
mode:
authordanh-arm <dan.handley@arm.com>2016-10-17 12:19:20 +0100
committerGitHub <noreply@github.com>2016-10-17 12:19:20 +0100
commit66b4542a5fa465edda55a4a7862ed1be7b99b02e (patch)
tree6570927431fe2eefba436d97f63ede6c11f0521a /lib/psci/psci_suspend.c
parent5cab1a4a18f4dfb0dfbc23377e5046e7f2a9b956 (diff)
parent872be88a2916f45d3de38120ede8c8b199b7498f (diff)
Merge pull request #729 from dp-arm/dp/arm-sip
Add instrumentation support for PSCI
Diffstat (limited to 'lib/psci/psci_suspend.c')
-rw-r--r--lib/psci/psci_suspend.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/psci/psci_suspend.c b/lib/psci/psci_suspend.c
index 0887e3b2..10d2481d 100644
--- a/lib/psci/psci_suspend.c
+++ b/lib/psci/psci_suspend.c
@@ -37,6 +37,8 @@
#include <cpu_data.h>
#include <debug.h>
#include <platform.h>
+#include <pmf.h>
+#include <runtime_instr.h>
#include <stddef.h>
#include "psci_private.h"
@@ -212,6 +214,19 @@ exit:
return;
if (is_power_down_state) {
+#if ENABLE_RUNTIME_INSTRUMENTATION
+
+ /*
+ * Update the timestamp with cache off. We assume this
+ * timestamp can only be read from the current CPU and the
+ * timestamp cache line will be flushed before return to
+ * normal world on wakeup.
+ */
+ PMF_CAPTURE_TIMESTAMP(rt_instr_svc,
+ RT_INSTR_ENTER_HW_LOW_PWR,
+ PMF_NO_CACHE_MAINT);
+#endif
+
/* The function calls below must not return */
if (psci_plat_pm_ops->pwr_domain_pwr_down_wfi)
psci_plat_pm_ops->pwr_domain_pwr_down_wfi(state_info);
@@ -219,6 +234,12 @@ exit:
psci_power_down_wfi();
}
+#if ENABLE_RUNTIME_INSTRUMENTATION
+ PMF_CAPTURE_TIMESTAMP(rt_instr_svc,
+ RT_INSTR_ENTER_HW_LOW_PWR,
+ PMF_NO_CACHE_MAINT);
+#endif
+
/*
* We will reach here if only retention/standby states have been
* requested at multiple power levels. This means that the cpu
@@ -226,6 +247,12 @@ exit:
*/
wfi();
+#if ENABLE_RUNTIME_INSTRUMENTATION
+ PMF_CAPTURE_TIMESTAMP(rt_instr_svc,
+ RT_INSTR_EXIT_HW_LOW_PWR,
+ PMF_NO_CACHE_MAINT);
+#endif
+
/*
* After we wake up from context retaining suspend, call the
* context retaining suspend finisher.