From nobody Fri Oct 3 15:33:21 2025 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8B6030ACED for ; Fri, 29 Aug 2025 10:14:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756462478; cv=none; b=hedgixw1kJal1EFsM+px7Fr4QJbu0sqysYRBDn29viqHoCEqVJdc/mRr3erQz51iZzLc9vwrWlja0sMCdRSWIU0cwFZAafNc/qsc+h4iApZUq8rl74ptKjOTEING90GTdyLHaeMY9/jWTWMIk2MX0Oaw87JDcsqCXLKaFA+z9xQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756462478; c=relaxed/simple; bh=33ZsWzQAkqd5Z0s2iYvvfk4sv6Id0N375uaBOIWWpYU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c184y8620A8ydwAwFFU2pYSFGJYD/DHD+z3/AjJhbS2fk+cBj4NLY1Mbc5JkH8VmNgRwZZgT8xis4FUfSsQ73cVsFg91c5XrUhYs7DpnyS9NKv1d1w+sRfuo8TAgcRhesj57IazshsLWUWx66MeJF3Rd+3VaR/Aefx9M9XEI2bQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4cCvC91tGMzPqXq; Fri, 29 Aug 2025 18:09:57 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id 7E875180486; Fri, 29 Aug 2025 18:14:33 +0800 (CST) Received: from kwepemn100008.china.huawei.com (7.202.194.111) by dggemv705-chm.china.huawei.com (10.3.19.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 29 Aug 2025 18:14:33 +0800 Received: from localhost.huawei.com (10.90.31.46) by kwepemn100008.china.huawei.com (7.202.194.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 29 Aug 2025 18:14:32 +0800 From: Yushan Wang To: , , , CC: , , , , , , , , , Subject: [PATCH v3 9/9] Documentation: hisi-pmu: Add introduction to HiSilicon V3 PMU Date: Fri, 29 Aug 2025 18:14:27 +0800 Message-ID: <20250829101427.2557899-10-wangyushan12@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250829101427.2557899-1-wangyushan12@huawei.com> References: <20250829101427.2557899-1-wangyushan12@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100008.china.huawei.com (7.202.194.111) Content-Type: text/plain; charset="utf-8" Some of HiSilicon V3 PMU hardware is divided into parts to fulfill the job of monitoring specific parts of a device. Add description on that as well as the newly added ext option for L3C PMU. Acked-by: Jonathan Cameron Signed-off-by: Yushan Wang Reviewed-by: Yicong Yang --- Documentation/admin-guide/perf/hisi-pmu.rst | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Documentation/admin-guide/perf/hisi-pmu.rst b/Documentation/ad= min-guide/perf/hisi-pmu.rst index a307bce2f5c5..b78381a1e5e9 100644 --- a/Documentation/admin-guide/perf/hisi-pmu.rst +++ b/Documentation/admin-guide/perf/hisi-pmu.rst @@ -113,6 +113,39 @@ uring channel. It is 2 bits. Some important codes are = as follows: - 2'b00: default value, count the events which sent to the both uring and uring_ext channel; =20 +For HiSilicon uncore PMU v3 whose identifier is 0x40, some uncore PMUs are +further divided into parts for finer granularity of tracing, each part has= its +own dedicated PMU, and all such PMUs together cover the monitoring job of = events +on particular uncore device. Such PMUs are described in sysfs with name fo= rmat +slightly changed:: + +/sys/bus/event_source/devices/hisi_sccl{X}_ + +Z is the sub-id, indicating different PMUs for part of hardware device. + +Usage of most PMUs with different sub-ids are identical. Specially, L3C PMU +provides ``ext`` option to allow exploration of even finer granual statist= ics +of L3C PMU. L3C PMU driver uses that as hint of termination when deliveri= ng +perf command to hardware: + +- ext=3D0: Default, could be used with event names. +- ext=3D1 and ext=3D2: Must be used with event codes, event names are not = supported. + +An example of perf command could be:: + + $# perf stat -a -e hisi_sccl0_l3c1_0/rd_spipe/ sleep 5 + +or:: + + $# perf stat -a -e hisi_sccl0_l3c1_0/event=3D0x1,ext=3D1/ sleep 5 + +As above, ``hisi_sccl0_l3c1_0`` locates PMU of Super CPU CLuster 0, L3 cac= he 1 +pipe0. + +First command locates the first part of L3C since ``ext=3D0`` is implied by +default. Second command issues the counting on another part of L3C with the +event ``0x1``. + Users could configure IDs to count data come from specific CCL/ICL, by set= ting srcid_cmd & srcid_msk, and data desitined for specific CCL/ICL by setting tgtid_cmd & tgtid_msk. A set bit in srcid_msk/tgtid_msk means the PMU will= not --=20 2.33.0