Received: by 10.223.176.46 with SMTP id f43csp361330wra; Thu, 25 Jan 2018 23:38:11 -0800 (PST) X-Google-Smtp-Source: AH8x225EGW0mWOYTMGJa5cbLAHnTX/CJ+wPoX+yWIg1g9RY8DoGcFqhZhaJ09UOIqLAb15Bf4aGU X-Received: by 2002:a17:902:b784:: with SMTP id e4-v6mr4099064pls.147.1516952291344; Thu, 25 Jan 2018 23:38:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516952291; cv=none; d=google.com; s=arc-20160816; b=p0cftXTYl26VSvhzPlRVCoAOEuGpCVeh6oCFEyO99VgHkqzxGNzqtDKm77fbAKXjym EuhCy3T18Y8xFC48doq7w1gmv0olNdpp2xY41iMlv627tErdeiXNt8JGTtMBEho+8M0V aPSxL7gb//UTo+EGlbbC/6KSubhApIC8AYv8p9Ej3klVOsXBuTzGiMUD237C6QqCs1sS dH8GXgMpszFT4IYseayqnTpwQXk8qo6UVU6nq4hcKfLNcofxMpTiv4Rg/S0ROqSm02K3 4hfN2HGCQW3Pak5v2W1zHDrPjQ9RT4AePPWDaTO2cnBCiiFRQtABrw3HpUfWVBJ0GrXF p4Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=phMC6c2DZoOnsPw+IzRv4E7bAK27xRKO/TTHb6PYlCw=; b=EERUZWEHhkOpOOhsB/XwRv8NIE03Ah0/EO8D2Cs07PZDXpojPzGbe371nOIAAkIvau pEluhmg0PIJMjksi1R9R4vcZX3QdOV3+lUNz6uEAuBvbmcyjIoZypeSRjfNfkppiDTMX F08+ezX8zh4GyC/KipeBwdwcqTxoEbMicFulRIVGOLfeZq8KG0Lsl1sAAb4OZ1jRTY5S 2o6bSEhVVY4UpCI5BIhnq7o0xKH5vVhpMZOabLzugrKVn+rddclWAiv6IUQ1pm4rCBr8 pqZQjOhR9eGX6nWUvxTW+K8/Fa1BJzPTap5ZriKErVCJtKeZ+roeK3tVMICyUasFN9iR h4ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17-v6si3277470plo.806.2018.01.25.23.37.57; Thu, 25 Jan 2018 23:38:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751738AbeAZHhd (ORCPT + 99 others); Fri, 26 Jan 2018 02:37:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52598 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750730AbeAZHhc (ORCPT ); Fri, 26 Jan 2018 02:37:32 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D33110570A; Fri, 26 Jan 2018 07:37:32 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-119.pek2.redhat.com [10.72.12.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4ED8E5EE1B; Fri, 26 Jan 2018 07:37:28 +0000 (UTC) Date: Fri, 26 Jan 2018 15:37:24 +0800 From: Dave Young To: Steven Rostedt Cc: Andi Kleen , pmladek@suse.com, sergey.senozhatsky@gmail.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, kexec@lists.infradead.org Subject: Re: [PATCH] print kdump kernel loaded status in stack dump Message-ID: <20180126073724.GA27220@dhcp-128-65.nay.redhat.com> References: <20180117045057.GA4994@dhcp-128-65.nay.redhat.com> <878tcvt592.fsf@linux.intel.com> <20180118135704.62d0f79f@gandalf.local.home> <20180119044719.GA3985@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180119044719.GA3985@dhcp-128-65.nay.redhat.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 26 Jan 2018 07:37:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/19/18 at 12:47pm, Dave Young wrote: > On 01/18/18 at 01:57pm, Steven Rostedt wrote: > > On Thu, 18 Jan 2018 10:02:17 -0800 > > Andi Kleen wrote: > > > > > Dave Young writes: > > > > printk("%sHardware name: %s\n", > > > > log_lvl, dump_stack_arch_desc_str); > > > > + if (kexec_crash_loaded()) > > > > + printk("%skdump kernel loaded\n", log_lvl); > > > > > > Oops/warnings are getting longer and longer, often scrolling away > > > from the screen, and if the kernel crashes backscroll does not work > > > anymore, so precious information is lost. > > > > > > Can you merge it with some other line? > > > > > > Just a [KDUMP] or so somewhere should be good enough. > > > > Or perhaps we should add it as a TAINT. Not all taints are bad. > > Hmm, I also thought about this before but It sounds like not match the > "tainted" meaning with the assumption that it is bad :( > > Maybe it would be better to do like Andi said, but print a better word > than "KDUMP", eg. "Kdumpable" sounds better. If this is fine I can > repost the patch. I have been not available recently, sorry for late about the update, rethinking about this, it is looks good to use "[KDUMP]". Also for the tainted flags, I tried but it is not what we want since kdump kernel can be unloaded, this is not like "tainted" which can only be added and it can not be removed. How about below version? --- It is useful to print kdump kernel loaded status in dump_stack() especially when panic happens so that we can differentiate kdump kernel early hang and a normal panic in a bug report. Signed-off-by: Dave Young --- [v1 -> v2] merge the status in other line as Andi Kleen suggested kernel/printk/printk.c | 3 +++ --- linux.orig/kernel/printk/printk.c +++ linux/kernel/printk/printk.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -3118,9 +3119,11 @@ void __init dump_stack_set_arch_desc(con */ void dump_stack_print_info(const char *log_lvl) { - printk("%sCPU: %d PID: %d Comm: %.20s %s %s %.*s\n", + printk("%sCPU: %d PID: %d Comm: %.20s %s %s %s %.*s\n", log_lvl, raw_smp_processor_id(), current->pid, current->comm, - print_tainted(), init_utsname()->release, + print_tainted(), + kexec_crash_loaded() ? "[KDUMP]" : "", + init_utsname()->release, (int)strcspn(init_utsname()->version, " "), init_utsname()->version);