From patchwork Tue Aug 13 13:23:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13762039 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 F179CC52D7B for ; Tue, 13 Aug 2024 13:25:49 +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=CuKn3zCZ70JZQp+93StFA2ZNN01UscP73ZJf7VHOy5k=; b=iexPr/nCpEhmofx7VR5pAZOnSs nsEB5D5Mvgm30VS8D7jsdmwGZQvwtN+XJLNQTXPvbAhFLAQb9YbUTjou4kS+qComR4zc1T6Jn8jnB bcnQZhSN2pchtxMZDnGjiPCwMi4O9ub5QVh03U+IawR3i9jcJvXHVRAxQa9aejEjCQd4WLZjOj95J krR1IIbdX6DPV5ioS0rVwXra7sH2ymExQzUIkTfSFzoEkDkOamcxiZCWUiiUKQBPNqENAvlptf4pw A4yqwL5r0uaLWqqQj34zeFFGPk6FrFmyaWMTB4JTGP+8ubCBFCSgjpQt7JOrKTGd+z2CjWLNk/CtP APsto0nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdrWi-00000003rKf-1UhL; Tue, 13 Aug 2024 13:25:28 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdrW4-00000003r6N-2kve for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2024 13:24:49 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-428f5c0833bso37032115e9.0 for ; Tue, 13 Aug 2024 06:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723555487; x=1724160287; 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=CuKn3zCZ70JZQp+93StFA2ZNN01UscP73ZJf7VHOy5k=; b=V4DL40vGGwC5C7PRLG4eBIkJEeKS5XFt22RAnPLTE386O9Yg1FFOPfBF4czYbgj3pT ZL2W2ktBr9yKS1unHJi9KWSv+4z+MYFZydoKn2PCl5Eaiv17mTph1+PMjjmtzDOsqK/o Of0d0C4/3kKkMOnmG5cglwzMDu8Zj8wI2r9F1cuYp9GeECCAD64mVj0bPh+iw2nZJuBc 1A0YIw6PBHoriZ7gRccbzkjeDdbuUJ2StxHIj+GXZLsf8ewenlxvEaomdykGR2Gks9ZD LTSfssYhdnZ+0cJTxb1GT3z9HH7r0NVu5J8MCsGSxDKRg5fbakJGSE9wPRfE7Zg+jABH emBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723555487; x=1724160287; 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=CuKn3zCZ70JZQp+93StFA2ZNN01UscP73ZJf7VHOy5k=; b=YGGfx4TgYp0TDXdszjJuGHw5mOxQiqnUJeMORFQHuO9afLYdE6UnYROVttCPGJXhe9 O2YYs2+yoIbY8TBjg3vBKa6IbTLbyMFEE2ki/yF5EmG62cBj4KiETF5UGEMJiw9BT8tE BVgLGRQDxOUXEW8BuLCc7/hipPC3fVvIGAFZMPeunozU9IzFNb/qWpGX5iTg+KSt7l/o 9Co3zd4rOlVveGu5AMO9sYofNNg1EMnkJ8ZEVUk9/iKqbeF3UYGttl3UWbxuGwRBl74R R9lwhP5rlBnuEWNB2bPdy8maiWkAFjME10a0eNp9SpM+ZMNGpQ8yDYlfNDnCobcUkMCT iOYA== X-Forwarded-Encrypted: i=1; AJvYcCUuq8T2Xm2eyQt++zlQ+zqYTyE30uKcACdj9HMSIj/LBkrzfwlXCRcm51DZawCe6uSEbd6c4a9IFi8o6cG2J9MYE9/V8d/4+Cpf5/FcXe68PTgKYQk= X-Gm-Message-State: AOJu0Yx7fGNdApbZ+4p6yUttDAJ3AWgPk/x06fK1lG6Dtt/sCYv3+IkM KJRy5Czd9TDsO61I7zjiI1tdq/anLw/Rd9PX1wn02zvubI2NnFVX8MVv9igPRtk= X-Google-Smtp-Source: AGHT+IE5Wty2PhcPyeB3adoas1B2d+fRB+FpKrHGaJmkMiJ3JOcxRs+Gg6UES+MUF4AfDgXHAeTrVw== X-Received: by 2002:a05:600c:4689:b0:426:5b19:d2b3 with SMTP id 5b1f17b1804b1-429d62f6d77mr23808865e9.14.1723555486482; Tue, 13 Aug 2024 06:24:46 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4290c738d21sm223186625e9.12.2024.08.13.06.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 06:24:46 -0700 (PDT) From: James Clark To: irogers@google.com, linux-perf-users@vger.kernel.org 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 , "Liang, Kan" , Dominique Martinet , Yang Jihong , Ze Gao , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/7] perf stat: Make default perf stat command work on Arm big.LITTLE Date: Tue, 13 Aug 2024 14:23:08 +0100 Message-Id: <20240813132323.98728-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-20240813_062448_718640_F1D51B92 X-CRM114-Status: GOOD ( 16.22 ) 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 The important patches are 3 and 5, the rest are tidyups and tests. I don't think there is any interaction with the other open issues about the uncore DSU cycles event or JSON/legacy hw event priorities because only hw events on core PMUs are used for the default stat command. And also just sharing the existing x86 code works so no big changes are required. For patch 3 the weak arch specific symbol has to continue to be used rather than picking the implementation based on perf_pmus__supports_extended_type() like in patch 5. This is because that function ends up calling evsel__hw_name() itself which results in recursion. But at least one weak arch_* construct has been removed, so it's better than nothing. James Clark (7): perf stat: Initialize instead of overwriting clock event perf stat: Remove unused default_null_attrs perf evsel: Use the same arch_evsel__hw_name() on arm64 as x86 perf evsel: Remove duplicated __evsel__hw_name() code perf evlist: Use hybrid default attrs whenever extended type is supported perf test: Make stat test work on DT devices perf test: Add a test for default perf stat command tools/perf/arch/arm64/util/Build | 1 + tools/perf/arch/arm64/util/evsel.c | 7 ++++ tools/perf/arch/x86/util/evlist.c | 65 ------------------------------ tools/perf/arch/x86/util/evsel.c | 17 +------- tools/perf/builtin-stat.c | 12 ++---- tools/perf/tests/shell/stat.sh | 33 ++++++++++++--- tools/perf/util/evlist.c | 65 ++++++++++++++++++++++++++---- tools/perf/util/evlist.h | 6 +-- tools/perf/util/evsel.c | 19 +++++++++ tools/perf/util/evsel.h | 2 +- 10 files changed, 119 insertions(+), 108 deletions(-) create mode 100644 tools/perf/arch/arm64/util/evsel.c