kallsyms.h 551 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef _LIBLOCKDEP_LINUX_KALLSYMS_H_
  2. #define _LIBLOCKDEP_LINUX_KALLSYMS_H_
  3. #include <linux/kernel.h>
  4. #include <stdio.h>
  5. #define KSYM_NAME_LEN 128
  6. struct module;
  7. static inline const char *kallsyms_lookup(unsigned long addr,
  8. unsigned long *symbolsize,
  9. unsigned long *offset,
  10. char **modname, char *namebuf)
  11. {
  12. return NULL;
  13. }
  14. #include <execinfo.h>
  15. #include <stdlib.h>
  16. static inline void print_ip_sym(unsigned long ip)
  17. {
  18. char **name;
  19. name = backtrace_symbols((void **)&ip, 1);
  20. printf("%s\n", *name);
  21. free(name);
  22. }
  23. #endif