From patchwork Thu Apr 27 16:14:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 9703181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BAC50601D3 for ; Thu, 27 Apr 2017 16:15:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFB0720144 for ; Thu, 27 Apr 2017 16:15:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3D0028639; Thu, 27 Apr 2017 16:15:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AC3DA20144 for ; Thu, 27 Apr 2017 16:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ziXU5FxMC2k4i90coufCwV/MKaB118reJmSu9FfKnk8=; b=GAnf6zFxPNZ695 c1enXpmS1+1A3VmkfNhSSoERKNS9VD0wZC3AzhcJnG7Jc0nKZMY6r0ua/5SQayt7MO+So1h+L0Fd/ vwpl2f73Z9mP1JijxYpjmKoGZaDnR1bpXsR2Uso1QQ4KLBTteF12UfKz/FmzmBRBUNuEkGdsbPHX9 fZoEMgZf40rIhyQ6T4bkZVBXllc+SLfJsvdB1QMcukq4lLyxou6QFrM8sTJAS7CJeZ3MU6dew+UDD 6GofQ84OoOxs7X3jIsnBoYqMTaD7pE39tzLgfP0eWrNL6VBO2Sr+7dQfEHy4jJaaXvhr9r8tyGr63 GjBPnEc/a4NqFb6h1F3Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d3m4s-0000Nx-Cb; Thu, 27 Apr 2017 16:15:34 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d3m4q-0000Ni-Go for linux-arm-kernel@bombadil.infradead.org; Thu, 27 Apr 2017 16:15:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=C9oT5ZUvh7DUAbgpnEjvU1giRAVHp2omAibB0opMdJs=; b=HSoSQAyw7DazLtSF9DpAKPxBC/ q/8+uQDr7/x4G5u3Ka2m+FEiu7Jf7Q/UB9gNjVYQlymuHgEWn7jPFXblR7CSN/IWN0Y/22A+FVUK/ YzPVHn5SpEmYrzj9TAUq0xOrGNu5U2Gbi6+VACaU71DovZrwloMKNFNPL0QTkVDvWCElCWO4UOoXl VznHLi2sDKo1T+yt0mzdAgeNntYRz0xNgzvqOfzJrw13GPgD2dOrUxC44gONPMqyj7iYNaGVw/JXo j+SoRs7K64od/CWeqlM4jRE7E50ihalP4UTP8lLPasJcOmLJeKzJp+p+1TizhwxnZgRFQe0UjLNkh k6RC3BXw==; Received: from mail.kernel.org ([198.145.29.136]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d3m4o-0007VN-A6 for linux-arm-kernel@lists.infradead.org; Thu, 27 Apr 2017 16:15:31 +0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 878B420160; Thu, 27 Apr 2017 16:15:06 +0000 (UTC) Received: from gandalf.local.home (cpe-67-246-153-56.stny.res.rr.com [67.246.153.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E3F042011B; Thu, 27 Apr 2017 16:15:01 +0000 (UTC) Date: Thu, 27 Apr 2017 12:14:58 -0400 From: Steven Rostedt To: Petr Mladek Subject: Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI Message-ID: <20170427121458.2be577cc@gandalf.local.home> In-Reply-To: <20170420131154.GL3452@pathway.suse.cz> References: <1461239325-22779-1-git-send-email-pmladek@suse.com> <1461239325-22779-2-git-send-email-pmladek@suse.com> <20170419131341.76bc7634@gandalf.local.home> <20170420033112.GB542@jagdpanzerIV.localdomain> <20170420131154.GL3452@pathway.suse.cz> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170427_121530_407529_D85EB4D8 X-CRM114-Status: GOOD ( 18.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mips@linux-mips.org, Jan Kara , Sergey Senozhatsky , linux-sh@vger.kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Chris Metcalf , sparclinux@vger.kernel.org, linux-s390@vger.kernel.org, Daniel Thompson , x86@kernel.org, Ingo Molnar , Russell King , adi-buildroot-devel@lists.sourceforge.net, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Jiri Kosina , linux-cris-kernel@axis.com, linux-kernel@vger.kernel.org, Ralf Baechle , Martin Schwidefsky , Andrew Morton , linuxppc-dev@lists.ozlabs.org, David Miller Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 20 Apr 2017 15:11:54 +0200 Petr Mladek wrote: > > >From c530d9dee91c74db5e6a198479e2e63b24cb84a2 Mon Sep 17 00:00:00 2001 > From: Petr Mladek > Date: Thu, 20 Apr 2017 10:52:31 +0200 > Subject: [PATCH] printk: Use the main logbuf in NMI when logbuf_lock is > available I tried this patch. It's better because I get the end of the trace, but I do lose the beginning of it: ** 196358 printk messages dropped ** [ 102.321182] perf-5981 0.... 12983650us : d_path <-seq_path The way I tested it was by adding this: Then doing the following: # echo 1 > /proc/sys/kernel/ftrace_dump_on_oops # trace-cmd start -p function # echo nmi_handle:cpudump > /debug/tracing/set_ftrace_filter # perf record -c 100 -a sleep 1 And that triggers the crash. -- Steve Index: linux-trace.git/kernel/trace/trace_functions.c =================================================================== --- linux-trace.git.orig/kernel/trace/trace_functions.c +++ linux-trace.git/kernel/trace/trace_functions.c @@ -469,8 +469,11 @@ ftrace_cpudump_probe(unsigned long ip, u struct trace_array *tr, struct ftrace_probe_ops *ops, void *data) { - if (update_count(ops, ip, data)) - ftrace_dump(DUMP_ORIG); + char *killer = NULL; + + panic_on_oops = 1; /* force panic */ + wmb(); + *killer = 1; } static int