From nobody Thu Oct 2 04:45:12 2025 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 26F992D97B6 for ; Tue, 23 Sep 2025 04:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758601186; cv=none; b=J+FDJRKEoS/x1aT9DKG53bm+kyRigee2iCMgcBtP8iTm1T0EymN/X184j0pDNeDf70uJ1CBaQBPrQQBEqWLTyBS9bT3MZVLfmhVbvzZlNyTKJQjhXxxdlFf9QtLmpwe23DDrAMkXj/ktE9gE0HcxNEJzslLVImhS9JNKLYp2dxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758601186; c=relaxed/simple; bh=6bAtb38zV9J/DL1V7CMqXHrxyyDh/espMrQBxm4h/pM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=dPRzvOvZ9GNWnxhAZp6Pr1LzT/KkAUa2mJNhK7nu0hOaHG5qmQe/sSNabTpErWORNbJFvVztnC43stim66YwJWuiVDU6ayvjHfLXS97qSNM6QUZJ5TWKZBd3ZBeAWJvcOGJEkZ7YxFl6TOTWmoYw2te5+r6IfCyoQ5JK3XC/V5w= 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=36FS5Acn; arc=none smtp.client-ip=209.85.216.73 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="36FS5Acn" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-32edda89a37so4989261a91.1 for ; Mon, 22 Sep 2025 21:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1758601183; x=1759205983; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=GD6dJGQu7Fkw7LxMA7kNIP84YIqKTjc1I229dIn5uGU=; b=36FS5Acnpak+ApAf2uOEbtAQaaRNjcsNdJ3vCBeYUhL9BRofJf4kNgt8NpMpA/FTW4 bt1Pvv/Ffvl+vZny1eHhwCBQM6K9kTsXqyEFV2pe/8J3NGtXJFGH761+s84At2OPGwIr YbXK10UZS2HiLB4KIQJvj8Gaene/A9FmoD/M3hGmOoDiUiSqlbE1NmyXba1NvzlQtm3v 0wp77JOhRqkPx4ARhDT7cg7TXOmBkQ5+VmVv4xdr4+UBY4At1ILhdqoKJmI1g9u9XTZw 4DCjTUAh/YQQG4oxYqtQofSuCvLhjiklCF86FFDh7Rl8tLRli/3KCB3sR3fTQClNk2cz kQVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758601183; x=1759205983; h=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; bh=GD6dJGQu7Fkw7LxMA7kNIP84YIqKTjc1I229dIn5uGU=; b=BdI1yYFEPQ5K8ODvAHFlGVdWSJF3OFecMxYZZymfw7sxEQWN2raoYqJamF1zopHWsC CRfhl054c9NdVs2v1oLscWyM1rHTvnRyhqN4kVrs98YiXry8mpGuPfwy0S3u/tNhWJu+ N4zvQBL9Obmh72RUV13EdXUhy6pzkU1wN0m9u8zRtoYeOz/w0+Ghuja3WsL1hObGP+14 5/vsinmPB6xu4svaJ4e2QhO1twj1qm67rmw27MYdo3MN33nWDdQqvqKSPySJcIXJiQwd hYoe+YOstL8y7z48NXl0L2y5FMzY/zlzWIy+JxhF9uE/ntiKsyOZV94cPKsLHpZNXg8T F4bQ== X-Forwarded-Encrypted: i=1; AJvYcCXfwan1MYuc/vApYnDO/NBLNMhMUUPjuCo+cqS9fZY/LvcNVQkSRjbGzHSesGqauj+h4tP/Q1hUANe3Wco=@vger.kernel.org X-Gm-Message-State: AOJu0YxAA1GCC3u/XEbSFw2SKnYa2Tv5eh+Qa0RffGYH4vi4BcRgywiz ojyESHTj23KCLLpErwhQxlcvC7jV6mvYoff/5Rye1os1FbyYkmejq82JjpHt710+m/4h4icvH73 oNQrCXKr3sA== X-Google-Smtp-Source: AGHT+IHEz625DgPgfCvdS8u12wp6hVm4KSQDVZQWJmPvAmlYj3P+j8YaXSnCyG6O61FyddtdSZfdsEtSQ9iC X-Received: from pjbmf6.prod.google.com ([2002:a17:90b:1846:b0:32e:bd90:3e11]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:ec8b:b0:32b:656f:5a5d with SMTP id 98e67ed59e1d1-332a95e4d90mr1628708a91.29.1758601183502; Mon, 22 Sep 2025 21:19:43 -0700 (PDT) Date: Mon, 22 Sep 2025 21:18:44 -0700 In-Reply-To: <20250923041844.400164-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: <20250923041844.400164-1-irogers@google.com> X-Mailer: git-send-email 2.51.0.534.gc79095c0ca-goog Message-ID: <20250923041844.400164-26-irogers@google.com> Subject: [PATCH v5 25/25] perf test: Switch cycles event to cpu-cycles From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Xu Yang , Thomas Falcon , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, Atish Patra , Beeman Strong , Leo Yan , Vince Weaver Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Without a PMU perf matches an event against any PMU with the event. Unfortunately some PMU drivers advertise a "cycles" event which is typically just a core event. As tests assume a core event, switch to use "cpu-cycles" that avoids the overloaded "cycles" event on troublesome PMUs and is so far not overloaded. Note, on x86 this changes a legacy event into a sysfs one. Signed-off-by: Ian Rogers --- tools/perf/tests/code-reading.c | 2 +- tools/perf/tests/keep-tracking.c | 2 +- tools/perf/tests/perf-time-to-tsc.c | 4 ++-- tools/perf/tests/switch-tracking.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-readin= g.c index 9c2091310191..4574a7e528ec 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c @@ -649,7 +649,7 @@ static int do_test_code_reading(bool try_kcore) struct map *map; bool have_vmlinux, have_kcore; struct dso *dso; - const char *events[] =3D { "cycles", "cycles:u", "cpu-clock", "cpu-clock:= u", NULL }; + const char *events[] =3D { "cpu-cycles", "cpu-cycles:u", "cpu-clock", "cp= u-clock:u", NULL }; int evidx =3D 0; struct perf_env host_env; =20 diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-track= ing.c index eafb49eb0b56..729cc9cc1cb7 100644 --- a/tools/perf/tests/keep-tracking.c +++ b/tools/perf/tests/keep-tracking.c @@ -90,7 +90,7 @@ static int test__keep_tracking(struct test_suite *test __= maybe_unused, int subte perf_evlist__set_maps(&evlist->core, cpus, threads); =20 CHECK__(parse_event(evlist, "dummy:u")); - CHECK__(parse_event(evlist, "cycles:u")); + CHECK__(parse_event(evlist, "cpu-cycles:u")); =20 evlist__config(evlist, &opts, NULL); =20 diff --git a/tools/perf/tests/perf-time-to-tsc.c b/tools/perf/tests/perf-ti= me-to-tsc.c index d4437410c99f..cca41bd37ae3 100644 --- a/tools/perf/tests/perf-time-to-tsc.c +++ b/tools/perf/tests/perf-time-to-tsc.c @@ -101,11 +101,11 @@ static int test__perf_time_to_tsc(struct test_suite *= test __maybe_unused, int su =20 perf_evlist__set_maps(&evlist->core, cpus, threads); =20 - CHECK__(parse_event(evlist, "cycles:u")); + CHECK__(parse_event(evlist, "cpu-cycles:u")); =20 evlist__config(evlist, &opts, NULL); =20 - /* For hybrid "cycles:u", it creates two events */ + /* For hybrid "cpu-cycles:u", it creates two events */ evlist__for_each_entry(evlist, evsel) { evsel->core.attr.comm =3D 1; evsel->core.attr.disabled =3D 1; diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-t= racking.c index 5be294014d3b..15791fcb76b2 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c @@ -332,7 +332,7 @@ static int process_events(struct evlist *evlist, static int test__switch_tracking(struct test_suite *test __maybe_unused, i= nt subtest __maybe_unused) { const char *sched_switch =3D "sched:sched_switch"; - const char *cycles =3D "cycles:u"; + const char *cycles =3D "cpu-cycles:u"; struct switch_tracking switch_tracking =3D { .tids =3D NULL, }; struct record_opts opts =3D { .mmap_pages =3D UINT_MAX, --=20 2.51.0.534.gc79095c0ca-goog