From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94512C43142 for ; Fri, 3 Aug 2018 01:22:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AF2821707 for ; Fri, 3 Aug 2018 01:22:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AF2821707 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732255AbeHCDQV (ORCPT ); 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-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);