From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754251AbcBBCeB (ORCPT ); Mon, 1 Feb 2016 21:34:01 -0500 Received: from mail-ob0-f193.google.com ([209.85.214.193]:34599 "EHLO mail-ob0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754215AbcBBCd6 (ORCPT ); Mon, 1 Feb 2016 21:33:58 -0500 From: Jeffrey Merkey To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, aryabinin@virtuozzo.com, dan.j.williams@intel.com, dave@stgolabs.net, mingo@kernel.org, nikolay@cumulusnetworks.com, paulmck@linux.vnet.ibm.com, vladimir.murzin@arm.com Subject: [PATCH v5 2/3] Add BUG_XX() debugging options Kconfig.debug Date: Mon, 1 Feb 2016 19:33:47 -0700 Message-Id: <1454380428-31474-2-git-send-email-jeffmerkey@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1454380428-31474-1-git-send-email-jeffmerkey@gmail.com> References: <1454380428-31474-1-git-send-email-jeffmerkey@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds config options which can be set during compile to direct the compiler to output a breakpoint instruction anywhere a BUG() macro has been placed in the kernel to trigger the system to enter a debugger if a bug is detected by the system. Use of this compile time option also allows conditional breakpoints to be set in the kernel with these currently used macros. This addition is extremely useful for debugging hard and soft lockups real time and quickly from a console debugger, and other areas of the kernel. Signed-off-by: Jeffrey Merkey --- lib/Kconfig.debug | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 041f995..1f7437d 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -326,6 +326,17 @@ config SECTION_MISMATCH_WARN_ONLY # is preferred to always offer frame pointers as a config # option on the architecture (regardless of KERNEL_DEBUG): # +config DEBUG_BUG + bool "Set Breakpoint for Kernel BUG() macros" + depends on DEBUG_KERNEL && !S390 + help + Say Y here to enable the kernel to emit a breakpoint instruction + anywhere a BUG_XX() macro has been placed in the system kernel code + intended to catch bugs. + + This option is used for triggering the OS to try enter a debugger + if one is presently installed on the system. + config ARCH_WANT_FRAME_POINTERS bool help -- 1.8.3.1