Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5876663ybi; Sun, 21 Jul 2019 04:29:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfeh4P2bHqR4UhGpW++mFSUJoqVRU4xeAatnbEwcCxRIppIqCjPv8p6aapfON6PwbcTMC+ X-Received: by 2002:a63:e907:: with SMTP id i7mr65052835pgh.84.1563708590491; Sun, 21 Jul 2019 04:29:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563708590; cv=none; d=google.com; s=arc-20160816; b=v3zJS+uWn/3M0ZArpxZ2QvYnwA6JdAbRMZOTppEBxoYp5e9C47hABeyiFVSuC+WtYQ 1zYBJ4pPxBeqx3UxGRw/xfIUteEoM919UbmDcGlROBa/7HDrKn+ex31nRhckc+HuwJB8 uvTLW60AcnWBbrS/XPu4HhpVkiEMQKDRDctuxaLW3R4yd+RyRt3TbDiChr2wpTGYUHcf Ixqxo9IPciPCAvuCxs5RaZyBKzstBipd7wypEpEzdtseCQkuygjxCeJIjFc3woYf5+lS EY7xkH4SDSgbU2PRWYFA1Z7c+TuVXfhmsvce+GLC9aqtUkNwpJCNBtoh3/9K6RFR8m+m EaBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9wwl5wYurv7q/sd9ZpO3mVvBufCsbBvHbZYYHH6rfuQ=; b=Aoa6EMur5MGUukxsVKVr5PYsW81mFIdp+2+241lLZwUR1/RqejNV6fILJ07mofDaqq SpMv87uqtlfWT0SVPFxFnee2LbRCzDbrJYn3dEaTGgLOFopzve6H9gbigDqIxGqRVJTQ ATUr7vT1VZ62LVL+cYNfNrt51nlrRoyH6zjIukI2x8ES0KBcTkjOpEoU0nyTVnbkeh7p TgDQzwQWWd/dUiqaaSVnU8Vihe+xJxGA7MWizClrtjqxb0A7ya8M7GlLE0yB73Vycmx7 ATYJSwbHW3bTGIzQWPnoknkPFu1Nri4Y5aS+8fmb2b2EzhlZRLyNt0a3OQQdViiRYcnx EgBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si37684429pgj.54.2019.07.21.04.29.34; Sun, 21 Jul 2019 04:29:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbfGUL2g (ORCPT + 99 others); Sun, 21 Jul 2019 07:28:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46804 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfGUL2g (ORCPT ); Sun, 21 Jul 2019 07:28:36 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CB5F3082132; Sun, 21 Jul 2019 11:28:35 +0000 (UTC) Received: from krava.redhat.com (ovpn-204-23.brq.redhat.com [10.40.204.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 230F75D9D3; Sun, 21 Jul 2019 11:28:30 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Andi Kleen , Alexey Budankov , Michael Petlan Subject: [PATCH 28/79] libperf: Add perf_cpu_map struct Date: Sun, 21 Jul 2019 13:24:15 +0200 Message-Id: <20190721112506.12306-29-jolsa@kernel.org> In-Reply-To: <20190721112506.12306-1-jolsa@kernel.org> References: <20190721112506.12306-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sun, 21 Jul 2019 11:28:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding perf_cpu_map struct into libperf. It's added as a declaration into into: include/perf/cpumap.h which will be included by users. The perf_cpu_map struct definition is added into: include/internal/cpumap.h which is not to be included by users, but shared within perf and libperf. We tried the total separation of the perf_cpu_map struct in libperf, but it lead to complications and much bigger changes in perf code, so we decided to share the declaration. Link: http://lkml.kernel.org/n/tip-vhtr6a8apr7vkh2tou0r8896@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/Build | 1 + tools/perf/lib/cpumap.c | 5 +++++ tools/perf/lib/include/internal/cpumap.h | 13 +++++++++++++ tools/perf/lib/include/perf/cpumap.h | 7 +++++++ tools/perf/util/cpumap.h | 7 +------ 5 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 tools/perf/lib/cpumap.c create mode 100644 tools/perf/lib/include/internal/cpumap.h create mode 100644 tools/perf/lib/include/perf/cpumap.h diff --git a/tools/perf/lib/Build b/tools/perf/lib/Build index 5196958cec01..195b274db49a 100644 --- a/tools/perf/lib/Build +++ b/tools/perf/lib/Build @@ -1 +1,2 @@ libperf-y += core.o +libperf-y += cpumap.o diff --git a/tools/perf/lib/cpumap.c b/tools/perf/lib/cpumap.c new file mode 100644 index 000000000000..86a199c26f20 --- /dev/null +++ b/tools/perf/lib/cpumap.c @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include +#include +#include +#include diff --git a/tools/perf/lib/include/internal/cpumap.h b/tools/perf/lib/include/internal/cpumap.h new file mode 100644 index 000000000000..53ce95374b05 --- /dev/null +++ b/tools/perf/lib/include/internal/cpumap.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LIBPERF_INTERNAL_CPUMAP_H +#define __LIBPERF_INTERNAL_CPUMAP_H + +#include + +struct perf_cpu_map { + refcount_t refcnt; + int nr; + int map[]; +}; + +#endif /* __LIBPERF_INTERNAL_CPUMAP_H */ diff --git a/tools/perf/lib/include/perf/cpumap.h b/tools/perf/lib/include/perf/cpumap.h new file mode 100644 index 000000000000..8355d3ce7d0c --- /dev/null +++ b/tools/perf/lib/include/perf/cpumap.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LIBPERF_CPUMAP_H +#define __LIBPERF_CPUMAP_H + +struct perf_cpu_map; + +#endif /* __LIBPERF_CPUMAP_H */ diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index 22729beae959..c2ba9ae195f7 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -5,16 +5,11 @@ #include #include #include +#include #include "perf.h" #include "util/debug.h" -struct perf_cpu_map { - refcount_t refcnt; - int nr; - int map[]; -}; - struct perf_cpu_map *cpu_map__new(const char *cpu_list); struct perf_cpu_map *cpu_map__empty_new(int nr); struct perf_cpu_map *cpu_map__dummy_new(void); -- 2.21.0