From nobody Tue Dec 2 02:28:56 2025 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (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 18DB0364E97 for ; Wed, 19 Nov 2025 19:30:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763580664; cv=none; b=u04pdzJbinWbnstvALJstaqX4jeT4nCV9Jrirkell33VCCueL5SLnX8U6JjrSgwoh05Y58bOH9V9SypzaNwi/KxSAfh2QpzEyesvv7stFRar6F89BZ3PCPfCgcWXgyXlXxtff7SA7G/CFD5cYtA28QW1BLAaRgCoYva+utDtYnE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763580664; c=relaxed/simple; bh=4ivNeOheBuNzExIPzRLVkR3bUyIOBfJwIFkhhVJf+IM=; h=Date:Mime-Version:Message-ID:Subject:From:To:Content-Type; b=Iiv8xwbozgyh4FZGzpXEDC6augVgu5tMzPVLIN/Hmsls8nULNox6iH+gum0LM8JNj0zEZ8oE2g/nPIgUtv2ZW/Dv1IjR6O9+uges0/QEvhgEskscuK7jSBnONSRgQXojJewHFdaLmMlH6GIB+ocymoK+P3F7vo9U8HD6Z53IzEc= 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=Y3Md5KeU; arc=none smtp.client-ip=209.85.215.202 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="Y3Md5KeU" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-b969f3f5c13so53726a12.0 for ; Wed, 19 Nov 2025 11:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763580656; x=1764185456; darn=vger.kernel.org; h=to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=iiRb5FbuRLx/GNbTV/3vTEYYpI4yNEVejENPhqja2z0=; b=Y3Md5KeUSB0vI/YVG3evInBOyN5Fv/WNfgqiPkOCKKWi7AZ0kNa8bGWEv84UmiN5KE VKNGSMq/YtiVDs/tJGZi6op+ndZPpbGYZUJVKUrAlk1XD0lR+9fii8OAIONgOM7fY9rJ Luxvt/mHSoFs0aVvhVF57FE+KdEd7z/sVckr9aeV5pO+8R1tR9+rp/kNZebt3Nefx1jG RHnyGQFYvwBgQbCDrJLbTep26KRD4YyFgPDdwg/mHZZfMtY8KpYaU8l4In0XJdKbPCXG 9GJteIzZzddaqvh/hpDCkqDP+qMYR58w9ggWBciQk/puynMHqMvHbDaSZrmv/iTg9EhM c4xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763580656; x=1764185456; h=to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iiRb5FbuRLx/GNbTV/3vTEYYpI4yNEVejENPhqja2z0=; b=jK8KNvIpJzb9jDuvEjm/olU5Ja5Yw0Xi5yTaaEuFM1RKNhnpfCyuEQwDUt5oLagtgp sLu1MLWkSSrmjTzxS8jzjqhxhY3nIyujkW8k+N8o3sIEqrq1E9Dosi+dKMtmVCM+gcg3 3J0uKCd4rNhRa6SOyU76gMNfoSOjc3sP5XnTx9VaFl2viA5NFRHrqXEd6tZRp6i7NX/J awxyfxsVfDVQwKGUhvoM5K/ip0sE9Mt29Jm/ITfX+bZXFcJGz9+cTGbiJttyEWIHifs1 yK9M1zgi2do/EPRfdLZZ4oTujCAOnCEObIyGAbdQM+JoUYVG5lhPqqnobdeaCJMhi7AG N6SQ== X-Forwarded-Encrypted: i=1; AJvYcCWknRqOx6GZltjqVEXAaD00X+jKgw5Gs1mHmtUufCzHzL175cNElESqodfnkKtX+Y/lUGEjrqsLgEwavMA=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3J+I7uLQOXWHkXYOwBJP1ckuoMwjJT9xuO5aNy+O5PhJOSF44 17V/sDeyJZ5bQMRl1MmocJ6lYidDFXmeUJjYCXBgHFqFhnO/QI8iZWDss3hGtcqhUn72XYmkVEk Vzh/RIxixiw== X-Google-Smtp-Source: AGHT+IHeSK6zSgFkdrwwfb4bIygeqaAylW7iZUr79GzdD1hIiFk5/+fc7unLeX+GDrj9bgL0BvZD4+FzRTL5 X-Received: from dybnb24.prod.google.com ([2002:a05:7300:cc98:b0:2a4:5fa4:9813]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:818c:b0:2a4:5c3b:e2b0 with SMTP id 5a478bee46e88-2a6fd1083e6mr134014eec.25.1763580655890; Wed, 19 Nov 2025 11:30:55 -0800 (PST) Date: Wed, 19 Nov 2025 11:30:47 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.52.0.rc1.455.g30608eb744-goog Message-ID: <20251119193047.2238095-1-irogers@google.com> Subject: [PATCH v1] perf test all metrics: Fully ignore Default metric failures From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, James Clark , Thomas Richter Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Determine if a metric is default from `perf list --raw-dump $m` eg: ``` $ perf list --raw-dump l1_prefetch_miss_rate Default4 l1_prefetch_miss_rate ``` If a metric has "not supported" or "no supported events" then ignore these failures for default metrics. Tidy up the skip/fail messages in the output to make them easier to spot/read. Reported-by: Thomas Richter Closes: https://lore.kernel.org/linux-perf-users/20251119104751.51960-1-tmr= icht@linux.ibm.com/ Reported-by: Namhyung Kim Reported-by: James Clark Closes: https://lore.kernel.org/lkml/aRi9xnwdLh3Dir9f@google.com/ Signed-off-by: Ian Rogers Reviewed-by: James Clark Tested-by: Thomas Richter --- tools/perf/tests/shell/stat_all_metrics.sh | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tools/perf/tests/shell/stat_all_metrics.sh b/tools/perf/tests/= shell/stat_all_metrics.sh index a7edf01b3943..3dabb39c7cc8 100755 --- a/tools/perf/tests/shell/stat_all_metrics.sh +++ b/tools/perf/tests/shell/stat_all_metrics.sh @@ -27,19 +27,20 @@ for m in $(perf list --raw-dump metrics); do fi if [[ "$result" =3D~ "Cannot resolve IDs for" || "$result" =3D~ "No supp= orted events found" ]] then - if [[ "$m" =3D=3D @(l1_prefetch_miss_rate|stalled_cycles_per_instructi= on) ]] + if [[ $(perf list --raw-dump $m) =3D=3D "Default"* ]] then - # Default metrics that may use unsupported events. + echo "[Ignored $m] failed but as a Default metric this can be expect= ed" + echo $result continue fi - echo "Metric contains missing events" + echo "[Failed $m] Metric contains missing events" echo $result err=3D1 # Fail continue elif [[ "$result" =3D~ \ "Access to performance monitoring and observability operations is = limited" ]] then - echo "Permission failure" + echo "[Skipped $m] Permission failure" echo $result if [[ $err -eq 0 ]] then @@ -48,7 +49,7 @@ for m in $(perf list --raw-dump metrics); do continue elif [[ "$result" =3D~ "in per-thread mode, enable system wide" ]] then - echo "Permissions - need system wide mode" + echo "[Skipped $m] Permissions - need system wide mode" echo $result if [[ $err -eq 0 ]] then @@ -57,7 +58,13 @@ for m in $(perf list --raw-dump metrics); do continue elif [[ "$result" =3D~ "" ]] then - echo "Not supported events" + if [[ $(perf list --raw-dump $m) =3D=3D "Default"* ]] + then + echo "[Ignored $m] failed but as a Default metric this can be expect= ed" + echo $result + continue + fi + echo "[Skipped $m] Not supported events" echo $result if [[ $err -eq 0 ]] then @@ -66,7 +73,7 @@ for m in $(perf list --raw-dump metrics); do continue elif [[ "$result" =3D~ "" ]] then - echo "Not counted events" + echo "[Skipped $m] Not counted events" echo $result if [[ $err -eq 0 ]] then @@ -75,7 +82,7 @@ for m in $(perf list --raw-dump metrics); do continue elif [[ "$result" =3D~ "FP_ARITH" || "$result" =3D~ "AMX" ]] then - echo "FP issues" + echo "[Skipped $m] FP issues" echo $result if [[ $err -eq 0 ]] then @@ -84,7 +91,7 @@ for m in $(perf list --raw-dump metrics); do continue elif [[ "$result" =3D~ "PMM" ]] then - echo "Optane memory issues" + echo "[Skipped $m] Optane memory issues" echo $result if [[ $err -eq 0 ]] then @@ -101,7 +108,7 @@ for m in $(perf list --raw-dump metrics); do # No error result and metric shown. continue fi - echo "Metric '$m' has non-zero error '$result_err' or not printed in:" + echo "[Failed $m] has non-zero error '$result_err' or not printed in:" echo "$result" err=3D1 done --=20 2.52.0.rc1.455.g30608eb744-goog