
From: Todd Kjos <tkjos@google.com> aosp inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I7YFU9 Reference: https://android.googlesource.com/kernel/common/+/943c3b3124d2 ------------------------------------------------- Vendor hooks required explicitly defining macros or inline functions to handle the non-GKI build case (!CONFIG_ANDROID_VENDOR_HOOKS). Added support for generating them automatically so the macros are no longer required. Both models are now supported so we can transition. Bug: 177416721 Signed-off-by: Todd Kjos <tkjos@google.com> Change-Id: I01acc389d315a5d509b0c48116854342a42e1058 Signed-off-by: Yu Liao <liaoyu15@huawei.com> --- include/trace/hooks/vendor_hooks.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/trace/hooks/vendor_hooks.h b/include/trace/hooks/vendor_hooks.h index e6cabd366eeb..ef8c95aaebf0 100644 --- a/include/trace/hooks/vendor_hooks.h +++ b/include/trace/hooks/vendor_hooks.h @@ -9,6 +9,8 @@ #include <linux/tracepoint.h> +#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) + #define DECLARE_HOOK DECLARE_TRACE #ifdef TRACE_HEADER_MULTI_READ @@ -102,3 +104,10 @@ PARAMS(__data, args)) #endif /* TRACE_HEADER_MULTI_READ */ + +#else /* !CONFIG_TRACEPOINTS || !CONFIG_ANDROID_VENDOR_HOOKS */ +/* suppress trace hooks */ +#define DECLARE_HOOK DECLARE_EVENT_NOP +#define DECLARE_RESTRICTED_HOOK(name, proto, args, cond) \ + DECLARE_EVENT_NOP(name, PARAMS(proto), PARAMS(args)) +#endif -- 2.33.0