Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp256874imm; Thu, 2 Aug 2018 18:24:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpexnxf+yPpnxyoXU+LdyJu9+O7eBsHgOJqFKjle+WBAW07ISMHv2VbtueCk75vPEmFSGXqg X-Received: by 2002:a17:902:583:: with SMTP id f3-v6mr1550840plf.115.1533259491296; Thu, 02 Aug 2018 18:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533259491; cv=none; d=google.com; s=arc-20160816; b=w/2qLwhAuxh+No7EvwjWosUiNhyFU9yW3yfqTC7tYJqmXsuVbuQKm2ET9UguWSxVCy gACrtPdzxrKu3KrbCPoC33ZBOTNaOwo6OF6QBVxEKR7z0UbnlaYWyWsTE70Rw1nPcWpt uv9I7lDGkIuAXGQ1A02N94kdJlo23JZkuTAZffUZo/YC3pTR2bHObkSZc3xlTYO3Eo0q dyKzENgEZM7us3AKDOBtholiLwx0clkDvpJ4mNUE2K6Uk+inu7k4k+pQB2yeYf3CCyvc LDZyQAhdf2MN+lOIOl5LJPEXdxIPH+OYkPw+0hkcflk5qTJMyNo0e4GQNsgcRu1jXLMy IkLA== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=7iDithPguKBYZf340K5KDvTX4fEIzV//jBSldDljvqA=; b=jXosNUagsWcyM3QtOu4HWjv5pg30ouidCqwN2ozpEoPyzH4icQYlF6ZwmufpslZG7P y6wnavoIjsDece6Q6p1LOFvvpGOQZZvq2Qv0CC3ueTDHzsWuFHbgxeWeNBZ3RzFzolgA C0kN/ck/YMcuQecrID6RppxQ8A5AqQbhN3C62R7CUWnOJWgrFGsU3T9u3B4EYavVF0Mf CEQuMbCbv7/mz6YfusQmmDtj3UW5le7Zux28kO/v9ASnuuWRwm0jTZ1sQqFIuLtxaGs0 kGiwoSwC+9yJk+pdUaYfgwyp/wX7lL5n6hi21wud7kvqS7HwTFhVCYYXrGv0FZIckj6v +dVw== 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 u64-v6si3650336pgu.533.2018.08.02.18.24.36; Thu, 02 Aug 2018 18:24:51 -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 S1732242AbeHCDQV (ORCPT + 99 others); Thu, 2 Aug 2018 23:16:21 -0400 Received: from smtprelay0036.hostedemail.com ([216.40.44.36]:56355 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731831AbeHCDQV (ORCPT ); Thu, 2 Aug 2018 23:16:21 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 664FF100E86C0; Fri, 3 Aug 2018 01:22:33 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::::,RULES_HIT:41:152:355:379:541:599:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:2393:2559:2562:3138:3139:3140:3141:3142:3352:3622:3866:3868:3870:3871:3872:4321:4605:5007:6119:6742:7903:10004:10400:10848:11026:11232:11658:11914:12043:12114:12296:12438:12740:12895:13069:13311:13357:13894:14659:14721:21080:21451:21611:21627:30012:30054:30056:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:38,LUA_SUMMARY:none X-HE-Tag: night86_3301e0c33983f X-Filterd-Recvd-Size: 2628 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf10.hostedemail.com (Postfix) with ESMTPA; Fri, 3 Aug 2018 01:22:30 +0000 (UTC) Message-ID: Subject: Re: [PATCH v4 5/6] powerpc: Add show_user_instructions() From: Joe Perches To: Murilo Opsfelder Araujo , Christophe LEROY Cc: linux-kernel@vger.kernel.org, Alastair D'Silva , Andrew Donnellan , Balbir Singh , Benjamin Herrenschmidt , Cyril Bur , "Eric W . Biederman" , Michael Ellerman , Michael Neuling , Nicholas Piggin , Paul Mackerras , Simon Guo , Sukadev Bhattiprolu , "Tobin C . Harding" , linuxppc-dev@lists.ozlabs.org, Segher Boessenkool Date: Thu, 02 Aug 2018 18:22:29 -0700 In-Reply-To: <20180803004201.GA5891@kermit-br-ibm-com> References: <20180801213320.11203-1-muriloo@linux.ibm.com> <20180801213320.11203-6-muriloo@linux.ibm.com> <7209fa95-8d40-14ca-f27a-ce3edb64191e@c-s.fr> <20180803004201.GA5891@kermit-br-ibm-com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-08-02 at 21:42 -0300, Murilo Opsfelder Araujo wrote: > > > diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c [] > > > @@ -1299,6 +1299,46 @@ static void show_instructions(struct pt_regs *regs) > > > pr_cont("\n"); > > > } > > > +void show_user_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(prefix, current->comm, current->pid); > > > > Why not use pr_info() and remove KERN_INFO from *prefix ? > > Because it doesn't compile: > > arch/powerpc/kernel/process.c:1317:10: error: expected ‘)’ before ‘prefix’ > pr_info(prefix, current->comm, current->pid); > ^ > ./include/linux/printk.h:288:21: note: in definition of macro ‘pr_fmt’ > #define pr_fmt(fmt) fmt > ^ What being suggested is using: pr_info("%s[%d]: code: ", current->comm, current->pid);