Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp492025imm; Tue, 31 Jul 2018 23:42:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfJz4/tsrUbcCVAqe4KwdUIr1YQdfoSqI4i0K1jAhTnmyyeHdALSUI7dORKPH+G7Lt0GOn7 X-Received: by 2002:a63:41c6:: with SMTP id o189-v6mr23834980pga.323.1533105741307; Tue, 31 Jul 2018 23:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533105741; cv=none; d=google.com; s=arc-20160816; b=gR0V7AVbNn58jE4X8ay/QxeP8odnxfqcnTQng9wtwWHAqa41OBbdflZsiMWKDASQoQ uM8aHdMAGSsyBwnP3hMRyLag9LoQhBoNhVuFaNSvX4cRIQq99y33pCYRCD/LBnn7VR3w w8W7sA35cdORMlrJY0PcTErftitdwWHiG9iojmy7GHEORWN6JZgL2ba2XEktTJDCCG1i CsS1gKGg6XnMAsm/9ZJCPqCm8VnFev2o33uEYUCCTPu+d5SoPtZSmzjqQqfcmMdPvCC2 /lnd/w3G93DRDBuECN0fr8D4T57N+n/wJb8y6D83f8e/onQugf06gbHgQPKBC2khocSR IlZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=4L3GnV5ZbvYgs3sSSHuBZfC8n2Khh++IRJFUlm5P6Ms=; b=S+maeDyjf7XhSWm5lL/2pe9Tz/5tmeCLGzYk/1ILcqk/FJEgYTunezgv9R/X2kP64u cade7Au7DNvnryJcsvIqVYeLqzViM0AMNxPVIgHPYR+imUfJFYum+uWL5PkuAAo714yy GjIfcjIB+2MwCI7OZfUWeD2Dhfen+P/20Qwqx5y+ZlhA6Fy3AoT9tUx1+CK41SwKVcx0 BdH5XfEPtiSryMvaxuVDug8S+ZE0+867CxuwZiex5sq9zZclq3zH1NTJzBVO41tSCz/v nVapXCg8RGvIq/spzDFp6Iuvgyzxr9iNNnZ+QyzFzpcFKU3FuOPl7NcGStG6b1wswq93 3Cwg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g80-v6si16314630pfk.53.2018.07.31.23.42.06; Tue, 31 Jul 2018 23:42:21 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387481AbeHAIZ0 (ORCPT + 99 others); Wed, 1 Aug 2018 04:25:26 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:45679 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387444AbeHAIZZ (ORCPT ); Wed, 1 Aug 2018 04:25:25 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 41gNxD1tl7z9tvqG; Wed, 1 Aug 2018 08:41:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id O-ZKHwjXjArW; Wed, 1 Aug 2018 08:41:04 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 41gNxD11zyz9tvq9; Wed, 1 Aug 2018 08:41:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 53D8D8B82B; Wed, 1 Aug 2018 08:41:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id puN93dSAn-Wv; Wed, 1 Aug 2018 08:41:16 +0200 (CEST) Received: from PO15451 (po15451.idsi0.si.c-s.fr [172.25.231.4]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CDD4C8B756; Wed, 1 Aug 2018 08:41:15 +0200 (CEST) Subject: Re: [PATCH v3 9/9] powerpc/traps: Add line prefix in show_instructions() To: Murilo Opsfelder Araujo , linux-kernel@vger.kernel.org Cc: Alastair D'Silva , Andrew Donnellan , Balbir Singh , Benjamin Herrenschmidt , Cyril Bur , "Eric W . Biederman" , Joe Perches , Michael Ellerman , Michael Neuling , Nicholas Piggin , Paul Mackerras , Simon Guo , Sukadev Bhattiprolu , "Tobin C . Harding" , linuxppc-dev@lists.ozlabs.org References: <20180731145020.14009-1-muriloo@linux.ibm.com> <20180731145020.14009-10-muriloo@linux.ibm.com> From: Christophe LEROY Message-ID: Date: Wed, 1 Aug 2018 08:41:15 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180731145020.14009-10-muriloo@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 31/07/2018 à 16:50, Murilo Opsfelder Araujo a écrit : > Remove "Instruction dump:" line by adding a prefix to display current->comm > and current->pid, along with the instructions dump. > > The prefix can serve as a glue that links the instructions dump to its > originator, allowing messages to be interleaved in the logs. > > Before this patch, a page fault looked like: > > pandafault[10524]: segfault (11) at 100007d0 nip 1000061c lr 7fffbd295100 code 2 in pandafault[10000000+10000] > Instruction dump: > 4bfffeec 4bfffee8 3c401002 38427f00 fbe1fff8 f821ffc1 7c3f0b78 3d22fffe > 392988d0 f93f0020 e93f0020 39400048 <99490000> 39200000 7d234b78 383f0040 > > After this patch, it looks like: > > pandafault[10850]: segfault (11) at 100007d0 nip 1000061c lr 7fff9f3e5100 code 2 in pandafault[10000000+10000] > pandafault[10850]: code: 4bfffeec 4bfffee8 3c401002 38427f00 fbe1fff8 f821ffc1 7c3f0b78 3d22fffe > pandafault[10850]: code: 392988d0 f93f0020 e93f0020 39400048 <99490000> 39200000 7d234b78 383f0040 > > Signed-off-by: Murilo Opsfelder Araujo Does the script scripts/decode_stacktrace.sh also works with this format change ? > --- > arch/powerpc/kernel/process.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c > index e78799a8855a..d12143e7d8f9 100644 > --- a/arch/powerpc/kernel/process.c > +++ b/arch/powerpc/kernel/process.c > @@ -1265,16 +1265,19 @@ static int instructions_to_print = 16; > void show_instructions(struct pt_regs *regs) > { > int i; > + const char *prefix = KERN_INFO "%s[%d]: code: "; > unsigned long pc = regs->nip - (instructions_to_print * 3 / 4 * > sizeof(int)); > > - printk("Instruction dump:"); > + printk(prefix, current->comm, current->pid); > > for (i = 0; i < instructions_to_print; i++) { > int instr; > > - if (!(i % 8)) > + if (!(i % 8) && (i > 0)) { > pr_cont("\n"); > + printk(prefix, current->comm, current->pid); > + } > > #if !defined(CONFIG_BOOKE) > /* If executing with the IMMU off, adjust pc rather >