aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kallsyms.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kallsyms.c')
-rw-r--r--kernel/kallsyms.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 4e2ec191a127..c36581b40c04 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -286,6 +286,25 @@ int lookup_symbol_name(unsigned long addr, char *symname)
286 return lookup_module_symbol_name(addr, symname); 286 return lookup_module_symbol_name(addr, symname);
287} 287}
288 288
289int lookup_symbol_attrs(unsigned long addr, unsigned long *size,
290 unsigned long *offset, char *modname, char *name)
291{
292 name[0] = '\0';
293 name[KSYM_NAME_LEN] = '\0';
294
295 if (is_ksym_addr(addr)) {
296 unsigned long pos;
297
298 pos = get_symbol_pos(addr, size, offset);
299 /* Grab name */
300 kallsyms_expand_symbol(get_symbol_offset(pos), name);
301 modname[0] = '\0';
302 return 0;
303 }
304 /* see if it's in a module */
305 return lookup_module_symbol_attrs(addr, size, offset, modname, name);
306}
307
289/* Look up a kernel symbol and return it in a text buffer. */ 308/* Look up a kernel symbol and return it in a text buffer. */
290int sprint_symbol(char *buffer, unsigned long address) 309int sprint_symbol(char *buffer, unsigned long address)
291{ 310{