123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #ifndef __INCLUDE_KALLSYMS_H__
- #define __INCLUDE_KALLSYMS_H__
- #include <kernel.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define KSYM_NAME_LEN 32
- #define KSYM_SYMBOL_LEN (sizeof("%s+%#x/%#x [%s]") + (KSYM_NAME_LEN - 1) + \
- 2*(32*3/10) + 1)
- #ifdef CONFIG_KALLSYMS
- int kallsyms_lookup_size_offset(unsigned long addr,
- unsigned long *symbolsize,
- unsigned long *offset);
- int is_ksym_addr(unsigned long addr);
- void print_symbol(const char *fmt, unsigned long address);
- int sprint_backtrace(char *buffer, unsigned long address);
- #else
- static inline int kallsyms_lookup_size_offset(unsigned long addr,
- unsigned long *symbolsize,
- unsigned long *offset)
- {
- return 0;
- }
- static inline int is_ksym_addr(unsigned long addr)
- {
- return 0;
- }
- #define print_symbol(fmt, addr)
- #endif
- static inline void print_ip_sym(unsigned long ip)
- {
- printk("[<%p>] ", (void *) ip);
- #ifdef CONFIG_KALLSYMS_NO_NAME
- printk("\n");
- #else
- print_symbol("%s\n", (unsigned long) ip);
- #endif
- }
- #ifdef __cplusplus
- }
- #endif
- #endif
|