Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp8764pxv; Wed, 7 Jul 2021 18:50:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlRFmRcrhT9sL3mc5VrsU/2MDtULkkUFvh7DUPeYixffTtSV4Irh5G3Se/F4BoB1tBqA5f X-Received: by 2002:a17:906:ca17:: with SMTP id jt23mr28018771ejb.334.1625709032648; Wed, 07 Jul 2021 18:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625709032; cv=none; d=google.com; s=arc-20160816; b=VEjUr2SgD/+IUiZwEZu97lYeWM5wJQ033ijLYSwt6aQubzMzGyKdxqTSDpWp3RgA+o q/esBstHhbGNDI4i9nHYtIX6EhTfErh3AI/oA0wws5x+pcFxmtjDT9hRt5YGYFrZkRon ttsd37qjb9Z7fneSw+ktOXjgg1wvgowNGrOe2pDewB2Uo0bR44SuGf0C18idWHYPwvDi m5rAv4X5YQka/fTQI52kojtsgFtAF/mg8CFaVj6G4xcGy50u9qlX9T6o1mJclJE8tToR kZpNpXNNE5+HxGpl+USl6L5s7p55UYHp1m1CxfwglgmRkCkjymLHj+xe4f3UiQ5uYlWS xARQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=uKhFoRJNsPHIxvzbl6XdQI5SSxrc+al0zfY82Nd3gzA=; b=UzLxSmwSb93DsN34SeNH14/7WTb1ceyedtGLG7T5Vbe3Xtc9NNTix6b3ikpaN3rp+I cTa1thyTAku8U6BGZyTmuaa3p6ibe5GQ34OltlvxxDIEHLhdwAPEPVIsvlqoBMf2m4H5 pVv3cdZO9k4+FOPbjlvgGMyM3p8jjhNL4ohTsysKMbq2xF4PF4WfEyCuacTYudNA7tYS YsnObVvHXA8wYBDliiCKQV46gXvS4b6/eFFVaM1grI6LrB3G6zkt9oO2xEW76dTa6GdC EMNYsyQTKxJ263bIPzbAiaWQfE2KJTBETmVgW6OWLmb9AXqU3vYsMKXgb5Y185s7CNCK dSgA== 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 f15si1035615edf.356.2021.07.07.18.50.10; Wed, 07 Jul 2021 18:50:32 -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 S230304AbhGHBlQ (ORCPT + 99 others); Wed, 7 Jul 2021 21:41:16 -0400 Received: from mga06.intel.com ([134.134.136.31]:38904 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230194AbhGHBlM (ORCPT ); Wed, 7 Jul 2021 21:41:12 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10038"; a="270538753" X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="270538753" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 18:38:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="457708841" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by orsmga008.jf.intel.com with ESMTP; 07 Jul 2021 18:38:28 -0700 From: Jin Yao To: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com Cc: Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, Jin Yao Subject: [PATCH v2 3/4] perf tests: Fix 'Roundtrip evsel->name' on core-only system Date: Thu, 8 Jul 2021 09:37:00 +0800 Message-Id: <20210708013701.20347-4-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210708013701.20347-1-yao.jin@linux.intel.com> References: <20210708013701.20347-1-yao.jin@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the atom CPUs are offlined, the 'cpu_atom' is not valid. Perf will not create two events for one hw event, so the evsel->idx doesn't need to be divided by 2 before comparing. Signed-off-by: Jin Yao --- tools/perf/tests/evsel-roundtrip-name.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c index b74cf80d1f10..26c49dc3e01e 100644 --- a/tools/perf/tests/evsel-roundtrip-name.c +++ b/tools/perf/tests/evsel-roundtrip-name.c @@ -5,6 +5,7 @@ #include "tests.h" #include "debug.h" #include "pmu.h" +#include "pmu-hybrid.h" #include #include @@ -102,7 +103,7 @@ int test__perf_evsel__roundtrip_name_test(struct test *test __maybe_unused, int { int err = 0, ret = 0; - if (perf_pmu__has_hybrid()) + if (perf_pmu__has_hybrid() && perf_pmu__hybrid_mounted("cpu_atom")) return perf_evsel__name_array_test(evsel__hw_names, 2); err = perf_evsel__name_array_test(evsel__hw_names, 1); -- 2.17.1