aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kallsyms.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kallsyms.c')
-rw-r--r--kernel/kallsyms.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index f66da025cb7f..4e2ec191a127 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -269,6 +269,23 @@ const char *kallsyms_lookup(unsigned long addr,
269 return NULL; 269 return NULL;
270} 270}
271 271
272int lookup_symbol_name(unsigned long addr, char *symname)
273{
274 symname[0] = '\0';
275 symname[KSYM_NAME_LEN] = '\0';
276
277 if (is_ksym_addr(addr)) {
278 unsigned long pos;
279
280 pos = get_symbol_pos(addr, NULL, NULL);
281 /* Grab name */
282 kallsyms_expand_symbol(get_symbol_offset(pos), symname);
283 return 0;
284 }
285 /* see if it's in a module */
286 return lookup_module_symbol_name(addr, symname);
287}
288
272/* Look up a kernel symbol and return it in a text buffer. */ 289/* Look up a kernel symbol and return it in a text buffer. */
273int sprint_symbol(char *buffer, unsigned long address) 290int sprint_symbol(char *buffer, unsigned long address)
274{ 291{