Received: by 10.192.165.148 with SMTP id m20csp74803imm; Thu, 19 Apr 2018 16:27:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx48sV0sYvscwe0/AHNzlISZzyqvKyX/ed5R2RMHCBveiHCDGr+QDsVWoTlhj6grFAHeJS2Gj X-Received: by 10.98.58.209 with SMTP id v78mr6615593pfj.84.1524180422101; Thu, 19 Apr 2018 16:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524180422; cv=none; d=google.com; s=arc-20160816; b=cmKCbviUU/+PZ5FLttCUmVK4K/tiJZC6ik2yVRMUuQXDfL9oJyFstHqzpW5/LdFYij PFdtb7k+7fsazj0M+Yi/V6yMs12/zHYSGn5wbws9p267MYsMCjNWUTaSjQ6Dtyj848iP z+tbw0TN1pejA4+ZozkyvDQ2byj0p2RhsZcptLPRXoob00epMJGnp3QozWFOUlWDGA13 JbFxN0U0QzbtgPuYk6j1gOBEaNSKgkj6vFgXr5R9cGIj2K5hNSYyrhgmjIcItu+sjGmL cfo6hECLUnsaCTpQzHIokyFqgkEZ12JvsUue5GK6MYi75I4dsQ6r8Vg5NSn6vc9jgt3+ I5Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=X9k23gn1Tf0doBPgzLWWDLThvoUNKZ7WneMP7oZZiT8=; b=g3ylAIHZn8t/SL/JeJNTAi3BrKYLAb8yWgrYe3RGkZgFrf8gA3eAtYAiwmr2QPeSdW RnN7g383p8WZEJjV7UJQmS33BJy9Hgtap0AQsdVpMr8qKACZm9uYiOMhnLxFJ6sohvcw TsOGjHwy1reghPvoG7yApeksEMO75oy0xTkt5NH8xYQjIGpmY1hfcSV9OrEn9GSXTk58 RvceO4aFWxTY02uCDZzU+4Ds2hmCxt6HuLWznzpgk2ZrKebnxuXW/Yc7q+A8dzcj5sxW DYVZAaIRUgrNvKsWHTdHPV/QVxw72Nw8sdmBlLwynC8yJizYMnxaTwKdGGsysBmnq6Yp 1q+g== 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 m39-v6si4455919plg.570.2018.04.19.16.26.47; Thu, 19 Apr 2018 16:27:02 -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 S1753903AbeDSXZY (ORCPT + 99 others); Thu, 19 Apr 2018 19:25:24 -0400 Received: from exmail.andestech.com ([59.124.169.137]:15042 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753772AbeDSXZU (ORCPT ); Thu, 19 Apr 2018 19:25:20 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w3JNHr6U002593; Fri, 20 Apr 2018 07:17:53 +0800 (GMT-8) (envelope-from alankao@andestech.com) Received: from andestech.com (10.0.1.85) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Fri, 20 Apr 2018 07:24:18 +0800 Date: Fri, 20 Apr 2018 07:24:18 +0800 From: Alan Kao To: Atish Patra CC: Palmer Dabbelt , Albert Ou , "Peter Zijlstra" , Ingo Molnar , "Arnaldo Carvalho de Melo" , Alexander Shishkin , Jiri Olsa , "Namhyung Kim" , Alex Solomatnikov , "Jonathan Corbet" , "linux-riscv@lists.infradead.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Nick Hu , Greentime Hu Subject: Re: [PATCH v4 1/2] perf: riscv: preliminary RISC-V support Message-ID: <20180419232418.GA3902@andestech.com> References: <1524017523-25076-1-git-send-email-alankao@andestech.com> <1524017523-25076-2-git-send-email-alankao@andestech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.0.1.85] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w3JNHr6U002593 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 19, 2018 at 12:46:24PM -0700, Atish Patra wrote: > On 4/17/18 7:13 PM, Alan Kao wrote: > >This patch provide a basic PMU, riscv_base_pmu, which supports two > >general hardware event, instructions and cycles. Furthermore, this > >PMU serves as a reference implementation to ease the portings in > >the future. > > > >riscv_base_pmu should be able to run on any RISC-V machine that > >conforms to the Priv-Spec. Note that the latest qemu model hasn't > >fully support a proper behavior of Priv-Spec 1.10 yet, but work > >around should be easy with very small fixes. Please check > >https://github.com/riscv/riscv-qemu/pull/115 for future updates. > > > >Cc: Nick Hu > >Cc: Greentime Hu > >Signed-off-by: Alan Kao > >--- > > arch/riscv/Kconfig | 13 + > > arch/riscv/include/asm/perf_event.h | 79 ++++- > > arch/riscv/kernel/Makefile | 1 + > > arch/riscv/kernel/perf_event.c | 482 ++++++++++++++++++++++++++++ > > 4 files changed, 571 insertions(+), 4 deletions(-) > > create mode 100644 arch/riscv/kernel/perf_event.c > > > >diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > >index c22ebe08e902..90d9c8e50377 100644 > >--- a/arch/riscv/Kconfig > >+++ b/arch/riscv/Kconfig > Some check patch errors. > > ERROR: spaces required around that '>=' (ctx:WxV) > #517: FILE: arch/riscv/kernel/perf_event.c:356: > + if (riscv_pmu->irq >=0 && riscv_pmu->handle_irq) { > ^ > > ERROR: spaces required around that '>=' (ctx:WxV) > #529: FILE: arch/riscv/kernel/perf_event.c:368: > + if (riscv_pmu->irq >=0) { > ^ > > WARNING: braces {} are not necessary for single statement blocks > #529: FILE: arch/riscv/kernel/perf_event.c:368: > + if (riscv_pmu->irq >=0) { > + free_irq(riscv_pmu->irq, NULL); > + } > > WARNING: DT compatible string "riscv,base-pmu" appears un-documented -- > check ./Documentation/devicetree/bindings/ > #626: FILE: arch/riscv/kernel/perf_event.c:465: > + {.compatible = "riscv,base-pmu", .data = &riscv_base_pmu}, > > ERROR: trailing whitespace > #634: FILE: arch/riscv/kernel/perf_event.c:473: > +^I$ > > ERROR: do not use assignment in if condition > #635: FILE: arch/riscv/kernel/perf_event.c:474: > + if (node && (of_id = of_match_node(riscv_pmu_of_ids, node))) > > total: 4 errors, 3 warnings, 595 lines checked > > > Regards, > Atish Thanks for pointing this out. I happened to develop this patchset on a machine without the post-commit settings. A new version is ready.