Received: by 10.192.165.156 with SMTP id m28csp722688imm; Tue, 17 Apr 2018 19:13:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/bcuVF6SnoItRDRsRb2WOxEy5d9dCBRc3YaSjFuXNUVySOshY4rcwe3hyJT+eSvikd33Qo X-Received: by 10.98.131.69 with SMTP id h66mr177787pfe.255.1524017622506; Tue, 17 Apr 2018 19:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524017622; cv=none; d=google.com; s=arc-20160816; b=fiLf1g9rzuadzPtl6j4QqC7loAGCkC4VHmEoWKzOX/fqkdDpsApgkB7fdz67o9Ka87 LNyWhNn/MMr39x0S2HpxIevx2fVj5eWQm20rLzhO/0TgAC6ETOZgv9Mog+KjkRDynTGk g7Z4LORNlJLSEAtjZcgsJ0qpj/PySY4CAUJY0HAivLe1oByaJ8itN1ZYLMRLISGD5Svm gPBf/UZjr8y2x7ThiavXdWhMzj3HBLr1fwNYl/4yfxp2ePUcMyWtxFNyvMXHj6JkFJfP ovnkvYqliUEOMcl417j8zDtVFLwR4AIj++2MXH7ws43X9ImT+Fyxl2PFGj/8bDbAESZn GI4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=HaWQPbK58zi5upL6RXd9wUXl/zmHkNBv6YIL0zLRNHo=; b=pyKczkdqKh7xZOwIFwhxmCA1DoUWzoebe0odjtZuwi2be3p3/Nb5+P7Iwp7APkhWG/ a7P5eTaDROVVbYCGa2AVYHG55svCaA/14zb1zgCkDZLeR1lHaZLmK88qI0Mt5VDOOv9V pGiyrKIP0fWM3sHEz+m3474yiDrbwNOwepXqF5MKpiMZKQU0n6Gs7WZ+0rMX1x4dc8c7 +gCo9DOp3qimPj7SVnKYcuGtSmqrk0lZbdTlHkD0x/wkc1zza95+9o5S0R7MC2jL/gMU MFrYB1cqNTcE0iTorqxLMx4gRLOuzNOiV+HvosiscsyIGqGZJnkVYTHtn/rJpCj6xdL7 wseQ== 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 a68si200968pfk.35.2018.04.17.19.13.27; Tue, 17 Apr 2018 19:13:42 -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 S1753368AbeDRCMQ (ORCPT + 99 others); Tue, 17 Apr 2018 22:12:16 -0400 Received: from exmail.andestech.com ([59.124.169.137]:24270 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752841AbeDRCMP (ORCPT ); Tue, 17 Apr 2018 22:12:15 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w3I25lB5000152; Wed, 18 Apr 2018 10:05:47 +0800 (GMT-8) (envelope-from alankao@andestech.com) Received: from atcsqa06.andestech.com (10.0.1.85) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Wed, 18 Apr 2018 10:12:05 +0800 From: Alan Kao To: Palmer Dabbelt , Albert Ou , "Peter Zijlstra" , Ingo Molnar , "Arnaldo Carvalho de Melo" , Alexander Shishkin , Jiri Olsa , "Namhyung Kim" , Alex Solomatnikov , "Jonathan Corbet" , , , CC: Alan Kao , Greentime Hu , Nick Hu Subject: [PATCH v4 0/2] perf: riscv: Preliminary Perf Event Support on RISC-V Date: Wed, 18 Apr 2018 10:12:01 +0800 Message-ID: <1524017523-25076-1-git-send-email-alankao@andestech.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.1.85] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w3I25lB5000152 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This implements the baseline PMU for RISC-V platforms. To ease future PMU portings, a guide is also written, containing perf concepts, arch porting practices and some hints. Changes in v4: - Fix several compilation errors. Sorry for that. - Raise a warning in the write_counter body. Changes in v3: - Fix typos in the document. - Change the initialization routine from statically assigning PMU to device-tree-based methods, and set default to the PMU proposed in this patch. Changes in v2: - Fix the bug reported by Alex, which was caused by not sufficient initialization. Check https://lkml.org/lkml/2018/3/31/251 for the discussion. Alan Kao (2): perf: riscv: preliminary RISC-V support perf: riscv: Add Document for Future Porting Guide Documentation/riscv/pmu.txt | 249 ++++++++++++++ arch/riscv/Kconfig | 13 + arch/riscv/include/asm/perf_event.h | 79 ++++- arch/riscv/kernel/Makefile | 1 + arch/riscv/kernel/perf_event.c | 482 ++++++++++++++++++++++++++++ 5 files changed, 820 insertions(+), 4 deletions(-) create mode 100644 Documentation/riscv/pmu.txt create mode 100644 arch/riscv/kernel/perf_event.c -- 2.17.0