diff options
author | Anders Kaseorg <andersk@mit.edu> | 2008-12-05 19:03:58 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-03-31 13:05:32 +1030 |
commit | 75a66614db21007bcc8c37f9c5d5b922981387b9 (patch) | |
tree | d02c905a3aee02ec25ce38700f47d0fa57d2cbf7 /include/linux/kallsyms.h | |
parent | a6e6abd575fcbe6572ebc7a70ad616406d206fa8 (diff) | |
download | linux-stable-75a66614db21007bcc8c37f9c5d5b922981387b9.tar.gz linux-stable-75a66614db21007bcc8c37f9c5d5b922981387b9.tar.bz2 linux-stable-75a66614db21007bcc8c37f9c5d5b922981387b9.zip |
Ksplice: Add functions for walking kallsyms symbols
Impact: New API
kallsyms_lookup_name only returns the first match that it finds. Ksplice
needs information about all symbols with a given name in order to correctly
resolve local symbols.
kallsyms_on_each_symbol provides a generic mechanism for iterating over the
kallsyms table.
Cc: Jeff Arnold <jbarnold@mit.edu>
Cc: Tim Abbott <tabbott@mit.edu>
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/kallsyms.h')
-rw-r--r-- | include/linux/kallsyms.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index f3fe34391d8e..792274269f2b 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -13,10 +13,17 @@ #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \ 2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1) +struct module; + #ifdef CONFIG_KALLSYMS /* Lookup the address for a symbol. Returns 0 if not found. */ unsigned long kallsyms_lookup_name(const char *name); +/* Call a function on each kallsyms symbol in the core kernel */ +int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *, + unsigned long), + void *data); + extern int kallsyms_lookup_size_offset(unsigned long addr, unsigned long *symbolsize, unsigned long *offset); @@ -43,6 +50,14 @@ static inline unsigned long kallsyms_lookup_name(const char *name) return 0; } +static inline int kallsyms_on_each_symbol(int (*fn)(void *, const char *, + struct module *, + unsigned long), + void *data) +{ + return 0; +} + static inline int kallsyms_lookup_size_offset(unsigned long addr, unsigned long *symbolsize, unsigned long *offset) |