From nobody Tue Mar 4 22:11:32 2025 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D1122288E6 for ; Tue, 14 Jan 2025 22:58:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736895534; cv=none; b=YWIvyNvN18sejnm8mCV+OSq1p0c9sPzfU9kps6tiYfkKlVz++7ZmtY0QKzVSToqajkG/pfm0rSIyF2igw7mjaGSuwcS7sGMbKkA9vVc0Gol7dn3Dw/34oL+DzjYS7l2MkyzJfRqFLe4GmMetQ7HAzIIesrzf5xLi7dnolzKfHh0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736895534; c=relaxed/simple; bh=XLVT31H4OpbUW1OFu7GetTjAoQ6wx83TWJr3zQGW1j8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rp0bOftyVWvNF+x/jj5ctQU2ZOF55bhg9goMyP0QIOGwsQkkRAuyLWkX83EZeyCr+o9K5TC8GCcqoFllX8WXi2N5KVmuKZHQfGCHwnPea6UAI4HD1+lAobFw5d5mgVI0Q8qG9ai1CiMsfapnjTX7xxJeqoV7NEdRlaVTQN0KGBc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=RvDO2C2h; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="RvDO2C2h" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2167141dfa1so4673315ad.1 for ; Tue, 14 Jan 2025 14:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1736895532; x=1737500332; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/NGMQ1cPPzFcGB6lbht2UloHcbpdvl9Eg+C6+XEyyV4=; b=RvDO2C2hGJ/WOQl8mgjQbq1/QyLg3EvEk59D2f0wy0xPrZAT7spDO6AmxF5nvs9rEB kIEHS8ti2PGlCvih5KXT2Did6741YrWZ5gLpTme8+IGC+IXlKAPYzrYuqPgrr+qR9Stv exooGCQWsHZs9K9b7AJX2adyx6jZZSeruQ81KzZ+7+xiJa54t/xlI7Up3ZoD6V73hhMg G3bWf9zYOjncsXW1dkZZkMX3BIE2vAP+aLZOF1qHh3GyQtYsZ5o2b3mo9C6UQF/KpSUz CxUtj8zCYnd8qGIVe0GOfyTi/1tPd+c9WKTJrVD97Q7TSU7WDzKixUuLSXo+q9Vg02Fc L+uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736895532; x=1737500332; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/NGMQ1cPPzFcGB6lbht2UloHcbpdvl9Eg+C6+XEyyV4=; b=jIPv57Zlblaa4qDtVnDitu4d35YRHgt6zVL81MeguQRJQ8yE5xBKi1Rs0r/qZbVsku I12kE3VREqhhHgg/UG3JfLM5lBzHm18cO28ia+/0Pt3ryietTDmhtzE2UMWj9WRuAVnY HuxiEdjVhqjVlQOeU0Q3CmCe5OdGZpYVfZPhjEm5ETHcWigHoJgnvue0Gg3zS8xG1IRY 5hF0kelBtDQsokAHWUYgKXj5D3y1iiwsKvh7dgDzMAYiGMFXfWvd7GMPC2WS6Kkpjgxu pdPH4Xu220z91V5g0AqC3fWybRBzrJR5puT8C+a5vJKShAg4Z4+q61BtTYnsEqDMgNXH fgJg== X-Forwarded-Encrypted: i=1; AJvYcCV0j1kkAgu3jtq0XAar9wjwDCjkFkCK7i+mjJvt7EnNPMPJ9KTiOirLuYJa95bxU92A8V62Yks4OnjATzw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/DtCO2xYMM3mkY2iVhhH51pZIMcDKIHjjltHZmdLmuNcPv636 FuFpbZBJY3HJXoDNrZiOOsz/Y1jh24iT64QYk+S/8PxL7r8FbEcyCJEQLW72kQs= X-Gm-Gg: ASbGncs9bJ407YLE5mx2zKjhOleBcDE/1upENjfZqRmUvDErScMstEHdG6pbS0BFiSY eh2QWCinlSbrlar23WCnq2P5kDD4+mROCEahP/JBs3yVurguSbRXWXR2goHlQVJJ4ytCoW8muGP vaTZh4D91pT/UndnuN5x4bhPJqY4vxITFeWKBzJi5cLDOYDtgzJ4l8UUWib7w/La5ijXVvem/fq ojN7eyf0wIquDeH0ja4cjTc1r22IK6kMHiBjJxiAoivb8816KlUZugRFEdcVHKhh2I27Q== X-Google-Smtp-Source: AGHT+IGY7+84arGT8AswRpB+pqwECCjX/DmctkDVIPDIQHV61usZj0/p7BRGYknWv9dWJ1AzycUGOg== X-Received: by 2002:a17:902:e892:b0:215:6c5f:d142 with SMTP id d9443c01a7336-21bf0d16349mr10455835ad.20.1736895531696; Tue, 14 Jan 2025 14:58:51 -0800 (PST) Received: from atishp.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f10df7asm71746105ad.47.2025.01.14.14.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 14:58:51 -0800 (PST) From: Atish Patra Date: Tue, 14 Jan 2025 14:57:44 -0800 Subject: [PATCH v2 19/21] tools/perf: Support event code for arch standard events 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: quoted-printable Message-Id: <20250114-counter_delegation-v2-19-8ba74cdb851b@rivosinc.com> References: <20250114-counter_delegation-v2-0-8ba74cdb851b@rivosinc.com> In-Reply-To: <20250114-counter_delegation-v2-0-8ba74cdb851b@rivosinc.com> To: Paul Walmsley , Palmer Dabbelt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Anup Patel , Atish Patra , Will Deacon , Mark Rutland , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , weilin.wang@intel.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Conor Dooley , devicetree@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, Atish Patra X-Mailer: b4 0.15-dev-13183 RISC-V relies on the event encoding from the json file. That includes arch standard events. If event code is present, event is already updated with correct encoding. No need to update it again which results in losing the event encoding. Signed-off-by: Atish Patra --- tools/perf/pmu-events/arch/riscv/arch-standard.json | 10 ++++++++++ tools/perf/pmu-events/jevents.py | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/perf/pmu-events/arch/riscv/arch-standard.json b/tools/pe= rf/pmu-events/arch/riscv/arch-standard.json new file mode 100644 index 000000000000..96e21f088558 --- /dev/null +++ b/tools/perf/pmu-events/arch/riscv/arch-standard.json @@ -0,0 +1,10 @@ +[ + { + "EventName": "cycles", + "BriefDescription": "cycle executed" + }, + { + "EventName": "instructions", + "BriefDescription": "instruction retired" + } +] diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jeven= ts.py index 5fd906ac6642..28acd598dd7c 100755 --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -417,7 +417,9 @@ class JsonEvent: self.long_desc +=3D extra_desc if arch_std: if arch_std.lower() in _arch_std_events: - event =3D _arch_std_events[arch_std.lower()].event + # No need to replace as evencode would have updated the event befo= re + if not eventcode: + event =3D _arch_std_events[arch_std.lower()].event # Copy from the architecture standard event to self for undefined = fields. for attr, value in _arch_std_events[arch_std.lower()].__dict__.ite= ms(): if hasattr(self, attr) and not getattr(self, attr): --=20 2.34.1