From owner-svn-src-stable@freebsd.org Thu Nov 1 15:50:59 2018 Return-Path: Delivered-To: svn-src-stable@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 7EA4410F68DF; Thu, 1 Nov 2018 15:50:59 +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 32C1C7C621; Thu, 1 Nov 2018 15:50:59 +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 EF0051DD6B; Thu, 1 Nov 2018 15:50:58 +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 wA1Fowxp025608; Thu, 1 Nov 2018 15:50:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA1Fowv6025605; Thu, 1 Nov 2018 15:50:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811011550.wA1Fowv6025605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 1 Nov 2018 15:50:58 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src modules/linuxkpi X-SVN-Commit-Revision: 340003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 15:50:59 -0000 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 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 __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: 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