From patchwork Thu Oct 12 17:56:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13419584 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 85B6FCDB46E for ; Thu, 12 Oct 2023 17:57:40 +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=poqelHz7MKg/NhdmncE19MJZBQD6mnrG1cPQFmgobLc=; b=pxDIMsBvkK0XUU Q1s1hKJSIGDdihcKdEPfw0EikGBVzu7TuCtw5cyTLwvn4XfmK576qZyoguEqrbAOSZpga+CO7AmI1 XznhZn8i4X68qQVKczExKgqTUJczwgwjJRWaCWl7Tm6x2CBx43eeLuK2MlsFu6sKhDTqXKJkUeinM Nofb1ADCCpCrSUvKXyjg31YWTQr2Lnva34UMl3I4XfB+T3ltwuXvy9rQjYkxAXkT6WcbM5L1M2J07 iRBk8qyMQHVcmFJIwAsooY4YG95l405mSbfKiCQ7fGdT1MhEqJ83Hpwqn5oVOGs5xbQhxIegCj4mM QRGScWRyWivejteCuItw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqzvv-001ZNg-1y; Thu, 12 Oct 2023 17:57:15 +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 1qqzvc-001ZH4-0E for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2023 17:56:57 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d9a39444700so2049809276.0 for ; Thu, 12 Oct 2023 10:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697133414; x=1697738214; 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=1DriF+z0M9pYZTrNMVGeu8wBadZBaETJJrGU681YhYE=; b=mKd6OtY5JyDbDWSOa9pvluDqofvN/DaUy2z1Uj4xn2MyAyZIhr+UXmoqXXl9FVfAcf J+BjQqU+hWf/sEBjswpeVNydt80Xu3RWe9DRHktph09AFO1BPW590I3SlyQIk9UM4l9g SCsgXxf52PDrosxWGx0q6kOAxE5BdRjHd0JzdTumVr/ML23Av4wvHiE6cpcaD0UX894V vMgMjxILDuMW9Drenzb6/jSHPNRhVD6Kazzm0fmz4B8by7p51wsID/bpwGnh/PHqsXRL 7sRn3n/P8Um4/QqWGV/cYJCQ23sZzdGAfpBLUpU2XVhsKcTOyIgHJVeS2khObmDOexxB 1pog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697133414; x=1697738214; 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=1DriF+z0M9pYZTrNMVGeu8wBadZBaETJJrGU681YhYE=; b=Edw7mjy/zX1M9o1jTORJYKzPp3ylCjkr4EnIJyJa662KOrJ7LRjKGJJi4MtQCOrq3+ sCx89WLfgxV5h1CCqra/tcBxNZ7hpnNIHAvNUAbbe6pNU/Uj+n8kGRWT8sXxd/SVkc8u xdlyHyIPbmFkZHfuIXmRfThiV/TzatFpH3+H6mSpemK91ttdLYBuYop0CsdP9304mvLt ySVci6+mR4VhQmmwphGzf7zRaMS55X5vVq0F9DDAK8ol5h42/I7L6Injy7AYpONYcCXP ZCBh72GIv7GBOjDwbXymj1aW9xYoLU+9jyv3nL6RTQRFAj/WDfHKhUvX9VITfoeDdrsy +A7Q== X-Gm-Message-State: AOJu0Yx21idkv+v7jeirjaaQ72+BCNkCgoLIjEHviCbhXeuGI0osw35q NBkO5LFPiFCNAp06msFR4xsUi7tGiwCY X-Google-Smtp-Source: AGHT+IGJCQpCnaU4yhScMgzooZf1Pu0cV0LujtmcYzTCrUTSiETa1IxmN2IjJZ1xKXFkuv+ORoIXpfr9G+J7 X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:6a89:babc:124b:e4e6]) (user=irogers job=sendgmr) by 2002:a25:1682:0:b0:ca3:3341:6315 with SMTP id 124-20020a251682000000b00ca333416315mr539810ybw.0.1697133414595; Thu, 12 Oct 2023 10:56:54 -0700 (PDT) Date: Thu, 12 Oct 2023 10:56:40 -0700 In-Reply-To: <20231012175645.1849503-1-irogers@google.com> Message-Id: <20231012175645.1849503-3-irogers@google.com> Mime-Version: 1.0 References: <20231012175645.1849503-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog Subject: [PATCH v2 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-20231012_105656_129960_1D59B745 X-CRM114-Status: GOOD ( 12.50 ) 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)) {