0001
0002 #ifndef _LIBLOCKDEP_LINUX_KALLSYMS_H_
0003 #define _LIBLOCKDEP_LINUX_KALLSYMS_H_
0004
0005 #include <linux/kernel.h>
0006 #include <stdio.h>
0007 #include <unistd.h>
0008
0009 #define KSYM_NAME_LEN 128
0010
0011 struct module;
0012
0013 static inline const char *kallsyms_lookup(unsigned long addr,
0014 unsigned long *symbolsize,
0015 unsigned long *offset,
0016 char **modname, char *namebuf)
0017 {
0018 return NULL;
0019 }
0020
0021 #include <execinfo.h>
0022 #include <stdlib.h>
0023 static inline void print_ip_sym(const char *loglvl, unsigned long ip)
0024 {
0025 char **name;
0026
0027 name = backtrace_symbols((void **)&ip, 1);
0028
0029 dprintf(STDOUT_FILENO, "%s\n", *name);
0030
0031 free(name);
0032 }
0033
0034 #endif