ANDROID: vendor_hooks: add definitions for indirect hook calls
Introduce DECLARE_INDIRECT_HOOK() and DEFINE_INDIRECT_HOOK() helper
macros to provide a way to call vendor hooks from a header file
without inclusion of trace headers and with no performance loss
when vendor hook is unused.
DECLARE_INDIRECT_HOOK() is used in the header to create an inline
function which checks the static key to determine if the vendor hook
is used. If it is used, it calls the vendor hook using a non-inlined
wrapper function. DECLARE_INDIRECT_HOOK() is used in the source file
to implement the vendor hook wrapper function.
Bug: 236578020
Change-Id: I3048191281e58323c5cde5ea4cb61ba23210ede2
Signed-off-by:
Suren Baghdasaryan <surenb@google.com>
Loading
Please sign in to comment