Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5247529imm; Tue, 31 Jul 2018 07:52:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpddcFLNMhWj+RopVvTJkG7vGCNG7jNaMVy/uyv2XJrXr/96LHCaUu1G2m5RKxQHmlL3XDuV X-Received: by 2002:a63:e718:: with SMTP id b24-v6mr11746477pgi.224.1533048765537; Tue, 31 Jul 2018 07:52:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533048765; cv=none; d=google.com; s=arc-20160816; b=VVzXDyv7a9SVGHA7Iwg3hAGdLK/SOqKpfNZ3sKf+zT/J2HL9UG2ynAunXRfvQPcUeV /keKZbFQm20OiWNF/L2mQXDHRYVwJuwWTAEDNHTK/eq5ZzdgaR9FMD9tMPMIClUDWG4m EzeqqRqr9O038o6tCuTfjLbjsA86aiuPZE88e8KvqJtda8EIl/kpD6uiNXmAf/ny84JI KVqfi145aKCR5BT5VgWS9Ac36ia+bD7nvJElBJNeJ8WeH/R/qTZnxk6/uyLcB+TBNCRJ 2PD6jGJmOrnGH7C4SNMf6yp2qQIXuAFz6x5YLVx0aJP7YFg5Un6PLiWAFhKDU2ZFBvEd M3Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=1FM6P1HiPwZ/4OzIfPwSYKUnWpNfbescMQ3qZ2j64UE=; b=C1Vc70NOiQnSryHdtp4p28V76qD15LRf3txtmwMH9/qjIiqFfnv9JpOTKXEaqR8ZnU ZP4eauBNQR9xBhiVPGtV7/eR9faJXFT4zoLtZVkMPcDKtNabHCCKQjukHHpMmdGdskqt fF5f5N9hWgbRvfSGYhGn4XlEMg9vh96wQaPfiCN2T3jRsY5C8RnKugsGbdexMCpUZKyh h+ueTnTJQ4ZxubuP1Xj+GquJz4+c9nhtsJHfh7EswNk6WCDmaPIsfh8shRwRE2slPb1M /Jl4QOUaDDioL4VQN4kRA4oo2R4xtKQ3958MwTU7gv/Twtj995635G9eVDlpHws4LGY3 QNNA== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n72-v6si14107654pfk.14.2018.07.31.07.52.31; Tue, 31 Jul 2018 07:52:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732660AbeGaQcB (ORCPT + 99 others); Tue, 31 Jul 2018 12:32:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43994 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732443AbeGaQcB (ORCPT ); Tue, 31 Jul 2018 12:32:01 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6VE95n9118031 for ; Tue, 31 Jul 2018 10:51:19 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kjr2snb0w-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 31 Jul 2018 10:51:18 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Jul 2018 08:51:18 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 31 Jul 2018 08:51:13 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6VEpCtr11927966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 31 Jul 2018 07:51:12 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C2C3BE056; Tue, 31 Jul 2018 08:51:12 -0600 (MDT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 186EFBE054; Tue, 31 Jul 2018 08:51:09 -0600 (MDT) Received: from kermit-br-ibm-com.br.ibm.com (unknown [9.18.235.193]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 31 Jul 2018 08:51:08 -0600 (MDT) From: Murilo Opsfelder Araujo To: linux-kernel@vger.kernel.org Cc: "Alastair D'Silva" , Andrew Donnellan , Balbir Singh , Benjamin Herrenschmidt , Christophe Leroy , Cyril Bur , "Eric W . Biederman" , Joe Perches , Michael Ellerman , Michael Neuling , Murilo Opsfelder Araujo , Nicholas Piggin , Paul Mackerras , Simon Guo , Sukadev Bhattiprolu , "Tobin C . Harding" , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 9/9] powerpc/traps: Add line prefix in show_instructions() Date: Tue, 31 Jul 2018 11:50:20 -0300 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180731145020.14009-1-muriloo@linux.ibm.com> References: <20180731145020.14009-1-muriloo@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18073114-0004-0000-0000-0000146B706F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009463; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01068484; UDB=6.00549299; IPR=6.00846683; MB=3.00022427; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-31 14:51:17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18073114-0005-0000-0000-00008847E760 Message-Id: <20180731145020.14009-10-muriloo@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-31_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=957 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807310137 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 -- 2.17.1