Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2498075pxb; Fri, 29 Oct 2021 02:38:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyDZIjpDtYDZhyU3FigTYWj0Ti5OFSDngUUJ1OPRnij0ToG71ssUk88dxqn07dUlVqOkRy X-Received: by 2002:a63:788e:: with SMTP id t136mr7437555pgc.432.1635500280548; Fri, 29 Oct 2021 02:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635500280; cv=none; d=google.com; s=arc-20160816; b=PiVK4xmn7IyJB9qtBJyMMxnsgzjsSjWdSLfnCMkOVGwy+pUqa1+onPqyDGOwyy7gk5 RZ2bc8mK2vsT3LEziLic1+387SQpLy4KgllLvLj47rugNAnm+qabaBqOtDm3P1GT7fP8 qG96B3KOo6ZMi4N3CUK/8b7HRNM/DPFlkqwvVDhcyeb2TAGqhBEgzxfL2AHbnS1c81j1 Dj5AIzdAvK5vSK11947T6Oeir6tKoIzsA+LmDx6OhRTygZPRGOKA6K8194k+OD+295nz ZczayN51kxm8R6iH17ZzsJ0KWtlPmAMZtk5BlsjdRK69n1nhwIty77RuG3cmQpLu2eB0 ETOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=A9tk+xI8L/MXVgpis3dMYnJk8FoXVEKc9RwIjo6oClA=; b=TXe5EKYO2rH5RFqr5y8PDFe25RpWqZnS+67MdALDJsdFgGBHlbY9HBirdENAdHAWty NhgyD6xTGxIVN2HjyqbrFr2QYFQraQmvcNkLu5b4uIiszuiJZkzvF9FEWaHSwdentnSH pounVGlDIsUwHriNe3dz4NYT14NrCXnFod5faZtGpBqnZj+3BuByKA2oCrz7cUr9IVwZ 3H56Q3W+hW7H43z63miV2QadOzdLhHEsz9/DFE1MAwuJtpC0u/c4brp/QpJNG6qCLBus dpgN1EZiXJac+Vop69GxziOcD+Ns6WlZA+0SA7OAvQP0QnYG+7fiNU6m7F4r39shvSao ehCg== 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 x1si9690569pgu.532.2021.10.29.02.37.46; Fri, 29 Oct 2021 02:38:00 -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 S229927AbhJ2JjW (ORCPT + 99 others); Fri, 29 Oct 2021 05:39:22 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:13990 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbhJ2JjV (ORCPT ); Fri, 29 Oct 2021 05:39:21 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Hgchq5XGyzWj9v; Fri, 29 Oct 2021 17:34:51 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Fri, 29 Oct 2021 17:36:49 +0800 Received: from localhost.localdomain (10.67.165.2) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Fri, 29 Oct 2021 17:36:48 +0800 From: Qi Liu To: , , CC: , , , , Subject: [PATCH v11 0/2] drivers/perf: hisi: Add support for PCIe PMU Date: Fri, 29 Oct 2021 17:36:30 +0800 Message-ID: <20211029093632.4350-1-liuqi115@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600003.china.huawei.com (7.193.23.202) 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 v10: - Drop the out of date comment according to Jonathan's review. - Link: https://lore.kernel.org/linux-arm-kernel/20210915074524.18040-1-liuqi115@huawei.com/ Changes since v9: - Add check in hisi_pcie_pmu_validate_event_group to count counters accurently . - Link: https://lore.kernel.org/linux-arm-kernel/20210818051246.29545-1-liuqi115@huawei.com/ 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 ++ MAINTAINERS | 2 + drivers/perf/hisilicon/Kconfig | 9 + drivers/perf/hisilicon/Makefile | 2 + drivers/perf/hisilicon/hisi_pcie_pmu.c | 948 ++++++++++++++++++ include/linux/cpuhotplug.h | 1 + 6 files changed, 1068 insertions(+) create mode 100644 Documentation/admin-guide/perf/hisi-pcie-pmu.rst create mode 100644 drivers/perf/hisilicon/hisi_pcie_pmu.c -- 2.33.0