From patchwork Wed Aug 28 14:07:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13781342 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 01979C5AE5A for ; Wed, 28 Aug 2024 14:09:04 +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=5aAwIVJgVIh1Hv8hW6DlJQ9xqCzcxOReEhk3tFKI30U=; b=B1sWIDBr90XvZdp7clPpk586a2 912DRLHDgEuhz4BNPKQ0JixLIObQ16qfHl9I0jqZ4CLhq4128jFe8CnFOOOkVjT19n/3JcRCjrzMQ YBxcBJ7JfQbnQNGjejNkdVuKJv2F5AStTdazT5Qusg4BtSPt1ZCleD6bCB1sIbhtzUe4ZLomcFQ2H hwI2/ewnTJ6mSPk/mpwqqwtqnSqMsaBN/GDGpqkIVbJdZxuU2P5TMMHAjUJizsnS4A1zyasPw5CHl NwEdkxf0bhej6YvRwtYIoS/IQDt6ongbF7TUtFLkD5UmeuyyIotVbgsffKJgZiI1AoXYxx5H5wiWE zmbUHjYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjJM0-0000000Ffsh-0zrK; Wed, 28 Aug 2024 14:08:56 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjJL9-0000000FfdT-0ERB for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2024 14:08:04 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a86cc0d10aaso421463066b.2 for ; Wed, 28 Aug 2024 07:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724854080; x=1725458880; 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=5aAwIVJgVIh1Hv8hW6DlJQ9xqCzcxOReEhk3tFKI30U=; b=ZT05PKn/hDHMVosNqefkmGLr2oKxfIjLwJJCUOjq8lPKgThFcBYf8hQue91FfP7OhR CCxfQ6FbbANbT5uOITYX4mwPSQ4wI83iX4RI9Lg0wMaqCQ7c07jWP/7SRW3vZYg+r4BP wOArIuf69NLFJwbZgSWnFz9x6S7F1d3yBgrvpA/RcJD6nbG/OsyfyNO06xx6D9fgsBUK PTU4qSFbPCDMIQXsuI49X9l5+PYN82zdd/F6/BXb+Te1JkFoFgbWKY2cZDPVOMNPLUfF vCNO5mTw8NJUirSE/RUQUEZX/6ohorQJRjPERc1Vwl8kmb7UVF4FvhmqXTDWXVI4GhAo d5sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724854080; x=1725458880; 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=5aAwIVJgVIh1Hv8hW6DlJQ9xqCzcxOReEhk3tFKI30U=; b=mDmNiP7glIbFsOFDPD2jOCH2f6eyP2ItTPk49gRsIu1ruYgxs8LqlvQ2/TmqizSs1y UOY3At1jolj6ICvnmx4YO3JOphBULXskjTK7BsdFP7HbvNcFm9Y7bzFG075cO3kRKMjK JLZ8HZfuvav4hEepRgUvscFan3Jdm2MU8PHg1M3d7tulpwU7PhCm2CaITawv3nFeFU+3 PT3EPS3n5VSKTXWZoVJuHrB7+hF/IIrFYlBVtHIhm1jBqliP9FYq+j7Ma6pLXr8UvsA5 vvsgfPz/1v/rkv2Tco8wMvoT6+947IdlO9d2KfFeEKTGTfSohdY5nTHFKgkjcTOhq3+C VXkw== X-Forwarded-Encrypted: i=1; AJvYcCWr3kFZlGQQ+j/kut858hpkCefTk1s+h//ukGh6RhkOLcFyGAPy5dl9wW1OfrHVKrURxC21L36SU3bblAQwDrnx@lists.infradead.org X-Gm-Message-State: AOJu0YzhYMSTj1jc+x2fESZ7ndaCog3J9n1fRlF3LVXFa+yPY45sIBMq 82XSENob38UkKprNBHFli+/joW/eNmD1ZGaiBd4NIIs6vpcDcEdTiZ3PTyFu4Ok= X-Google-Smtp-Source: AGHT+IEoC5n0vdz3tJYOdnNb4XTomlnmxEipp/sr7m19JHJooP7z4Rm7SltooV8l5QLlj4Ott0pVNQ== X-Received: by 2002:a17:907:1b1e:b0:a86:e9ab:f6c6 with SMTP id a640c23a62f3a-a86e9abfe01mr432673066b.68.1724854079782; Wed, 28 Aug 2024 07:07:59 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a86e5832855sm251302666b.130.2024.08.28.07.07.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 07:07:59 -0700 (PDT) From: James Clark To: irogers@google.com, linux-perf-users@vger.kernel.org, kan.liang@linux.intel.com, ak@linux.intel.com Cc: James Clark , John Garry , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Weilin Wang , Athira Rajeev , Dominique Martinet , Yang Jihong , Colin Ian King , Ze Gao , Yunseong Kim , Sun Haiyong , Jing Zhang , Yicong Yang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 0/7] Event parsing fixes Date: Wed, 28 Aug 2024 15:07:14 +0100 Message-Id: <20240828140736.156703-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-20240828_070803_117822_361AA7D9 X-CRM114-Status: GOOD ( 18.99 ) 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_ 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, Juno, N1, Ampere (with the DSU cycles PMU) and I also faked an Apple M on Juno. 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 | 33 +- .../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, 356 insertions(+), 413 deletions(-)