/proc/module: use the same logic as /proc/kallsyms for address exposure

The (alleged) users of the module addresses are the same: kernel
profiling.

So just expose the same helper and format macros, and unify the logic.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2017-11-12 18:44:23 -08:00
parent 277642dcca
commit 516fb7f2e7
3 changed files with 27 additions and 9 deletions

View file

@ -14,6 +14,14 @@
#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1)
/* How and when do we show kallsyms values? */
extern int kallsyms_show_value(void);
#ifndef CONFIG_64BIT
# define KALLSYM_FMT "%08lx"
#else
# define KALLSYM_FMT "%016lx"
#endif
struct module;
#ifdef CONFIG_KALLSYMS