aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorFranck Bui-Huu <vagabon.xyz@gmail.com>2006-10-03 04:13:48 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:03:41 -0400
commitffc5089196446c08d9a005cf0dd7cab18d119606 (patch)
treee15925251553152f6859c354e34afe3adfcd1c64 /kernel/module.c
parent339b0c0813a257893fa84be999b9b85a50846dd8 (diff)
[PATCH] Create kallsyms_lookup_size_offset()
Some uses of kallsyms_lookup() do not need to find out the name of a symbol and its module's name it belongs. This is specially true in arch specific code, which needs to unwind the stack to show the back trace during oops (mips is an example). In this specific case, we just need to retreive the function's size and the offset of the active intruction inside it. Adds a new entry "kallsyms_lookup_size_offset()" This new entry does exactly the same as kallsyms_lookup() but does not require any buffers to store any names. It returns 0 if it fails otherwise 1. Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 7c77a0a9275c..7f60e782de1e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2040,7 +2040,8 @@ const char *module_address_lookup(unsigned long addr,
2040 list_for_each_entry(mod, &modules, list) { 2040 list_for_each_entry(mod, &modules, list) {
2041 if (within(addr, mod->module_init, mod->init_size) 2041 if (within(addr, mod->module_init, mod->init_size)
2042 || within(addr, mod->module_core, mod->core_size)) { 2042 || within(addr, mod->module_core, mod->core_size)) {
2043 *modname = mod->name; 2043 if (modname)
2044 *modname = mod->name;
2044 return get_ksymbol(mod, addr, size, offset); 2045 return get_ksymbol(mod, addr, size, offset);
2045 } 2046 }
2046 } 2047 }