From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933133AbcA2SUY (ORCPT ); Fri, 29 Jan 2016 13:20:24 -0500 Received: from mail-ob0-f193.google.com ([209.85.214.193]:33144 "EHLO mail-ob0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756795AbcA2STI (ORCPT ); Fri, 29 Jan 2016 13:19:08 -0500 From: Jeffrey Merkey To: hpa@zytor.com, jeffmerkey@gmail.com, linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, x86@kernel.org Subject: [PATCH 2/4] Add BUG() debugger entry points x86 Date: Fri, 29 Jan 2016 11:19:04 -0700 Message-Id: <1454091544-12733-1-git-send-email-jeffmerkey@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds a config option 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 anywhere in the kernel. 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 --- arch/x86/include/asm/bug.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index ba38ebb..6319f3e0 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -27,7 +27,11 @@ do { \ #else #define BUG() \ do { \ +#ifdef CONFIG_DEBUG_BREAK + asm volatile("int3"); \ +#else asm volatile("ud2"); \ +#endif unreachable(); \ } while (0) #endif -- 1.8.3.1