Implement the dump_stack() function in the LinuxKPI.

Submitted by:		Johannes Lundberg <johalun0@gmail.com>
MFC after:		3 days
Sponsored by:		Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2018-10-30 16:42:56 +00:00
parent bf05cd05ac
commit e35079db73
3 changed files with 20 additions and 1 deletions

View File

@ -138,6 +138,9 @@
#define printk(...) printf(__VA_ARGS__)
#define vprintk(f, a) vprintf(f, a)
extern void linux_dump_stack(void);
#define dump_stack() linux_dump_stack()
struct va_format {
const char *fmt;
va_list *va;

View File

@ -30,6 +30,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "opt_stack.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
@ -46,6 +48,7 @@ __FBSDID("$FreeBSD$");
#include <sys/filio.h>
#include <sys/rwlock.h>
#include <sys/mman.h>
#include <sys/stack.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@ -2207,6 +2210,18 @@ __unregister_chrdev(unsigned int major, unsigned int baseminor,
}
}
void
linux_dump_stack(void)
{
#ifdef STACK
struct stack st;
stack_zero(&st);
stack_save(&st);
stack_print(&st);
#endif
}
#if defined(__i386__) || defined(__amd64__)
bool linux_cpu_has_clflush;
#endif

View File

@ -24,7 +24,8 @@ SRCS+= bus_if.h \
pci_if.h \
vnode_if.h \
usb_if.h \
opt_usb.h
opt_usb.h \
opt_stack.h
CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include
CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include