Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp899528imm; Fri, 27 Jul 2018 08:01:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdN/hNaPmKONUXyYzM2D+zZxtruThroXQHjcxhCIjpezG00sokNaL0gSiKu2IMBrNgRijG6 X-Received: by 2002:a63:b213:: with SMTP id x19-v6mr6416936pge.393.1532703691236; Fri, 27 Jul 2018 08:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532703691; cv=none; d=google.com; s=arc-20160816; b=I+QN+a3KrCEgWF/LeETm/uh+iwee7dCVtkrvLe3HS5/sEqBEEiJSkEd7ZvTM2DGMB8 cb6eIuS7Xrgw5YJQfe8ebTVp84cJTwNwIwz+C10hCMLKSmxKY18JtvXIrpaMRx4uPdzz tCRIY0EpGmWgC3Z7Lkh4X2XCJkl5lna8zqc1ft+u0+jIe6qBQOkAOgHb7sfA2nkUUj7Q XEcVjI0yoeB8f5yaPrclHHH1ZOi+h5W32ZT4LVYALFiMopCDWIpWPsnEwEGq/OvL+DRX S6fcyYwZBvGPwXHja2q1gfMuznso21ACmjPWSLLjRxucUFy6n5FOmBcLXKt9/V0xyUh3 oETw== 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=fLPpB+m/9mo10jU1/2BDXfYou9lg+l+dXZlUm1fbGxs=; b=eBL/Gb2Nbb/uj0u6s88BLaYhMemaYtwZUpBaXscJn5YZSjJm0q0dSuLL7XBqzDh8pn fyk2D6qghG6gFT5QgaeBLuW8Mxpgn/xlwwjNZX01PZsk6nndch2dEr/zUTqSi+rhtCMP ovFx3EPN8GzTxZ8tmon0TaxUfzfQcZlyKt2HdC+M/l7/zoGY6tLcAcyHCxQm6YHJ3srq Gk+q7du5ZFSRvWvnlU/2mzTYfvqznHyuoQYppybdOY4VYyvjm6rHUP+NDCTzqo+hzi9b g72eDYcTuj7evkfVrzrg7HkGsibi3A6R5uwtEhesIutZpKbt6tih4RZftv1trKgMfKve E18g== 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 k64-v6si3679297pgd.3.2018.07.27.08.01.16; Fri, 27 Jul 2018 08:01:31 -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 S2388971AbeG0QWO (ORCPT + 99 others); Fri, 27 Jul 2018 12:22:14 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36104 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388955AbeG0QWO (ORCPT ); Fri, 27 Jul 2018 12:22:14 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6RExMh8138540 for ; Fri, 27 Jul 2018 10:59:56 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0b-001b2d01.pphosted.com with ESMTP id 2kg2ejrng1-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Jul 2018 10:59:55 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Jul 2018 10:59:55 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 27 Jul 2018 10:59:50 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6RExnNJ3539368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 27 Jul 2018 14:59:49 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE5EEAC05B; Fri, 27 Jul 2018 11:00:31 -0400 (EDT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0FB90AC059; Fri, 27 Jul 2018 11:00:26 -0400 (EDT) Received: from kermit-br-ibm-com.ibmmodules.com (unknown [9.80.82.251]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 27 Jul 2018 11:00:25 -0400 (EDT) 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" , 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 v2 10/10] powerpc/traps: Add line prefix in show_instructions() Date: Fri, 27 Jul 2018 11:58:11 -0300 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180727145811.12334-1-muriloo@linux.ibm.com> References: <20180727145811.12334-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: 18072714-2213-0000-0000-000002D0C58E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009438; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01066908; UDB=6.00548186; IPR=6.00844774; MB=3.00022354; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-27 14:59:54 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18072714-2214-0000-0000-00005AFBFFC5 Message-Id: <20180727145811.12334-11-muriloo@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-27_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=950 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807270154 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 00000000100007d0 nip 000000001000061c lr 00007fffbd295100 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 00000000100007d0 nip 000000001000061c lr 00007fff9f3e5100 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 709bfb524b84..25b6dfc8dd81 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