--- zzzz-none-000/linux-4.4.271/lib/vsprintf.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/lib/vsprintf.c 2023-04-19 10:22:30.000000000 +0000 @@ -37,6 +37,14 @@ #include /* cpu_to_le16 */ #include + +#if defined(CONFIG_AVM_ENHANCED) +#include +#include +#endif/*--- #if defined(CONFIG_AVM_ENHANCED) ---*/ + +#include + #include "kstrtox.h" /** @@ -618,8 +626,10 @@ struct printf_spec spec, const char *fmt) { unsigned long value; -#ifdef CONFIG_KALLSYMS char sym[KSYM_SYMBOL_LEN]; +#ifndef CONFIG_KALLSYMS + struct module *mod; + int len; #endif if (fmt[1] == 'R') @@ -630,18 +640,26 @@ if (*fmt == 'B') sprint_backtrace(sym, value); else if (*fmt != 'f' && *fmt != 's') +#if defined(CONFIG_AVM_ENHANCED) + print_memory_classifier(sym, sizeof(sym), value, 1); +#else sprint_symbol(sym, value); +#endif/*--- #if defined(CONFIG_AVM_ENHANCED) ---*/ else sprint_symbol_no_offset(sym, value); - - return string(buf, end, sym, spec); #else - spec.field_width = 2 * sizeof(void *); - spec.flags |= SPECIAL | SMALL | ZEROPAD; - spec.base = 16; +#if defined(CONFIG_AVM_BOOTMEM) + module_alloc_find_module_name(sym, sym + sizeof(sym), value); +#else + len = snprintf(sym, sizeof(sym), "0x%lx", value); - return number(buf, end, value, spec); + mod = __module_address(value); + if (mod) + snprintf(sym + len, sizeof(sym) - len, " [%s@%p+0x%x]", + mod->name, mod->module_core, mod->core_size); +#endif/*--- #if defined(CONFIG_AVM_BOOTMEM) ---*/ #endif + return string(buf, end, sym, spec); } static noinline_for_stack