From patchwork Tue Sep 10 15:16:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13798746 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 75D2DEDE99C for ; Tue, 10 Sep 2024 15:18:16 +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=r5MBPcCy+Qj+9t27opnhlV5dPMrZLWwOE2W/OYIME0E=; b=IdWE6GDF212joTpc4DK5ESIPye TkjgFOGdv6lyRDwtpkVowLn1+4/dzVwBrPw/aSkNfDxymdcaoD3Wyvoe5fAz01guNC40AOEXL4h3E 2u0czJjW6cXCXGlQSbdls9qSUDTldONQeRRX/se/fR7XmBQ+fCoj2x6MVmjpxHHpP69T5Vu0Nq7j2 1ymR6VipvkHq6x0ZJW3J6kjztEK7RZ963LIcPngIqjNCuPmsTPZA5ykI6vXeALYB04q775vmvZawx ZWlQt9W7wOhgzEozJQnDw4Iygb2C15MGbBQjM7/3omr8QhZmqedxQfQYwr5jypO9m5qIemDfw03v+ 4FWgJTvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1so2d3-000000062q9-33HO; Tue, 10 Sep 2024 15:18:05 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1so2by-000000062V8-0bDj for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2024 15:16:59 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3787e067230so3633090f8f.1 for ; Tue, 10 Sep 2024 08:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725981416; x=1726586216; 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=r5MBPcCy+Qj+9t27opnhlV5dPMrZLWwOE2W/OYIME0E=; b=GlgGre0gn+AG1UvOyMMmBHSzTOJKT/39Vvp/WJWXSzZxJJfq9CeeVcIgfNAsgl028M +H2MoxrgMSgLtToVbISCGBazF1+Z9HAGfDX323ZyEhbiu5mtjzrIwGdUqZIpk/TEZR1v MjIgwnunOCzkFYQnvCcezVnV8TiKnDJkVDOx/atsT7M1PzyE9j1FT17O1c8mEwYTS2zu dn0cuLTlrTDoh7jghGEbfipNsYrHT2FOUUNcsfvk/aowJ1HYtltd2tR0u8n6SN7t28d5 hBEkkjvwUDXQrlsVWCMQb7hJsdqKmh84C43A6lLQAMG/1Ix4crVFpnPQq+beYCyU83Xp WXXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725981416; x=1726586216; 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=r5MBPcCy+Qj+9t27opnhlV5dPMrZLWwOE2W/OYIME0E=; b=ZtkZ/LLoUhveEvXGlhji7pnlw0LIeE4gp7AgkvgnaX5jR03Mjf1ZBQtT5D3pbLNJ5T 3vaq1kNrb58LuVGvbjhf6e7aSSw6/Ln+w4zXq/WXQC3ARUU8LjidgiW2VhFz+Uqj1HXH u96xUGmDKCL5vqpayji9TYfAOVQJic9az6sl1lGPUXHsC04rkuAFFg1jnVbIHqgCojdJ 4s0nhhMSmhcTufm9sePOKtus9LZsuzh2SZcqMexP5VYJ3VvU2rW0H1pZa/FZDYpk7UAX 0FExXp6t0iyfBzOaFyS4MTawwj0Rpu2G2xvtduOhBNBtGK5bv52vKhHl77w4EJ9mhkdn v7sw== X-Forwarded-Encrypted: i=1; AJvYcCX80H8Beyjis/GxUBq2JNDWQrggxC5+aFaWNx4Pi5pgwgkzFektGB7UiUWawpF+1nE5/cUD2brB8qfaFkJvTUfZ@lists.infradead.org X-Gm-Message-State: AOJu0YxHKiVMPfVPNAEr/yxLMjDSCd0BhtHSGTqOeaNPqiIcdq5lTUop 8frJGI2QrDuHW7C96+kMFKuguoD/GRx0/mvr+1bo6AP3RgmM757kHTPCCg6DwhU= X-Google-Smtp-Source: AGHT+IHKeSKSBm0+rpl/r1FpX1mbk5kM2fP44EaDZRom8BtEbAvMR91fjnKbqy07zPqIhDsFvWdBFg== X-Received: by 2002:adf:e60c:0:b0:376:27b7:da7d with SMTP id ffacd0b85a97d-378895de69emr9023296f8f.32.1725981415510; Tue, 10 Sep 2024 08:16:55 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895665517sm9440844f8f.36.2024.09.10.08.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 08:16:55 -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 , Colin Ian King , Yang Jihong , Howard Chu , Ze Gao , Jing Zhang , Sun Haiyong , Yicong Yang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 0/7] Event parsing fixes Date: Tue, 10 Sep 2024 16:16:18 +0100 Message-Id: <20240910151640.907359-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-20240910_081658_211480_D3D619D3 X-CRM114-Status: GOOD ( 19.85 ) 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 v6: * Fix empty PMU name in perf report * Rebase onto perf-tools-next 003265bb6f02 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 | 57 ++-- 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, 359 insertions(+), 413 deletions(-) Acked-by: Kan Liang