Date: Thu, 1 Nov 2018 15:50:58 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r340003 - in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi Message-ID: <201811011550.wA1Fowv6025605@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Nov 1 15:50:57 2018 New Revision: 340003 URL: https://svnweb.freebsd.org/changeset/base/340003 Log: MFC r339924: Implement the dump_stack() function in the LinuxKPI. Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h stable/11/sys/compat/linuxkpi/common/src/linux_compat.c stable/11/sys/modules/linuxkpi/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 15:47:07 2018 (r340002) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Nov 1 15:50:57 2018 (r340003) @@ -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; Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 1 15:47:07 2018 (r340002) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Thu Nov 1 15:50:57 2018 (r340003) @@ -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> @@ -2205,6 +2208,18 @@ __unregister_chrdev(unsigned int major, unsigned int b if (cdevp != NULL) cdev_del(cdevp); } +} + +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__) Modified: stable/11/sys/modules/linuxkpi/Makefile ============================================================================== --- stable/11/sys/modules/linuxkpi/Makefile Thu Nov 1 15:47:07 2018 (r340002) +++ stable/11/sys/modules/linuxkpi/Makefile Thu Nov 1 15:50:57 2018 (r340003) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811011550.wA1Fowv6025605>