2017-11-01 15:07:57 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2013-06-13 18:41:17 -04:00
|
|
|
#ifndef _LIBLOCKDEP_LINUX_KALLSYMS_H_
|
|
|
|
|
#define _LIBLOCKDEP_LINUX_KALLSYMS_H_
|
|
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
|
#include <stdio.h>
|
2017-05-25 12:58:46 +00:00
|
|
|
#include <unistd.h>
|
2013-06-13 18:41:17 -04:00
|
|
|
|
2021-04-05 05:03:50 +02:00
|
|
|
#define KSYM_NAME_LEN 512
|
2013-06-13 18:41:17 -04:00
|
|
|
|
|
|
|
|
struct module;
|
|
|
|
|
|
|
|
|
|
static inline const char *kallsyms_lookup(unsigned long addr,
|
|
|
|
|
unsigned long *symbolsize,
|
|
|
|
|
unsigned long *offset,
|
|
|
|
|
char **modname, char *namebuf)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#include <execinfo.h>
|
|
|
|
|
#include <stdlib.h>
|
2020-06-08 21:29:56 -07:00
|
|
|
static inline void print_ip_sym(const char *loglvl, unsigned long ip)
|
2013-06-13 18:41:17 -04:00
|
|
|
{
|
|
|
|
|
char **name;
|
|
|
|
|
|
|
|
|
|
name = backtrace_symbols((void **)&ip, 1);
|
|
|
|
|
|
2017-05-25 12:58:46 +00:00
|
|
|
dprintf(STDOUT_FILENO, "%s\n", *name);
|
2013-06-13 18:41:17 -04:00
|
|
|
|
|
|
|
|
free(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|