android_kernel_msm-6.1_noth.../include/trace/hooks/module.h
Kuan-Ying Lee b28620e7db ANDROID: module: Add vendor hooks
Add vendor hook for module init, so we can get memory type and
use it to do memory type check for architecture
dependent page table setting. To make sure the architecture
dependent tables are created correctly, we need to know when
module parts are initialized and their attributes.

For releasing modules, corresponding tables and attributes should be
destroyed and restored.

These hooks may be invoked in non-atomic context, so it's
necessary to use restricted ones.

Bug: 248994334
Change-Id: Ie9f415c36bca1fb98e021522b627e562d27cdef4
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
2023-04-18 19:28:00 +00:00

32 lines
1,007 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM module
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_MODULE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_MODULE_H
#include <trace/hooks/vendor_hooks.h>
/*
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
struct module;
DECLARE_RESTRICTED_HOOK(android_rvh_set_module_permit_before_init,
TP_PROTO(const struct module *mod),
TP_ARGS(mod), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_set_module_permit_after_init,
TP_PROTO(const struct module *mod),
TP_ARGS(mod), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_set_module_core_rw_nx,
TP_PROTO(const struct module *mod),
TP_ARGS(mod), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_set_module_init_rw_nx,
TP_PROTO(const struct module *mod),
TP_ARGS(mod), 1);
#endif /* _TRACE_HOOK_MODULE_H */
/* This part must be outside protection */
#include <trace/define_trace.h>