From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) (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 EEB523921C7 for ; Mon, 22 Jun 2026 08:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782115586; cv=none; b=AD7ULAWAM56KNTg8STWhLTb0g8SaFNwyr5JsZ4brC62xykWakhu/B/MzP8L2oc+z0fxH78tVKInWiDVXz5qt3ypYMi/XAtLVcslIWSv+2Gf1NjLWEoId2JS9UkckYHVDdildP2Ie47UfEBl9GLWuC67Dt5uxnvnhcHsBHTYlvMU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782115586; c=relaxed/simple; bh=yKON5Bmy1w/E9ZgpWps+kx0Ls+ejUvAGERqPzvKFUdA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pYOmxdP6RHcAs5SoGXcTTc4aGL455CiEe8ilSXiBBjvrcCKW66lr/3SZWl10DRe5UCN7GWHnjEPkFagVgxw2d+0G44KTmQB4J6AwYsJQTxGwnFSXVjIizbs3GnLbKS7hnWotCj6BCrjgqdyeRVgqcTPYKQ5OOaIvnHg0Chj5x4M= 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=bUhMMAu3; arc=none smtp.client-ip=91.218.175.178 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="bUhMMAu3" 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=1782115583; 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=m33YeEQ2LI4+9pJOZx15rtUmMH8AJOWaugqVbovodV4=; b=bUhMMAu3013yuPd2hGNbmhY9rJUDcI5YKJC/IW0OAsIwiQnjudzZ/8OvBz8OU077+qsWBW cXuDQ8Ho5uB0YncTrpD2FPj0sAsO6hX6dnp36jxoH8M1xu2GUnKmceW6RtXPmX9JyDXul9 otcnAJU3+BEuytvc8qwarMdqXK+krAM= From: Atish Patra Date: Mon, 22 Jun 2026 01:04:32 -0700 Subject: [PATCH v7 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: <20260622-counter_delegation-v7-20-0ba2fd34614e@meta.com> References: <20260622-counter_delegation-v7-0-0ba2fd34614e@meta.com> In-Reply-To: <20260622-counter_delegation-v7-0-0ba2fd34614e@meta.com> To: Jiri Olsa , James Clark , Mark Rutland , Will Deacon , Arnaldo Carvalho de Melo , Rob Herring , Ian Rogers , Krzysztof Kozlowski , Anup Patel , Paul Walmsley , Atish Patra , Namhyung Kim Cc: devicetree@vger.kernel.org, linux-perf-users@vger.kernel.org, Conor Dooley , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org 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 457fce7a5982..c1ed8a05c9a4 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