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