Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4977851ybi; Tue, 30 Jul 2019 11:30:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzB8clhbuLomCahHOwu889PQbVTz+EfOue89WvlJE55zaDtkJrXTieMidIdD/NSSxfy45e8 X-Received: by 2002:aa7:81d9:: with SMTP id c25mr43947374pfn.255.1564511429350; Tue, 30 Jul 2019 11:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564511429; cv=none; d=google.com; s=arc-20160816; b=t9g0qn883iSli48a5HjDcXL+ISfSKVf35vAULAw3opLjOdHXYa60FFg9PyqLeakQBs 0iGXT0UfF0Qw1ypUwHWI87U+KRxBl7riIGEFaWvSK5hcknPKgzhidAYoqTUMfR1lrOuy 2N6gvbREspRW/U2urVTnqSz83AM/tdfYN6A7j5T2dat2nnWZN0nTQb1vqFviPtKdfROU Nw7eR0hjvx0dAw72rGTRka3igmy+ZoT7mPWIeMkbOE6yXKzwDs65gK/Tl+LMfrBocs+c +KIqltJSOE3CWNh2uPrg9bUOJVaw5x8N5TxRgGd/Li/z+K7zKllfpwL2x/6Dme8nYV+d +ZVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=dxJbtl4/otJ2aQWWJR0CyGiTiB2QSntuTNV6GbD5jeI=; b=VbXGPn8hBHQXlT2hlGleuO4NhacB7gUReNvCmGMo9bZX7Ra1A4IKUmB6cu/faxY4OS RN0xiHPaNUM5P+Xez0ea+Bdl804GQoFHt/MeQ5m0IZDh6Uumy4Q0o66yG/FetsRvKutG owH3dBmd+jDXVl9k+t8dS57zBzX6urGekEc3Asr8v7KxY2hBgN/xtVrux2xJWJ0usJ5E puKzOhwD51farv/69t2Ai1g7WJaOKPlXZEL9+vx1jxuAxj1i4toerMYMZrdlju4o1x9D c3ssBK6XyIty+nHLctzwRPAyA2ydRHDqX6NOoBxDXaMar60rLtnINnYmQiPxE5TLmjf5 Ugzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b="AnI1bx/d"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si30059960plm.340.2019.07.30.11.30.13; Tue, 30 Jul 2019 11:30:29 -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; dkim=pass header.i=@zytor.com header.s=2019071901 header.b="AnI1bx/d"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729704AbfG3S2L (ORCPT + 99 others); Tue, 30 Jul 2019 14:28:11 -0400 Received: from terminus.zytor.com ([198.137.202.136]:40351 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726522AbfG3S2I (ORCPT ); Tue, 30 Jul 2019 14:28:08 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x6UIRueh3330138 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 30 Jul 2019 11:27:56 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x6UIRueh3330138 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1564511277; bh=dxJbtl4/otJ2aQWWJR0CyGiTiB2QSntuTNV6GbD5jeI=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=AnI1bx/dO9IxBczSj2/iQMsNQ4ED54UOcW7lZXdELBt8R+vw/JxnX9E6TXWOJ00mj /qLNPGo0nsfFfi++CcFp6EjSr6M2MfCYEngNEog0MRTWuDd3mDn77Y7nS1owagVfb4 8dUb5DLybu2PQN8LP+RCd9UHfDY/ABBgiHgw15mHcNM1W3wEplDKIIu3yMCs+YhGfT zkK9zD88DiD51XPIphPHaGYdLEA/qWK1UG+LhhCzcu4gK6z9621CDZz6ep4OrJCjFo mVKtTZeyznz1L8wi3sYx+wKbHj2sfNy1xOZFQ68YwY8XJZlZX87u5qdx0T8TDwvZBr GLUnzuP/G87Nw== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x6UIRtd93330134; Tue, 30 Jul 2019 11:27:55 -0700 Date: Tue, 30 Jul 2019 11:27:55 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jiri Olsa Message-ID: Cc: jolsa@kernel.org, acme@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mpetlan@redhat.com, tglx@linutronix.de, alexey.budankov@linux.intel.com, mingo@kernel.org, namhyung@kernel.org, alexander.shishkin@linux.intel.com, ak@linux.intel.com, peterz@infradead.org Reply-To: alexey.budankov@linux.intel.com, ak@linux.intel.com, alexander.shishkin@linux.intel.com, peterz@infradead.org, namhyung@kernel.org, mingo@kernel.org, tglx@linutronix.de, mpetlan@redhat.com, jolsa@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, acme@redhat.com In-Reply-To: <20190721112506.12306-29-jolsa@kernel.org> References: <20190721112506.12306-29-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] libperf: Add perf_cpu_map struct Git-Commit-ID: 959b83c769389b24d64759f60e64c4c62620ff02 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 959b83c769389b24d64759f60e64c4c62620ff02 Gitweb: https://git.kernel.org/tip/959b83c769389b24d64759f60e64c4c62620ff02 Author: Jiri Olsa AuthorDate: Sun, 21 Jul 2019 13:24:15 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 29 Jul 2019 18:34:44 -0300 libperf: Add perf_cpu_map struct Add perf_cpu_map struct to libperf. It's added as a declaration 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. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190721112506.12306-29-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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(-) 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);