From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (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 D1FD73909A6 for ; Thu, 16 Jul 2026 07:03:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784185421; cv=none; b=lheY2TGOdnOMVvvqU0kkCso18Ee5E21GlEKW/nKs8BCZRuQB5DdVJmXV9sArOxFicFx1zTITK4RMVU0fFJjD7RgW/IoXhMa0AGIJR3JTi6GIuEtvP+RH6rL0bdlPRVZAura73BunwkFn7nutYGxOwN4obpeQ71pIbFDayq2kajA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784185421; c=relaxed/simple; bh=Iy70ix2G6UJ2waMDQZdP0H/xHnMOXw4T4raHxlZze4E=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=bK4hJLmGkM7k+c2p79k5CEJwBbndsRrimZ3PHMfoBzjuNAhdQJsmblCEVmu3q4zLR5ZjWFDpUeere0/xMCRDlGw/gJZ4XJupPB+oUjA1oLLLDxEtqb86RowBif49M8nP/y4Dm2Shfiz8nEuJk+0t5sr14wjKtd6TQzN8J1t5v9o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=YzBNpDag; arc=none smtp.client-ip=209.85.215.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YzBNpDag" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-c8894570b58so2330616a12.3 for ; Thu, 16 Jul 2026 00:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784185419; x=1784790219; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=y/A4YjzcgmgX8KmC+PM43mOtsoEDH1gz6SlFM8oolbM=; b=YzBNpDagf0EvcCJUdzxxnvXEYnY/k3JihbfTq6zkseXKderlM3xfq4AQRkZQSi+X9D /gLlauToU6Fv08eiQX9IsRMPGx69zmq3ov7H+kgjAuKDjdVOO2nYUo/LwzJr6WsKMnto wFO1NI+UJ+nmIChFYMc6ldKFqflcB/t8XnL2LcA46UBhXtD0joOnDBmtJNF/zTDV8/dD RZLKx2vy7ax2oKCipT898JXL8wsFqBvThN8fQl663bpm3Af3wZA4WEdRMktFgRdSAoQ4 NibRMvoqMVZ5RljAbTAhTUoecDo4lZbfHCoFtpLiRl5t+un2CljuLPBiO6iu4Zs8MzXw cmIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784185419; x=1784790219; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=y/A4YjzcgmgX8KmC+PM43mOtsoEDH1gz6SlFM8oolbM=; b=krVuQ3W7baszBX9VOnnG0DxPMtc1tWsB+yeYEUs+8hHB/Ae7KiP4qdho0e5jxadhvU RuGbW0J4wlh3ktOofroWIcYRH2bHa1yFQw63Z2CQJQBtkbLkkXiqlaYcRRHJ9blTU+wF qYJDUlUrNbkOLjYlW+EfBRfPrmL5DsMNfeZVzCvYIPLSnSqKHRnVYQC+hZaH7VYrc/lR KOYS9tvrGw8v3ktIecuGqM5SJLitf0HhH3SQpWZQpfr4nf1MzKUKuVH185P2XYmCdabt UBfBx1gfribdowAhvYjoBA1B1fdRY93RyALw9bJQGbxtoZPXcpTgj6FJ/qXOJJJn4jpp OPiw== X-Forwarded-Encrypted: i=1; AHgh+RqMgS3lN0gDOnP9EYYrHXL7H5qAXF2DfX0MYQyPxTY0L837pVUURHZ/aDXePPwu/Ytou19DMWi757DpuJo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3AqV6moSPrM6QNgz+4Mrh2WuvMWtmX75tArmESjVYyA2/t0Ml 15mZvej+UjQ3ImUkqwU+Xzv3chJ1gEjmqvA3nQs/GOvtjU2z60EtYXmYbh0U++FJAPdDEROnFuU bhoozWJRX/w== X-Received: from dlbek7.prod.google.com ([2002:a05:7022:c87:b0:13b:83ad:69bc]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:d82:b0:3b3:2703:110 with SMTP id adf61e73a8af0-3c110776c30mr24087912637.4.1784185418932; Thu, 16 Jul 2026 00:03:38 -0700 (PDT) Date: Thu, 16 Jul 2026 00:03:03 -0700 In-Reply-To: <20260716070303.507066-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260716043223.388233-1-irogers@google.com> <20260716070303.507066-1-irogers@google.com> X-Mailer: git-send-email 2.55.0.141.g00534a21ce-goog Message-ID: <20260716070303.507066-15-irogers@google.com> Subject: [PATCH v4 14/14] perf stat: Extend PMU metrics value linter to validate --new outputs From: Ian Rogers To: irogers@google.com, acme@kernel.org, ctshao@google.com, namhyung@kernel.org Cc: adrian.hunter@intel.com, james.clark@linaro.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, mingo@redhat.com, peterz@infradead.org Content-Type: text/plain; charset="UTF-8" This patch updates tools/perf/tests/shell/stat_metrics_values.sh to run the metrics value validation linter twice: once for the legacy path, and once under the --new print flag using the newly introduced python validator `-new` argument: $PYTHON $pythonvalidator -rule $rulefile -output_dir $tmpdir ... -new This mathematically guarantees that calculated Intel PMU metric values staged inside the decoupled streaming JSON callbacks are parsed and validated cleanly against the formal rules engine. Signed-off-by: Ian Rogers Assisted-by: Antigravity:gemini-3.5-flash Acked-by: Chun-Tse Shao --- tools/perf/tests/shell/stat_metrics_values.sh | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/shell/stat_metrics_values.sh b/tools/perf/tests/shell/stat_metrics_values.sh index 86c5c7f70933..3f545e88b69f 100755 --- a/tools/perf/tests/shell/stat_metrics_values.sh +++ b/tools/perf/tests/shell/stat_metrics_values.sh @@ -26,13 +26,29 @@ echo "Output will be stored in: $tmpdir" for cputype in /sys/bus/event_source/devices/cpu_*; do cputype=$(basename "$cputype") echo "Testing metrics for: $cputype" - $PYTHON $pythonvalidator -rule $rulefile -output_dir $tmpdir -wl "${workload}" \ + mkdir -p "$tmpdir/legacy" + $PYTHON $pythonvalidator -rule $rulefile -output_dir "$tmpdir/legacy" -wl "${workload}" \ -cputype "${cputype}" ret=$? - rm -rf $tmpdir if [ $ret -ne 0 ]; then - echo "Metric validation return with errors. Please check metrics reported with errors." + echo "Metric validation return with errors. " \ + "Please check metrics reported with errors in: " \ + "$tmpdir/legacy" + exit $ret + fi + + echo "Testing metrics for: $cputype (New API)" + mkdir -p "$tmpdir/new" + $PYTHON $pythonvalidator -rule $rulefile -output_dir "$tmpdir/new" -wl "${workload}" \ + -cputype "${cputype}" -new + ret=$? + if [ $ret -ne 0 ]; then + echo "Metric validation return with errors (New API). " \ + "Please check metrics reported with errors in: " \ + "$tmpdir/new" + exit $ret fi done +rm -rf "$tmpdir" exit $ret -- 2.55.0.141.g00534a21ce-goog