From 019990276b252fe8df496939455034c2c9d79696 Mon Sep 17 00:00:00 2001 From: Siddharth Gupta Date: Fri, 25 Jun 2021 11:58:39 -0700 Subject: [PATCH] ANDROID: rproc: Add vendor hook for recovery Add vendor hook for rproc recovery to allow vendor enhancements. Bug: 188764827 Change-Id: If6f0846c141a4ad40748d552002f65b94d9c52d5 Signed-off-by: Siddharth Gupta --- drivers/android/vendor_hooks.c | 2 ++ drivers/remoteproc/remoteproc_core.c | 2 ++ include/trace/hooks/remoteproc.h | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 include/trace/hooks/remoteproc.h diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 0a632d52d2a6..fd57c2ed2fb0 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -63,6 +63,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -337,3 +338,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_force_compatible_pre); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_force_compatible_post); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_print_transaction_info); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_setscheduler_uclamp); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rproc_recovery); diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 9107ec4ca0d7..5ec0502c04c4 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "remoteproc_internal.h" @@ -1725,6 +1726,7 @@ int rproc_trigger_recovery(struct rproc *rproc) release_firmware(firmware_p); unlock_mutex: + trace_android_vh_rproc_recovery(rproc); mutex_unlock(&rproc->lock); return ret; } diff --git a/include/trace/hooks/remoteproc.h b/include/trace/hooks/remoteproc.h new file mode 100644 index 000000000000..7cc5e93d2ebe --- /dev/null +++ b/include/trace/hooks/remoteproc.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM remoteproc + +#define TRACE_INCLUDE_PATH trace/hooks + +#if !defined(_TRACE_HOOK_RPROC_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_RPROC_H + +#include +#include + +struct rproc; + +DECLARE_HOOK(android_vh_rproc_recovery, + TP_PROTO(struct rproc *rproc), + TP_ARGS(rproc)); + +#endif /* _TRACE_HOOK_RPROC_H */ +/* This part must be outside protection */ +#include