Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1324929ima; Wed, 24 Oct 2018 19:27:09 -0700 (PDT) X-Google-Smtp-Source: AJdET5e3ozVv0AFU46HE3zeugoNug4q9D1TQGbgCtXiah9jUjTCIt4aWUf95OEBEoWg7S/2ueHG/ X-Received: by 2002:a65:664e:: with SMTP id z14-v6mr4656580pgv.347.1540434429417; Wed, 24 Oct 2018 19:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540434429; cv=none; d=google.com; s=arc-20160816; b=xiW+9f/KAAktV9vnYIF6srvPDTC5Xkv+wmnIFWIiFel84hg8zmp7ZvFcEQl8s1MT/v OXkpLv3vn8WGoqaol/yXkuk2KqQDq9hmJR2tEboT/DRvL+ORprsuVB9UhUQJQovgNCcS jSFWiUAbeb7iewX2EJv0gtK/9d11BmxFL8S1xE0c639BXYXVcRHp5UJ/2UYdiUOPU/vq DTXpeCK4EPupWJ9QkqlG1Lh8BpYLjKDtYMYVEiwbeoW7Ff7L5OBLu8AkalIFqM0Lrvy9 z7yFNbSdknxsi1WyqYZNKyzP6qQ4Ct8Z1HUwrfUDA9rjBY7zBAzah1cg3919CKnSJDq/ 01+A== 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; bh=T2QKMBuWpqP/grN6gjQxGoHM3x/KHSIf9nuF7MERwLg=; b=epQK0FVvwTPltk+5MHFp2cZuI5DTWCaR93m58dn0fsODUfS8iZcGUl56NR1lbnmMQh SflAGghGOwE7F92gD/GYTsK0oFHD/EVeBm71Q5qLgeA6auD3VyPPNhgNCJbp5Rdmhb7D eSuVUGUN4RwICGHeXtncVe5z1frqbfeCLuQrckd4AtUbvVSPtvSjIlHK5SIEzNGsmb5h IV6gEPcq/obfNZvX7GqEvMJ5fUNv26Voh4p14qDaMtt9tpgEM0VWqNtITzdQanxb7moA 1kUiiHrGUo8NrORxdC+FobnXlf4UNw0N/7NdUlN0+ToCv19sq7QgQycdZG/+5tQuVjNL +E8g== 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 b13-v6si6438793pgg.89.2018.10.24.19.26.52; Wed, 24 Oct 2018 19:27:09 -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 S1727201AbeJYK5L (ORCPT + 99 others); Thu, 25 Oct 2018 06:57:11 -0400 Received: from 59-120-53-16.HINET-IP.hinet.net ([59.120.53.16]:43141 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726344AbeJYK5L (ORCPT ); Thu, 25 Oct 2018 06:57:11 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w9P2Q13m070247; Thu, 25 Oct 2018 10:26:01 +0800 (GMT-8) (envelope-from nickhu@andestech.com) Received: from atcsqa06.andestech.com (10.0.15.65) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Thu, 25 Oct 2018 10:24:35 +0800 From: Nick Hu To: , , , , , , , , , , , , , , , , , , , , , , CC: Nick Hu , Subject: [PATCH v4 0/4] nds32: Perf support Date: Thu, 25 Oct 2018 10:24:13 +0800 Message-ID: X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.15.65] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w9P2Q13m070247 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These four commits are perf supporting for nds32. There are three perfomance counters in nds32, and each of them can counts different events. You can use 'perf list' to show the available events that can be used. Changes in V2: 1. Change the definition 'PFM_CTL_xxx' to array form. 2. Simplify the PMU driver. 3. Stop all counters when handling irq caused by performance counters overflow. 4. Rename the compatible string in devicetree. Changes in V3: Fix the typo in Documentation/devicetree/ bindings/nds32/pmu.txt. Changes in V4: Move 'Documentation/devicetree/bindings/nds32/pmu.txt' to 'Documentation/devicetree/bindings/perf/nds32v3-pmu.txt'. Nickhu (4): nds32: Fix bug in bitfield.h nds32: Perf porting nds32: Add perf call-graph support. nds32: Add document for NDS32 PMU. .../devicetree/bindings/perf/nds32v3-pmu.txt | 17 + arch/nds32/Kconfig | 1 + arch/nds32/boot/dts/ae3xx.dts | 5 + arch/nds32/include/asm/Kbuild | 1 + arch/nds32/include/asm/bitfield.h | 4 +- arch/nds32/include/asm/perf_event.h | 16 + arch/nds32/include/asm/pmu.h | 386 +++++ arch/nds32/include/asm/stacktrace.h | 39 + arch/nds32/kernel/Makefile | 3 +- arch/nds32/kernel/perf_event_cpu.c | 1522 +++++++++++++++++ arch/nds32/mm/fault.c | 13 +- tools/include/asm/barrier.h | 2 + tools/perf/arch/nds32/Build | 1 + tools/perf/arch/nds32/util/Build | 1 + tools/perf/arch/nds32/util/header.c | 29 + tools/perf/pmu-events/arch/nds32/mapfile.csv | 15 + .../pmu-events/arch/nds32/n13/atcpmu.json | 290 ++++ 17 files changed, 2337 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/perf/nds32v3-pmu.txt create mode 100644 arch/nds32/include/asm/perf_event.h create mode 100644 arch/nds32/include/asm/pmu.h create mode 100644 arch/nds32/include/asm/stacktrace.h create mode 100644 arch/nds32/kernel/perf_event_cpu.c create mode 100644 tools/perf/arch/nds32/Build create mode 100644 tools/perf/arch/nds32/util/Build create mode 100644 tools/perf/arch/nds32/util/header.c create mode 100644 tools/perf/pmu-events/arch/nds32/mapfile.csv create mode 100644 tools/perf/pmu-events/arch/nds32/n13/atcpmu.json -- 2.17.0