Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1122515pxv; Thu, 22 Jul 2021 23:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7SAthAXCU7qClio5RrIsC4d1T7YALyaXSU/ao16IhJwfdt3CxSs5Ta+lsQB7j9P/e+rRD X-Received: by 2002:a05:6402:74c:: with SMTP id p12mr3776562edy.153.1627022282459; Thu, 22 Jul 2021 23:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627022282; cv=none; d=google.com; s=arc-20160816; b=A8eJE1qmH+WaOqnq2LtcHIJfVKSxWIlC7qlmRWstTqv799P9yELACxEcQhS20o04sD mJRIFNM2Dt+Lfzc43oPTW1iIGiHj5kyKHf+btwgNWwiAnTg+34UM1MXT/PprGZujPqva HA3BqdtbMkjlMI9XDtC6SMOCmcNOREJOykJL9qgk7y0tIaAtVigUGy+rwESa70FL2yWW V+RgXFUPL10wdEGc6ypSLXR0XRrhJmGqL8vqVjEa8HxtaQA28J1AFzXoD6Briy+yECgK 4gAud0kDs/B8iA3DgKNuwK/GVtgqvY5hCuTpBcvdjAXBoug1IWWx8R6YC7I4TufknJJP WiZw== 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=0dFq2s4ya+EEp0EjKnOylRsadEbgIPxBcPfZLdatVPw=; b=VM090BC6AB2TIFsOVnoFe0IDMbxjWdVeapeY6kdY2wfcmEr+rzitQax++lDCnC+XLQ edJzP/Q4AyxjRONmFeqrCAzDsgrNvTNcR7J5PTIGt+M8IzvWC0MPTH6uDuCIv7nIIV86 m9ca6xB37gWM+hbjxC0tvEdCc3CeH2uNcnn14nvrejgDi0Kvw4Nn4vHjplsbB/2W1W2f DjK/mYLNsPT9Z+bBWqpFqiKtvKTRq9558vYjPvei/0aEADC05TvPrObk6263QG4XhWkP eQSlsSuCub9BLTtwhsotN1phV4ym7bw0H43BzQxf3H5B6DdVRf+SZIBtVX6ocavCmF1q x+Gw== 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 b7si8652329edd.497.2021.07.22.23.37.38; Thu, 22 Jul 2021 23:38:02 -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 S234060AbhGWFzr (ORCPT + 99 others); Fri, 23 Jul 2021 01:55:47 -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 S234049AbhGWFze (ORCPT ); Fri, 23 Jul 2021 01:55:34 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10053"; a="191412015" X-IronPort-AV: E=Sophos;i="5.84,263,1620716400"; d="scan'208";a="191412015" 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:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,263,1620716400"; d="scan'208";a="455002297" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by orsmga007.jf.intel.com with ESMTP; 22 Jul 2021 23:36:06 -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 1/3] libperf: Add perf_cpu_map__default_new() Date: Fri, 23 Jul 2021 14:34:31 +0800 Message-Id: <20210723063433.7318-2-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 The libperf already has a static function 'cpu_map__default_new()'. Add a new API perf_cpu_map__default_new() to export the function. Signed-off-by: Jin Yao --- v3/v4: - No change. v2: - New in v2. tools/lib/perf/cpumap.c | 5 +++++ tools/lib/perf/include/perf/cpumap.h | 1 + 2 files changed, 6 insertions(+) diff --git a/tools/lib/perf/cpumap.c b/tools/lib/perf/cpumap.c index ca0215047c32..51b6553912e0 100644 --- a/tools/lib/perf/cpumap.c +++ b/tools/lib/perf/cpumap.c @@ -68,6 +68,11 @@ static struct perf_cpu_map *cpu_map__default_new(void) return cpus; } +struct perf_cpu_map *perf_cpu_map__default_new(void) +{ + return cpu_map__default_new(); +} + static int cmp_int(const void *a, const void *b) { return *(const int *)a - *(const int*)b; diff --git a/tools/lib/perf/include/perf/cpumap.h b/tools/lib/perf/include/perf/cpumap.h index 6a17ad730cbc..7c27766ea0bf 100644 --- a/tools/lib/perf/include/perf/cpumap.h +++ b/tools/lib/perf/include/perf/cpumap.h @@ -9,6 +9,7 @@ struct perf_cpu_map; LIBPERF_API struct perf_cpu_map *perf_cpu_map__dummy_new(void); +LIBPERF_API struct perf_cpu_map *perf_cpu_map__default_new(void); LIBPERF_API struct perf_cpu_map *perf_cpu_map__new(const char *cpu_list); LIBPERF_API struct perf_cpu_map *perf_cpu_map__read(FILE *file); LIBPERF_API struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map); -- 2.17.1