ANDROID: power: Add vendor hook for suspend

The purpose of this vendor hook is to trace early resume latency.

Bug: 241946090
Signed-off-by: Ziyi Cui <ziyic@google.com>
Change-Id: I508f5a34fd3210178af0cb142461baf814196b9f
This commit is contained in:
Ziyi Cui
2022-08-16 20:57:48 +00:00
parent 19b9be6d35
commit 737a5314c9
3 changed files with 6 additions and 1 deletions

View File

@@ -411,3 +411,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_memcg_scan_type);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pidfd_open);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_early_resume_begin);

View File

@@ -15,6 +15,9 @@ DECLARE_HOOK(android_vh_resume_begin,
DECLARE_HOOK(android_vh_resume_end,
TP_PROTO(void *unused),
TP_ARGS(unused))
DECLARE_HOOK(android_vh_early_resume_begin,
TP_PROTO(void *unused),
TP_ARGS(unused))
/* macro versions of hooks are no longer required */

View File

@@ -440,7 +440,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
BUG_ON(!irqs_disabled());
system_state = SYSTEM_SUSPEND;
trace_android_vh_early_resume_begin(NULL);
error = syscore_suspend();
if (!error) {
*wakeup = pm_wakeup_pending();