Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp264907pxb; Wed, 18 Aug 2021 01:37:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgTLgr5qkQ7Fcb1EGu5wh2pKgmDuye7BS9pnbszabBT44AikguL5goxiSkO9FBPy6gU1F/ X-Received: by 2002:a02:a409:: with SMTP id c9mr6809433jal.138.1629275872128; Wed, 18 Aug 2021 01:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629275872; cv=none; d=google.com; s=arc-20160816; b=xc/rIeE2cFTWVw8vlZ3xaf2mdH6vEziPLDkzSK+RqsiDcrvNz8CvIbdvYr+w+54y8K 3l99efk5nzqNBD8SSxbpdWsCjy2J0FRtUyWgFybCDTSGGGKUITcOvAkkPFZ4wTpAnOed v8K8ooDpoENdpvNrHBW/LjVj3q82HxNk92lS5qQFgbhb+MmT2xrjqwL/IdkPA+q/1MJx QyxZSKZP/bH0u/pG03CruksAVH8yZ0LEctkieqpXxDqrGHgw9RoeYyk3i1sJMqt9pCSp /5zFQ2ZAcr4g350qBGUIJnHqH+qw7TwhEHSozm+1Fby5tBfCikjUyla20G7EJ82GfDiG zX6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=BM1NuRJBOorU716W91OHoJ+TVEAMPyukrn21tSByWWI=; b=IQLmnf+dQNMiF0/O9Im8eiYkYL911jKEKPE6fDu7+9rKvVNEeDnHdoIPAVmpK8Ah2R dpv2c27tJSpPy8NACrveLhfl4foQtXXRXLOHhvUDZxgIgXdyLy7rHHCeLZ7a6JeBqk3S 3ZGaB82v/RN1/+qafp5SXQrte68iz37bCtKfgBj+gpBvpkv0RxAI7dpYL5hF79jgua0b Tonr1N+yz0YFvjBYfsqd+VT3XzcrJLiPTQS2WHCymM1HvHfUG/DrnCUiEE6fQy4v5Fv6 qTQbA+zuG4PnRskGt2B7HQEWxavYCpMiB+g/X5mHQAJzDKh+8QZ8r8nVY4zmwhuaxsW/ 6OXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si5405914jaa.25.2021.08.18.01.37.41; Wed, 18 Aug 2021 01:37:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238168AbhHRIhS (ORCPT + 99 others); Wed, 18 Aug 2021 04:37:18 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:13439 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238947AbhHRIhQ (ORCPT ); Wed, 18 Aug 2021 04:37:16 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GqLkZ6bnpzdZgp; Wed, 18 Aug 2021 16:32:54 +0800 (CST) Received: from dggema757-chm.china.huawei.com (10.1.198.199) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 18 Aug 2021 16:36:39 +0800 Received: from localhost.localdomain (10.67.165.2) by dggema757-chm.china.huawei.com (10.1.198.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 18 Aug 2021 16:36:39 +0800 From: Qi Liu To: , , CC: , , , , Subject: [PATCH v9 0/2] drivers/perf: hisi: Add support for PCIe PMU Date: Wed, 18 Aug 2021 13:12:44 +0800 Message-ID: <20210818051246.29545-1-liuqi115@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggema757-chm.china.huawei.com (10.1.198.199) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds support for HiSilicon PCIe Performance Monitoring Unit(PMU). It is a PCIe Root Complex integrated End Point(RCiEP) device added on Hip09. Each PCIe Core has a PMU RCiEP to monitor multi root ports and all Endpoints downstream these root ports. HiSilicon PCIe PMU is supported to collect performance data of PCIe bus, such as: bandwidth, latency etc. Example usage of counting PCIe rx memory write latency:: $# perf stat -e hisi_pcie0_core0/rx_mwr_latency/ $# perf stat -e hisi_pcie0_core0/rx_mwr_cnt/ $# perf stat -g -e hisi_pcie0_core0/rx_mwr_latency/ -e hisi_pcie0_core0/rx_mwr_cnt/ average rx memory write latency can be calculated like this: latency = rx_mwr_latency / rx_mwr_cnt. Common PMU events and metrics will be described in JSON file, and will be add in userspace perf tool latter. Changes since v8: - Remove subevent parameter in attr->config. - Check the counter scheduling constraints when accepting an event group. - Link: https://lore.kernel.org/linux-arm-kernel/20210728080932.72515-1-liuqi115@huawei.com/ Changes since v7: - Drop headerfile cpumask.h and cpuhotplug.h. - Rename events in perf list: bw->flux, lat->delay, as driver doesn't process bandwidth and average latency data. - Link: https://lore.kernel.org/linux-arm-kernel/1624532384-43002-1-git-send-email-liuqi115@huawei.com/ Changes since v6: - Move the driver to drivers/perf/hisilicon. - Treat content in PMU counter and ext_counter as different PMU events, and export them separately. - Address the comments from Will and Krzysztof. - Link: https://lore.kernel.org/linux-arm-kernel/1622467951-32114-1-git-send-email-liuqi115@huawei.com/ Changes since v5: - Fix some errors when build under ARCH=xtensa. - Link: https://lore.kernel.org/linux-arm-kernel/1621946795-14046-1-git-send-email-liuqi115@huawei.com/ Changes since v4: - Replace irq_set_affinity_hint() with irq_set_affinity(). - Link: https://lore.kernel.org/linux-arm-kernel/1621417741-5229-1-git-send-email-liuqi115@huawei.com/ Changes since v3: - Fix some warnings when build under 32bits architecture. - Address the comments from John. - Link: https://lore.kernel.org/linux-arm-kernel/1618490885-44612-1-git-send-email-liuqi115@huawei.com/ Changes since v2: - Address the comments from John. - Link: https://lore.kernel.org/linux-arm-kernel/1617959157-22956-1-git-send-email-liuqi115@huawei.com/ Changes since v1: - Drop the internal Reviewed-by tag. - Fix some build warnings when W=1. - Link: https://lore.kernel.org/linux-arm-kernel/1617788943-52722-1-git-send-email-liuqi115@huawei.com/ Qi Liu (2): docs: perf: Add description for HiSilicon PCIe PMU driver drivers/perf: hisi: Add driver for HiSilicon PCIe PMU .../admin-guide/perf/hisi-pcie-pmu.rst | 106 ++ Documentation/admin-guide/perf/index.rst | 1 + MAINTAINERS | 2 + drivers/perf/hisilicon/Kconfig | 9 + drivers/perf/hisilicon/Makefile | 2 + drivers/perf/hisilicon/hisi_pcie_pmu.c | 972 ++++++++++++++++++ include/linux/cpuhotplug.h | 1 + 7 files changed, 1093 insertions(+) create mode 100644 Documentation/admin-guide/perf/hisi-pcie-pmu.rst create mode 100644 drivers/perf/hisilicon/hisi_pcie_pmu.c -- 2.17.1