Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp930556pxf; Thu, 25 Mar 2021 18:29:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoiABbuG+gubv9ZiiF09V5342M7ggUhVtHPVF0KEjTvhQdIrhnwEEma3w5Qc2uApAtwjOm X-Received: by 2002:a17:906:5e01:: with SMTP id n1mr12716370eju.359.1616722145994; Thu, 25 Mar 2021 18:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616722145; cv=none; d=google.com; s=arc-20160816; b=pSdRR1xAyh52rWzMBvUZ5XjJisieh+dBN4fcyVHg3s3GMTiCAPLxqsPg3jMzasP1KV WupnLVPyjB7/GOhsIz4G26863O/ApPNfr7/jZvZfQUFAN4e4J4Slqi50e2Rw7kGiqC9f ULN6cojd52B6Kin2JR1VMfe6XbYmT9CAkTGBzV/3FLIhbIMCA8UaxcnzPlJ3GoQiufQo VOn4tCOfwDADMhvcJEEPWWENZUfLTAvnPyypBJCvhzdgBhNuYwOAQbAKmlPrMpORIG2E mgjGioouJx1wh0xU5TYvUWpYo4KtS1Te+gwB534CXZyz85kAbkyjxLXqG+gaKHbCbOpD 4dmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=jMiPAGIvnxjLmEpYMkmVoP36/yd4shYg7r1ta6PX4Ug=; b=tAqaeUa/5EIwMNn8WnhVISFfl4V16A7G8EcNsVcoA4w+5pZD1X2ODSdZwRMn1RKkc9 BwKQnLsJCY4By/tV0c3Q2MhNiq1LW2/thVhmBSNLAUbNlfFnE8Z/uTlewzm4+YRO9/is Ml24ZFsw09tIrMr3soH7DdwLIS6+lObMI6RznJ4P0gDBEzbRdWBQrcK1cl/wCQi9wTvV UDY3pnUs65nkO4jW4U6An1P4JIiTCKVQUICIFSEtl+P094XoVe1RxxfKE+Y+RzLukggm Z4BAomJBjTvpCRr8NMDLMCs2wSRyFfYTX4eaJYY5yeODeOp89uBCKw2IL8aqtcKjwNrV ItCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si5544834ejk.379.2021.03.25.18.28.43; Thu, 25 Mar 2021 18:29:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230233AbhCZB1s (ORCPT + 99 others); Thu, 25 Mar 2021 21:27:48 -0400 Received: from mga12.intel.com ([192.55.52.136]:51734 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbhCZB1Q (ORCPT ); Thu, 25 Mar 2021 21:27:16 -0400 IronPort-SDR: vzTn3/wVf+v1eOl5rTgCZBq1cb/tknLpUoQ2nzYttNOQdL0wbMEEkKcdGrhEqKKkaGJHVkUG6z rAh58jLl0qzA== X-IronPort-AV: E=McAfee;i="6000,8403,9934"; a="170421820" X-IronPort-AV: E=Sophos;i="5.81,278,1610438400"; d="scan'208";a="170421820" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2021 18:27:16 -0700 IronPort-SDR: QXPxYCnCX9/4Pjm/SyR3bMVwqzjC9H914nS7vYXm94ZKWFzzM/AdDNWZWj1pIXWws0WkCrwTpy e6PTBCBPHFyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,278,1610438400"; d="scan'208";a="443088989" Received: from clx-ap-likexu.sh.intel.com ([10.239.48.108]) by fmsmga002.fm.intel.com with ESMTP; 25 Mar 2021 18:27:13 -0700 From: Like Xu To: Peter Zijlstra , Namhyung Kim Cc: pbonzini@redhat.com, Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Kan Liang , wei.w.wang@intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, Like Xu , Andi Kleen Subject: [PATCH v5 2/5] perf/x86/lbr: Simplify the exposure check for the LBR_INFO registers Date: Fri, 26 Mar 2021 09:19:15 +0800 Message-Id: <20210326011918.183685-3-like.xu@linux.intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210326011918.183685-1-like.xu@linux.intel.com> References: <20210326011918.183685-1-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The x86_pmu.lbr_info is 0 unless explicitly initialized, so there's no point checking x86_pmu.intel_cap.lbr_format. Signed-off-by: Like Xu Reviewed-by: Kan Liang Reviewed-by: Andi Kleen --- arch/x86/events/intel/lbr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c index 21890dacfcfe..355ea70f1879 100644 --- a/arch/x86/events/intel/lbr.c +++ b/arch/x86/events/intel/lbr.c @@ -1832,12 +1832,10 @@ void __init intel_pmu_arch_lbr_init(void) */ int x86_perf_get_lbr(struct x86_pmu_lbr *lbr) { - int lbr_fmt = x86_pmu.intel_cap.lbr_format; - lbr->nr = x86_pmu.lbr_nr; lbr->from = x86_pmu.lbr_from; lbr->to = x86_pmu.lbr_to; - lbr->info = (lbr_fmt == LBR_FORMAT_INFO) ? x86_pmu.lbr_info : 0; + lbr->info = x86_pmu.lbr_info; return 0; } -- 2.29.2