Files
android_kernel_xiaomi_sm8450/include/linux/android_debug_symbols.h
Elliot Berman 0bb433e014 ANDROID: debug_symbols: Add android_debug_for_each_module
Allow vendors to obtain a list of modules loaded at given time. Vendor
modules are able to register on part of notifier chain
(register_module_notifer), but a vendor module would never see modules
which are loaded before the one which registers on the notifier chain.
The kernel doesn't offer load order control, so a hook is necessary to
iterate through currently loaded kernel modules.

Bug: 193552324
Change-Id: I3b01cc1b90f8c0c7c21a37992cc7d607316efc7b
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2021-07-15 13:59:25 -07:00

72 lines
1.5 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
*/
#ifndef _ANDROID_DEBUG_SYMBOLS_H
#define _ANDROID_DEBUG_SYMBOLS_H
enum android_debug_symbol {
ADS_SDATA = 0,
ADS_BSS_END,
ADS_PER_CPU_START,
ADS_PER_CPU_END,
ADS_START_RO_AFTER_INIT,
ADS_END_RO_AFTER_INIT,
ADS_LINUX_BANNER,
#ifdef CONFIG_CMA
ADS_TOTAL_CMA,
#endif
ADS_SLAB_CACHES,
ADS_SLAB_MUTEX,
ADS_MIN_LOW_PFN,
ADS_MAX_PFN,
#ifdef CONFIG_PAGE_OWNER
ADS_PAGE_OWNER_ENABLED,
#endif
#ifdef CONFIG_SLUB_DEBUG
ADS_SLUB_DEBUG,
#endif
#ifdef CONFIG_SWAP
ADS_NR_SWAP_PAGES,
#endif
#ifdef CONFIG_MMU
ADS_MMAP_MIN_ADDR,
#endif
ADS_STACK_GUARD_GAP,
#ifdef CONFIG_SYSCTL
ADS_SYSCTL_LEGACY_VA_LAYOUT,
#endif
ADS_END
};
enum android_debug_per_cpu_symbol {
ADS_IRQ_STACK_PTR = 0,
ADS_DEBUG_PER_CPU_END
};
#ifdef CONFIG_ANDROID_DEBUG_SYMBOLS
void *android_debug_symbol(enum android_debug_symbol symbol);
void *android_debug_per_cpu_symbol(enum android_debug_per_cpu_symbol symbol);
void android_debug_for_each_module(int (*fn)(const char *mod_name, void *mod_addr, void *data),
void *data);
#else /* !CONFIG_ANDROID_DEBUG_SYMBOLS */
static inline void *android_debug_symbol(enum android_debug_symbol symbol)
{
return NULL;
}
static inline void *android_debug_per_cpu_symbol(enum android_debug_per_cpu_symbol symbol)
{
return NULL;
}
static inline void android_debug_for_each_module(int (*fn)(const char *mod_name, void *mod_addr,
void *data), void *data) {}
#endif /* CONFIG_ANDROID_DEBUG_SYMBOLS */
#endif /* _ANDROID_DEBUG_SYMBOLS_H */