Received: by 10.192.165.148 with SMTP id m20csp861703imm; Wed, 2 May 2018 09:57:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZod4zymPqR+EWcFLuO/hb+pHv2v3uG3lSeaY/efwn69salq/q6gGmk7wwuXUcle9sru/kkM X-Received: by 2002:a17:902:20eb:: with SMTP id v40-v6mr20664165plg.277.1525280251433; Wed, 02 May 2018 09:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525280251; cv=none; d=google.com; s=arc-20160816; b=XeDFV7jscBIQ5w06Mv/7O5o/kf5Mv+hRGfSiFUdvO6zgx4tMztMql3+ZXd1Py/ao7B WvgGZYT/PdzMJYHFMFYRQjUg0HwjmWko11IEbf89650b6aszqAP3CgiztlOXT6SlVd8W 5YHeW4TlAQ0a1zNeO0yHkDRzbsbZZfY1a8gnpq8j0vrV+GO/XO+XiRbqSQKXOxfWi5y6 CoiAnQQhqmgr5eAOelkhHbbGE1inD9NSdZiao9MXwkEqZDDxaCvSqdbZ6YLGR3G9qhOB R49uxADMIWqJ/pbOvrCtpp+pWXcXzNHdOTmO4c1nZBTEIg5YX7AVrm0pbUPHnww1J5Lj jmHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=NK1goBfo+9aLTyXcIspYQxh8MGLNWZRGsvpHMHGF3Hw=; b=Bgo9G/V9HyHFspp42NPkAENzkOETzdIXAon2SlUEH2idUgTCMgNAGuynd9abxihcvh cIvPCoOqR/Wr9wFQOyVgbS1xGzBGdsSljBRZjzwAeEsGu04Vp9bSXVy1y8naxO1VHE+b EsC0srRqHrH+CfCOmeboUug6+POLLV+rWU+Z29xdQFVtEl1Nc1MtWy8uwSM/hZ51LYtt L6a6OG4YG3RR7UY+wzS3WR+2dn2DcAh4Cqq95VVt/Gu+hykTDTwJwnVgofvPaIMAZulL 0FD/1mZW+QkRk/AEqFZ1WueHFfMvgfTuEWOWskUId1DiLjo4yOUDJ/gvwfCdyRvipn9R Kk0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hCGEWKZC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5-v6si11631736plj.86.2018.05.02.09.57.16; Wed, 02 May 2018 09:57: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; dkim=pass header.i=@linaro.org header.s=google header.b=hCGEWKZC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751856AbeEBQ44 (ORCPT + 99 others); Wed, 2 May 2018 12:56:56 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:56281 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751795AbeEBQ4w (ORCPT ); Wed, 2 May 2018 12:56:52 -0400 Received: by mail-wm0-f67.google.com with SMTP id a8so24008177wmg.5 for ; Wed, 02 May 2018 09:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NK1goBfo+9aLTyXcIspYQxh8MGLNWZRGsvpHMHGF3Hw=; b=hCGEWKZCLcWDnbEB8AiT1lWvGpbrA4Wl0mS4XnWFXMZm0+wOAlxu4STV/lHkR6xU/C hclqkWA1ddgYvPy/RNbE0RH3JUpz3YQCYXVhcwDbWf3L0WRo02viC7cN0nwfU2azVNCh lPAXzETog60emuMcEz4GaaNXq+Soek/fsMpOc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NK1goBfo+9aLTyXcIspYQxh8MGLNWZRGsvpHMHGF3Hw=; b=sDo/Q1mDW4UivqeRVbuiWqidgXKG7j7Van+8clxxqso57s/uqw76glvmNeDiDA7kh7 PH3Xl3zrt0xAhiS6zp0YRhA/hoJjXhm/cqfCXDemlDZ8Qmub5kab5HGbznm6O9Us0yQF v3fVwPUHl6NGpbgKMAiJ16ldvAGPsw/aknXoS4joV4to/HZvQ+Ryc+UH4zHZU59PAvhh 0NrPDDLMQwq8SpmzzOB4PSTtQjVFwVOZDF/E01B/cnYmbH8WUeUOLVWamEVnwUhH1WUz xRDCqM922yvbx3k+bdZPBAR3PnU1rUcuCoWweYptdAjHDbC3zXkejaMhp5i4UyMKhK55 ngvQ== X-Gm-Message-State: ALQs6tAKV/ebv+0LuRvX3Gg0H9LfFWMDnsG1sOE/kTg99tuY/OaE535Y 3iFlIn1ceRhd8EzBCpszlJX3UL68MXnBo27rt3w0rGjS X-Received: by 2002:a50:b003:: with SMTP id i3-v6mr26614734edd.293.1525280211277; Wed, 02 May 2018 09:56:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.164.161 with HTTP; Wed, 2 May 2018 09:56:50 -0700 (PDT) In-Reply-To: <1525237251-32496-1-git-send-email-leo.yan@linaro.org> References: <1525237251-32496-1-git-send-email-leo.yan@linaro.org> From: Mathieu Poirier Date: Wed, 2 May 2018 10:56:50 -0600 Message-ID: Subject: Re: [PATCH] coresight: Remove %px for printing pcsr value To: Leo Yan Cc: Jonathan Corbet , Alexander Shishkin , linux-arm-kernel , "open list:DOCUMENTATION" , linux-kernel@vger.kernel.org, Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1 May 2018 at 23:00, Leo Yan wrote: > The driver prints pcsr twice: the first time it uses specifier %px to > print hexadecimal pcsr value and the second time uses specifier %pS for > output kernel symbols. > > As suggested by Kees, using %pS should be sufficient and %px isn't > necessary; the reason is if the pcsr is a kernel space address, we can > easily get to know the code line from %pS format, on the other hand, if > the pcsr value doesn't fall into kernel space range (e.g. if the CPU is > stuck in firmware), %pS also gives out pcsr hexadecimal value. > > So this commit removes useless %px and update section "Output format" > in the document for alignment between the code and document. > > Suggested-by: Kees Cook > Cc: Mathieu Poirier > Signed-off-by: Leo Yan Applied - thanks, Mathieu > --- > Documentation/trace/coresight-cpu-debug.txt | 4 ++-- > drivers/hwtracing/coresight/coresight-cpu-debug.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt > index 2b9b51c..89ab09e 100644 > --- a/Documentation/trace/coresight-cpu-debug.txt > +++ b/Documentation/trace/coresight-cpu-debug.txt > @@ -177,11 +177,11 @@ Here is an example of the debugging output format: > ARM external debug module: > coresight-cpu-debug 850000.debug: CPU[0]: > coresight-cpu-debug 850000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) > -coresight-cpu-debug 850000.debug: EDPCSR: [] handle_IPI+0x174/0x1d8 > +coresight-cpu-debug 850000.debug: EDPCSR: handle_IPI+0x174/0x1d8 > coresight-cpu-debug 850000.debug: EDCIDSR: 00000000 > coresight-cpu-debug 850000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) > coresight-cpu-debug 852000.debug: CPU[1]: > coresight-cpu-debug 852000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) > -coresight-cpu-debug 852000.debug: EDPCSR: [] debug_notifier_call+0x23c/0x358 > +coresight-cpu-debug 852000.debug: EDPCSR: debug_notifier_call+0x23c/0x358 > coresight-cpu-debug 852000.debug: EDCIDSR: 00000000 > coresight-cpu-debug 852000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) > diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hwtracing/coresight/coresight-cpu-debug.c > index 9cdb3fb..78a054e 100644 > --- a/drivers/hwtracing/coresight/coresight-cpu-debug.c > +++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c > @@ -315,7 +315,7 @@ static void debug_dump_regs(struct debug_drvdata *drvdata) > } > > pc = debug_adjust_pc(drvdata); > - dev_emerg(dev, " EDPCSR: [<%px>] %pS\n", (void *)pc, (void *)pc); > + dev_emerg(dev, " EDPCSR: %pS\n", (void *)pc); > > if (drvdata->edcidsr_present) > dev_emerg(dev, " EDCIDSR: %08x\n", drvdata->edcidsr); > -- > 2.7.4 >