修复堆栈支持

This commit is contained in:
liankong
2025-03-30 17:09:51 +08:00
parent 770c9632ae
commit d6b0ce2565
2 changed files with 10 additions and 1 deletions

View File

@@ -70,11 +70,12 @@ struct CompactProxySymbol proxy_symbol[] = {
static unsigned long sukisu_find_proxy_symbol(const char* name) { static unsigned long sukisu_find_proxy_symbol(const char* name) {
// 查不到就查查兼容的符号 // 查不到就查查兼容的符号
int i;
for(i = 0; i < (sizeof(proxy_symbol) / sizeof(struct CompactProxySymbol)); i++) { for(i = 0; i < (sizeof(proxy_symbol) / sizeof(struct CompactProxySymbol)); i++) {
struct CompactProxySymbol* symbol = &alias_symbol[i]; struct CompactProxySymbol* symbol = &alias_symbol[i];
if(strcmp(name, symbol->symbol_name) == 0) { if(strcmp(name, symbol->symbol_name) == 0) {
if(symbol->cached_address == NULL) { if(symbol->cached_address == NULL) {
symbol->cached_address = kallsyms_lookup_name(name); symbol->cached_address = (void*) kallsyms_lookup_name(name);
} }
if(symbol->cached_address != NULL) { if(symbol->cached_address != NULL) {
return (unsigned long) &symbol->cached_address; return (unsigned long) &symbol->cached_address;

View File

@@ -1271,6 +1271,14 @@ bool kpm_is_allow_address(unsigned long addr)
return allow; return allow;
} }
#ifndef CONFIG_ARCH_STACKWALK
struct stack_trace {
unsigned int nr_entries, max_entries;
unsigned long *entries;
unsigned int skip; /* input argument: How many entries to skip */
};
#endif
static struct kprobe dump_stack_kp = { static struct kprobe dump_stack_kp = {
.symbol_name = "dump_stack", .symbol_name = "dump_stack",
}; };