From owner-svn-src-head@freebsd.org Tue Oct 30 16:42:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 383B010ED97F; Tue, 30 Oct 2018 16:42:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC8776F116; Tue, 30 Oct 2018 16:42:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCD252008F; Tue, 30 Oct 2018 16:42:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9UGgvRc056074; Tue, 30 Oct 2018 16:42:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9UGgvAV056072; Tue, 30 Oct 2018 16:42:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810301642.w9UGgvAV056072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 30 Oct 2018 16:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339924 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi X-SVN-Commit-Revision: 339924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 16:42:58 -0000 Author: hselasky Date: Tue Oct 30 16:42:56 2018 New Revision: 339924 URL: https://svnweb.freebsd.org/changeset/base/339924 Log: Implement the dump_stack() function in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h head/sys/compat/linuxkpi/common/src/linux_compat.c head/sys/modules/linuxkpi/Makefile Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Oct 30 16:32:52 2018 (r339923) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Oct 30 16:42:56 2018 (r339924) @@ -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: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Oct 30 16:32:52 2018 (r339923) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Tue Oct 30 16:42:56 2018 (r339924) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_stack.h" + #include #include #include @@ -46,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -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: head/sys/modules/linuxkpi/Makefile ============================================================================== --- head/sys/modules/linuxkpi/Makefile Tue Oct 30 16:32:52 2018 (r339923) +++ head/sys/modules/linuxkpi/Makefile Tue Oct 30 16:42:56 2018 (r339924) @@ -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