From patchwork Sat Oct 7 02:13:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13412152 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 966D3E9413F for ; Sat, 7 Oct 2023 02:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AAAJIeVnXq6q2VG+OBdJTiLikD5LvY0JHMtHt/JQ2HY=; b=obtYZRFN03ZDCt KGxcUwOrcer9UCWzUwlXxHBqG1hnPC0rIuElfmYSvjKKOEPlSdK9De0Qncls3zLur64Y6Xv2oU/3G OnwoEmnZq2lds1RSHm4kZhQAP+eT3bcxfiuNosohcQUqjOvCIOJrNnl7mHF4fE1lezNmw84Xbp5uj G43/q83v5lZ2DpXfq+07c9dbFcSbPzjDOevOwgwI6+U7I2i5TEIqKqnqPWdTi7J7ORYeTRUM4EZw0 kpU/0ORO9CCI7LW3AteKeXtlHTiAlyfAhK7Dbcp9uuxeHkKQ4nfsVH5Exz3xXyOJZC4NgdDWR/MR8 QMFOpHNvC8ONPIKdNcVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qowpI-006ncd-2O; Sat, 07 Oct 2023 02:13:56 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qowpE-006naU-1T for linux-arm-kernel@lists.infradead.org; Sat, 07 Oct 2023 02:13:53 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d865a8a7819so3831878276.2 for ; Fri, 06 Oct 2023 19:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696644831; x=1697249631; darn=lists.infradead.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=8fc7EI+IqMoK5GVnqlsLaiP62BnjpCmFT/Si/B7nJZs=; b=ozd5IcPE5182uF/lt+JKpZ/CkOvROdbd4t/W6FhGyKFX6gvHU8UjHMKqk6zsW/U/+I NihH6QLXiCuMzzEvyxgBnWWjbtScpHrdlOWXu+BdxJqgXa4gxieUKNidwwRkz1nstDQ3 ebapYpWLsY6u0xn6jzG5Qi45Wnql2tcFyM/0Nrt+ZtBWrTvkL03fs6PtnK8mYzXgNr7B bPUzlWhLB9/5F4ghNIejkCTtlSiGIVFP/SeKu8gpS+13nPN3iYDjf4O0OJ3H/0J9iVcc a/0CPXwbVLHhvMS0d3AHJkc+KT/Apxir7wgX6SZHCOLM4AxHF7Ps5DQMU11eE78zvLFn yYGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696644831; x=1697249631; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8fc7EI+IqMoK5GVnqlsLaiP62BnjpCmFT/Si/B7nJZs=; b=KmiE3VXxGobAyAA5fSbpx8ikJU/3jeOSwGuoUNbZWFUKoRDTdkgPbDbAdYLVyYZsXm eswpf++R1DAjikYh325mCFbJkJ/rObEnxPeY5ZtrCJmEHKygxj3heOtTP1v95m7OwS2D 3HCtGmss5bio4O8YC6PN5pk3221csuPPGABP32Io6YpJXYOk8Ut8GNmmCpB3E/poXHmL 9fDh9E/raceaxUDQHKVWSvDjL7gkuvct+PxuQ/dVi8lEPipWNpUwURKriyhRZEqIgUXa uprUeCzY28k3DAVGm4cCDLRe4mfWH5dw2xvUXtvEGxkkzFGNdfGt+OaVybIkpDGOO6ai JpLQ== X-Gm-Message-State: AOJu0YyQoHUbahzBydAeo+kGRnSZ4bg8REzzSSdXVakYSyvi5A49Npti eQ2wo4afMlUCgxwKwhRjwOxqrbcXm0YA X-Google-Smtp-Source: AGHT+IHrCzJat+rz/BJ6g8m43IhpNWgcQXVdsawjas52P79D5OWVnwHwRJxeKmFFr5isb0ADzqHoPQ82uORz X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:7031:b36b:6c77:bfd0]) (user=irogers job=sendgmr) by 2002:a25:e20b:0:b0:d81:817c:582 with SMTP id h11-20020a25e20b000000b00d81817c0582mr155263ybe.7.1696644831137; Fri, 06 Oct 2023 19:13:51 -0700 (PDT) Date: Fri, 6 Oct 2023 19:13:21 -0700 In-Reply-To: <20231007021326.4156714-1-irogers@google.com> Message-Id: <20231007021326.4156714-3-irogers@google.com> Mime-Version: 1.0 References: <20231007021326.4156714-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog Subject: [PATCH v1 2/7] perf intel-pt: Move PMU initialization from default config code From: Ian Rogers To: Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Thomas Richter , Ravi Bangoria , Kajol Jain , Jing Zhang , Kan Liang , Yang Jihong , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231006_191352_493657_FBDF1248 X-CRM114-Status: GOOD ( 11.80 ) 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 Avoid setting PMU values in intel_pt_pmu_default_config, move to perf_pmu__arch_init. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter --- tools/perf/arch/x86/util/intel-pt.c | 2 -- tools/perf/arch/x86/util/pmu.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c index b923bca939d9..6d6cd8f9133c 100644 --- a/tools/perf/arch/x86/util/intel-pt.c +++ b/tools/perf/arch/x86/util/intel-pt.c @@ -267,8 +267,6 @@ intel_pt_pmu_default_config(struct perf_pmu *intel_pt_pmu) attr->config = intel_pt_default_config(intel_pt_pmu); - intel_pt_pmu->selectable = true; - return attr; } diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c index 811e2377d2d5..949b3e2c67bd 100644 --- a/tools/perf/arch/x86/util/pmu.c +++ b/tools/perf/arch/x86/util/pmu.c @@ -22,6 +22,7 @@ void perf_pmu__arch_init(struct perf_pmu *pmu __maybe_unused) #ifdef HAVE_AUXTRACE_SUPPORT if (!strcmp(pmu->name, INTEL_PT_PMU_NAME)) { pmu->auxtrace = true; + pmu->selectable = true; pmu->default_config = intel_pt_pmu_default_config(pmu); } if (!strcmp(pmu->name, INTEL_BTS_PMU_NAME)) {