1 #ifndef ROS_KERN_KDEBUG_H
2 #define ROS_KERN_KDEBUG_H
4 #include <ros/common.h>
5 #include <arch/kdebug.h>
13 void backtrace_frame(uintptr_t pc, uintptr_t fp);
14 size_t backtrace_list(uintptr_t pc, uintptr_t fp, uintptr_t *pcs,
17 /* Arch dependent, listed here for ease-of-use */
18 static inline uintptr_t get_caller_pc(void);
20 /* Returns a null-terminated string with the function name for a given PC /
21 * instruction pointer. kfree() the result. */
22 char *get_fn_name(uintptr_t pc);
24 /* Returns the address of sym, or 0 if it does not exist */
25 uintptr_t get_symbol_addr(char *sym);
27 /* For a poor-mans function tracer (can add these with spatch) */
28 void __print_func_entry(const char *func, const char *file);
29 void __print_func_exit(const char *func, const char *file);
30 #define print_func_entry() __print_func_entry(__FUNCTION__, __FILE__)
31 #define print_func_exit() __print_func_exit(__FUNCTION__, __FILE__)
32 void hexdump(void *v, int length);
33 void pahexdump(uintptr_t pa, int length);
35 /* circular shit... */
36 void oprofile_add_trace(unsigned long pc);
37 #define TRACEME() oprofile_add_backtrace(read_bp())
39 #endif /* ROS_KERN_KDEBUG_H */