Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1122681pxv; Thu, 22 Jul 2021 23:38:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh3R8sJNhrUcyTFLbHnREAJLI2N/zF9EMCws8SYkC+5onrfwXXkdQ8H44KDA/SuS//OQQK X-Received: by 2002:a17:907:f8e:: with SMTP id kb14mr3272805ejc.40.1627022303297; Thu, 22 Jul 2021 23:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627022303; cv=none; d=google.com; s=arc-20160816; b=iu7PGLC1GxlykoSHaPHJuQsvTfjgd2+lYJ80biP8424ojQ1JRtaSJ8xQtMkWX1jpWx i6vDTIIDB0dhHqute/LGo1jPkhA8aD95PowcaFMlAZq6+1G+HLFIchIz8ofznxhMb+Ke 18C076Nsr2hNVKCIdtwZtDmPi1FACzStJ3MMScGLF1ZkoWeCsiN82Q2nZVhi6M9vJuie bLtojJOc6y63LQAcf9VDeTS0F6QgduEH5B1CjZFB+H6nZP9kUTfR1UvLhiHGAPqt3VZD RYt0OqaFD+keR+YASYO5K/5rFQWz4ZwUjyfF+to/yKf4KU8Wgejpy+dg9tAghmlIBh/z VRCA== 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=geKZ/dGwT2QXlqFj2hAipcP4ahf6vcfU9tQbe+ntHgI=; b=gWWLgQVEtaRu0usP8XD7bm41GV12xQfYwBMfuYIzpqXM7cQyfsiZvlZpiGZA7ynioG HgapqqCFYVOZtVQYZZM8ObbPF1pmn/6oi7wos1CuxLPVwzTQGxO0N2OMO3Aq0RKJVsPC C9RuugIbEoYkReNC0WqE45sdLpUdrBczIKfWmGMZ95H3i9mqcxaEIuc3spulAkak30kE NcYpoyqQV6K1uiVYj9s+KZJgZSmn9JVYI+2J6bmRmGBvDfZjPgHcu6wJaWolCz0nGko8 e3cEAOryq5UV0fh0rUGjUmV2f3E9QzAdLMyXlIkyJrLmih0tXIkYj0wgipNLxGw5h2rr tw5w== 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 gz13si2029290ejb.496.2021.07.22.23.38.00; Thu, 22 Jul 2021 23:38:23 -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 S234089AbhGWFzs (ORCPT + 99 others); Fri, 23 Jul 2021 01:55:48 -0400 Received: from mga12.intel.com ([192.55.52.136]:50829 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234056AbhGWFzh (ORCPT ); Fri, 23 Jul 2021 01:55:37 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10053"; a="191412018" X-IronPort-AV: E=Sophos;i="5.84,263,1620716400"; d="scan'208";a="191412018" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2021 23:36:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,263,1620716400"; d="scan'208";a="455002302" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by orsmga007.jf.intel.com with ESMTP; 22 Jul 2021 23:36:09 -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, linux-perf-users@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, Jin Yao Subject: [PATCH v4 2/3] perf tools: Create hybrid flag in target Date: Fri, 23 Jul 2021 14:34:32 +0800 Message-Id: <20210723063433.7318-3-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210723063433.7318-1-yao.jin@linux.intel.com> References: <20210723063433.7318-1-yao.jin@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org User may count or collect only on a cpu list via '-C/--cpus' option. Previously cpus for evsel was retrieved from pmu sysfs. But if the target cpu list is defined, the retrieved cpus are not kept and the target cpu list is used instead. But for hybrid system, we can't directly use target cpu list. The cpu list may not available on hybrid pmu (e.g. cpu_core or cpu_atom). So we should not set 'has_user_cpus' flag for hybrid system. The difficulity is that we can't call perf_pmu__has_hybrid() in evlist.c to check hybrid system otherwise 'perf test python' would be failed (undefined symbol for perf_pmu__has_hybrid). If we add pmu.c to python-ext-sources, too many symbol dependencies are hard to resolve. We use an alternative method by using a new 'hybrid' flag in target for hybrid system checking. Signed-off-by: Jin Yao --- v3/v4: - No change. v2: - New in v2. tools/perf/util/evlist.c | 2 +- tools/perf/util/target.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 47581a237c7a..06f8890816c3 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1002,7 +1002,7 @@ int evlist__create_maps(struct evlist *evlist, struct target *target) if (!cpus) goto out_delete_threads; - evlist->core.has_user_cpus = !!target->cpu_list; + evlist->core.has_user_cpus = !!target->cpu_list && !target->hybrid; perf_evlist__set_maps(&evlist->core, cpus, threads); diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h index 4ff56217f2a6..daec6cba500d 100644 --- a/tools/perf/util/target.h +++ b/tools/perf/util/target.h @@ -17,6 +17,7 @@ struct target { bool default_per_cpu; bool per_thread; bool use_bpf; + bool hybrid; const char *attr_map; }; -- 2.17.1