blob: 89ca6fe257ccb94652015f073f5fade62d011c88 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Sasha Levin5634bd72013-06-13 18:41:17 -04002#ifndef _LIBLOCKDEP_LINUX_KALLSYMS_H_
3#define _LIBLOCKDEP_LINUX_KALLSYMS_H_
4
5#include <linux/kernel.h>
6#include <stdio.h>
Alexander Sverdlin20fb6542017-05-25 12:58:46 +00007#include <unistd.h>
Sasha Levin5634bd72013-06-13 18:41:17 -04008
9#define KSYM_NAME_LEN 128
10
11struct module;
12
13static inline const char *kallsyms_lookup(unsigned long addr,
14 unsigned long *symbolsize,
15 unsigned long *offset,
16 char **modname, char *namebuf)
17{
18 return NULL;
19}
20
21#include <execinfo.h>
22#include <stdlib.h>
23static inline void print_ip_sym(unsigned long ip)
24{
25 char **name;
26
27 name = backtrace_symbols((void **)&ip, 1);
28
Alexander Sverdlin20fb6542017-05-25 12:58:46 +000029 dprintf(STDOUT_FILENO, "%s\n", *name);
Sasha Levin5634bd72013-06-13 18:41:17 -040030
31 free(name);
32}
33
34#endif