
Add vendor hook to print epoch values when system enter and exit out of suspend and resume. These epoch values are useful to know how long the device is in suspend state. These values can be used to synchronize various subsystem timestamps and have an unique timestamp to correlate between various subsystems. Bug: 172945021 Change-Id: I82a01e348d05a46c9c3921869cc9d2fc0fd28867 Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
32 lines
868 B
C
32 lines
868 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM epoch
|
|
|
|
#define TRACE_INCLUDE_PATH trace/hooks
|
|
|
|
#if !defined(_TRACE_HOOK_EPOCH_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_HOOK_EPOCH_H
|
|
|
|
#include <linux/tracepoint.h>
|
|
#include <trace/hooks/vendor_hooks.h>
|
|
|
|
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
|
|
|
|
DECLARE_HOOK(android_vh_show_suspend_epoch_val,
|
|
TP_PROTO(u64 suspend_ns, u64 suspend_cycles),
|
|
TP_ARGS(suspend_ns, suspend_cycles));
|
|
|
|
DECLARE_HOOK(android_vh_show_resume_epoch_val,
|
|
TP_PROTO(u64 resume_cycles),
|
|
TP_ARGS(resume_cycles));
|
|
#else
|
|
|
|
#define trace_android_vh_show_suspend_epoch_val(suspend_ns, suspend_cycles)
|
|
#define trace_android_vh_show_resume_epoch_val(resume_cycles)
|
|
|
|
#endif
|
|
|
|
#endif /* _TRACE_HOOK_EPOCH_H */
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|