1 From: Felix Fietkau <nbd@nbd.name>
2 Subject: kernel: when KALLSYMS is disabled, print module address + size for matching backtrace entries
4 [john@phrozen.org: felix will add this to his upstream queue]
6 lede-commit 53827cdc824556cda910b23ce5030c363b8f1461
7 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 lib/vsprintf.c | 15 +++++++++++----
10 1 file changed, 11 insertions(+), 4 deletions(-)
14 @@ -940,8 +940,10 @@ char *symbol_string(char *buf, char *end
15 struct printf_spec spec, const char *fmt)
18 -#ifdef CONFIG_KALLSYMS
19 char sym[KSYM_SYMBOL_LEN];
20 +#ifndef CONFIG_KALLSYMS
26 @@ -958,8 +960,14 @@ char *symbol_string(char *buf, char *end
28 return string_nocheck(buf, end, sym, spec);
30 - return special_hex_number(buf, end, value, sizeof(void *));
31 + len = snprintf(sym, sizeof(sym), "0x%lx", value);
32 + mod = __module_address(value);
34 + snprintf(sym + len, sizeof(sym) - len, " [%s@%p+0x%x]",
35 + mod->name, mod->core_layout.base,
36 + mod->core_layout.size);
38 + return string(buf, end, sym, spec);
41 static const struct printf_spec default_str_spec = {