From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (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 0BC623F44EC for ; Wed, 1 Jul 2026 08:48:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782895740; cv=none; b=EZj+mI1UJbLj2diYACH7VpzLpY/X3jbGCChUP9BWOU0+CKl7jxpk2AUH3BXTQX0KrUtem0DrMcg+dV8s+0NVNBfUyUHETm8GTpj81y5HqzkwJxUNm0nFnKHGE2+pVdcEQlTu3Y5S2t7xN1SD/tpzOmGr2WydVXPMqWKrN1xJiwU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782895740; c=relaxed/simple; bh=yvZmsI+YKkyKcpQOntY3K3DA5Carxis58c2zbF7uL+o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JTo0Jtav3kLfREt4Xq117P+Qjk22be5MALPWuIAVetCDMaH7kAQqXik75nqWQfunRSizJmyCS5aTDSibYDAPcPagR2Pxh40tlElIVnrDsnpY1t6aP6Ha/Nwdbx3LASmpLQ2GMQShM0Jt6cCEz1vTsi9sGeTmk/EK/P4srntxb6Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=PVOo7ZBm; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PVOo7ZBm" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782895737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vtg6gtjTXG/5kZ90vLQ3ZK8HeIu7FaVLNgb7sibmyzw=; b=PVOo7ZBmM6YIM0NolMjtxLKfchiQEr7jsQyDsVfx1ILzRodHDDodTu/+8yZ/a8/ZWI+xsS loVXakO8WmEY/K3R/2MI5d+kkGXuY6uZti8GYMEisHs+IN0qKtKhw3y1/G2iNRPhgF8yLE bNBxjuDWrFbO0ZnwwXQ3Rtp1dmB6abc= From: Atish Patra Date: Wed, 01 Jul 2026 01:47:08 -0700 Subject: [PATCH v8 20/22] tools/perf: Add RISC-V CounterIDMask event field Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260701-counter_delegation-v8-20-7909f863a645@meta.com> References: <20260701-counter_delegation-v8-0-7909f863a645@meta.com> In-Reply-To: <20260701-counter_delegation-v8-0-7909f863a645@meta.com> To: Jiri Olsa , Paul Walmsley , Mark Rutland , Rob Herring , Anup Patel , Namhyung Kim , Arnaldo Carvalho de Melo , Krzysztof Kozlowski , Atish Patra , Ian Rogers , Will Deacon , James Clark Cc: linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-perf-users@vger.kernel.org, Conor Dooley X-Migadu-Flow: FLOW_OUT From: Atish Patra Counter delegation lets supervisor mode choose the hpmcounter for an event, but the hardware may only allow a given event on a subset of counters. Add a RISC-V specific "CounterIDMask" json event field, handled like the other arch-specific entries in event_fields[], that carries the allowed-counter bitmask through to the driver's existing counterid_mask (config2:0-31) format. The value is the bitmask directly so no counter-list to bitmask conversion is needed, and because the field is RISC-V specific it is a no-op for every other architecture's events (unlike the shared "Counter" field). Signed-off-by: Atish Patra --- tools/perf/pmu-events/jevents.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py index 0cf9d26315b3..516fb73886ed 100755 --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -396,6 +396,7 @@ class JsonEvent: ('EnAllSlices', 'enallslices='), ('SliceId', 'sliceid='), ('ThreadMask', 'threadmask='), + ('CounterIDMask', 'counterid_mask='), ] for key, value in event_fields: if key in jd and not is_zero(jd[key]): -- 2.53.0-Meta