From patchwork Tue Sep 3 10:19:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13788476 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA2E0CD3420 for ; Tue, 3 Sep 2024 10:22:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=O7MCvZ5Fhe/+eOHMrrRYarXfsg8B1NR75imdENvlnHc=; b=AeJizNDgijdtRRmG/Yt4z631AY Qs1UPrN02VcJ4eW3n0BAKt6mrsKCYmCbGTwW+F68DaBIKTb4IEDFbkOHV7VbEl9MvckEbBo6TsiXu 0AchiTPtTB2yomoB+Rdtem5WgKqBLFtJtBN44A9KWU8t1nm+VX4mFTEIi/rCUf2WjGkSLv34qgNpG PO+K6t8brmSz+qManYb0ShkDEq++VHnZ9iC/KcsLqpbPzjrPgyvyuMIBqiLlzIus9RdEQ6b40ZvLf soYDslp6TyaURQTd1FIlK8BD9MLjS9BTgqXuBbTUkAYRwV1V1gJCKkMG05hTCIpZo4FXYK1BAzonD FmSvKGjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQfl-0000000HK6z-0SE8; Tue, 03 Sep 2024 10:22:05 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQeB-0000000HJce-0lgC for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 10:20:28 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42bb885f97eso25292055e9.0 for ; Tue, 03 Sep 2024 03:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725358825; x=1725963625; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=O7MCvZ5Fhe/+eOHMrrRYarXfsg8B1NR75imdENvlnHc=; b=cT+YhCrnPa+EZ3DGDHJtAZ+Asjc1WINivTnntznvv8q5Nnjjv15T95GykhY2gytYx5 7hoW+46LrvI3l5971rO83GD938fu8+jIkWlaT0hLEH+r6gs2mGygK/7sEjvGjnMEJenm Q+pTwR3+DyHFsyRgZifAt51b1NOS5oCcXaGuZjZrA/P2n62UnrrdaZYU+s3CKR7xoWlb yDvLwOpQkug4M0QbnTtjaAXEE18rjuLmuCUxTcooCwq09hr4h7BRBB6kAcovgB7lKVzU WHNQor4WGhKtid6IXNp91XK08bqfUxlduHWyTE7nIt/xik3ayUu062j35P122oXfA+r2 o9Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725358825; x=1725963625; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O7MCvZ5Fhe/+eOHMrrRYarXfsg8B1NR75imdENvlnHc=; b=RB2Fd5nEHdLmNBQLPMABhwV1QANpBad6u/vP4ZFn3+cnbvCxs0R2DC26f2kViz7N/+ rSKXmYk2AmBAcl7N5zAhXGj1E8y3hDrD0oS4XjDzAO3zFd7WEfDdjKt0iAa8kEUl23/r ApZnn+s6h18+Pt2xDwIDt7JeBLUZlpwk+w+2+KH1O0JL2uthilUfACneio1HrOvY129f uBFQNkBGpPqxj0Y9wTJybBA+IAanffaCCBMpriMgAkVEEHdDgtdu0k5me5Vxrn2OdQ0G stIQn1y1fmxGj57bnPAgq6Ai2wS+zI2IZ5euLigI24B8tQsrqvpdttJwrcwWIH8/n0EV WkXA== X-Forwarded-Encrypted: i=1; AJvYcCWdZhTN4hDx+WWX++F+MkfsslGEh9apZ2bourze+AXvTy+3cWtaKYwjTXOfLHp8uqAta4ql3HnvzL4OtPb277LT@lists.infradead.org X-Gm-Message-State: AOJu0Yz4f5n1pxfaaQqx/5Rfl81DiiV2wzU9BtOO0BmaLk59QMkikmTC qgpQjIrvIOkZmaTM4Zdf05LJ4k1DWg0+lPXS+VIUMwakTQqjW0cDUfNu/3Z1JNM= X-Google-Smtp-Source: AGHT+IGIRhFxfgT+AnDIMCr5Idq+CDt+OTG+ytIxS7mv+w/WEHRzrznSX+8/1l2ZXSAi8FDJzWB3iQ== X-Received: by 2002:a05:600c:1914:b0:424:8743:86b4 with SMTP id 5b1f17b1804b1-42bb4c4cbefmr100018935e9.6.1725358824235; Tue, 03 Sep 2024 03:20:24 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e274ccsm168739995e9.37.2024.09.03.03.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 03:20:23 -0700 (PDT) From: James Clark To: irogers@google.com, linux-perf-users@vger.kernel.org, kan.liang@linux.intel.com, ak@linux.intel.com, namhyung@kernel.org Cc: James Clark , John Garry , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Weilin Wang , Athira Rajeev , Dominique Martinet , Yang Jihong , Colin Ian King , Howard Chu , Ze Gao , Jing Zhang , Sun Haiyong , Yicong Yang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 0/7] Event parsing fixes Date: Tue, 3 Sep 2024 11:19:44 +0100 Message-Id: <20240903102005.78049-1-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_032027_257773_959337C0 X-CRM114-Status: GOOD ( 19.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I rebased this one and made some other fixes so that I could test it, so I thought I'd repost it here in case it's helpful. I also added a new test. But for the testing it all looks ok. There is one small difference where it now hides _all_ default events, when previously it would only hide some selected subset of events like "stalled-cycles-frontend". I think this is now more consistent across platforms because, for example, Apple M only has cycles and instructions, and the rest of the default events would always show as there. Tested on Raptor Lake, Kaby Lake, Juno, N1, Ampere (with the DSU cycles PMU) and I also faked an Apple M on Juno. Changes since v5: * Test on x86 non hybrid * Assume 1 PMU in the test when no PMUs expose /cpus file Changes since v4: * Hide all default events when not verbose * Remove previous note about behavior from the cover letter and replace it with a new note about the new behavior Changes since v3: * Rebase onto perf-tools-next 6236ebe07 * Fix Intel TPEBS counting mode test * Fix arm-spe build * Add support for DT devices in stat test * Add a new test for hybrid perf stat default arguments Ian Rogers (5): perf evsel: Add alternate_hw_config and use in evsel__match perf stat: Uniquify event name improvements perf stat: Remove evlist__add_default_attrs use strings perf evsel x86: Make evsel__has_perf_metrics work for legacy events perf evsel: Remove pmu_name James Clark (2): perf test: Make stat test work on DT devices perf test: Add a test for default perf stat command tools/perf/arch/arm64/util/arm-spe.c | 4 +- tools/perf/arch/x86/util/evlist.c | 74 +---- tools/perf/arch/x86/util/evsel.c | 35 ++- tools/perf/builtin-diff.c | 6 +- tools/perf/builtin-stat.c | 291 +++++++----------- tools/perf/tests/parse-events.c | 2 +- tools/perf/tests/shell/stat.sh | 37 ++- .../perf/tests/shell/test_stat_intel_tpebs.sh | 11 +- tools/perf/util/evlist.c | 46 +-- tools/perf/util/evlist.h | 12 - tools/perf/util/evsel.c | 28 +- tools/perf/util/evsel.h | 22 +- tools/perf/util/metricgroup.c | 4 +- tools/perf/util/parse-events.c | 58 ++-- tools/perf/util/parse-events.h | 8 +- tools/perf/util/parse-events.y | 2 +- tools/perf/util/pmu.c | 6 +- tools/perf/util/pmu.h | 2 +- tools/perf/util/stat-display.c | 109 +++++-- tools/perf/util/stat-shadow.c | 14 +- tools/perf/util/stat.c | 2 +- 21 files changed, 360 insertions(+), 413 deletions(-) Acked-by: Namhyung Kim