Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp243427pja; Fri, 22 Nov 2019 06:00:09 -0800 (PST) X-Google-Smtp-Source: APXvYqy+Cv/VZMi0t3rzlYmrPoMbdb2yBHePkvGxZqsNsYchABU8dtv7EXKZ2QiTrGE92LKQ0Cde X-Received: by 2002:a17:906:3019:: with SMTP id 25mr22334086ejz.280.1574431208981; Fri, 22 Nov 2019 06:00:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574431208; cv=none; d=google.com; s=arc-20160816; b=pFit3UpPxvAEnqei0Vh2ksd0Nw+pC3l+ogVJnK08Op4ToY4YSN3kfcprCnNrpXD9JO 3XtHEGMtMqpDjvOxHkZkVMNXguMQe7ORJ4LWk+tY9da6lmKVNbUMmjaStfT3+2BnXtkA 33GydN5jbkS/KaPGchST2covdx25OGtP/c36088VXGNGuuDodYtgx+bWYUpTugw1hhsj 2sZ3LOIf5oqJlP+YuIIMutu7ATvHA3/gKE11oBpbJ8GKXazZRCoJOe7DoB4LlI1YEn6Q SZyOXPucqwOvpXC/gy7xeVEH5L/TT27qrNOHb7G7nul0zG84guWoV6leP2Vzvl+1r23Y eLfg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=3xUHm51fm47d+oTOVrHJ51GYWSxS5tQUHS0iy+i6xEU=; b=gp6UCS8WtL8E13YbPsLP1lpVzJ7gS10DF16Hp7kKEUf+M6WIZxQZZ++R/wZtCqMd4N +53jMN9jGObtqDf3sror6DM+nuzE/MCWo5xKpdmsS6xLgj3lrEKVSkS6Uou8o0Jl4gP/ qWKMnyYjIq9MKXzbhk+WjZGZNzAlSkgpwCrJxX1sE5EXl7n5/wizdiYakeWgrd9yZj75 uv6HSpv9cC0ifxsGi2BeXRPu6ILbpynmHg2pcL0OMiv4Gyq9AlwuGFRiL2s8I1KjABRK q6SEN3wCk8j19tIb0vEKPLTlrVT9QwSnIUBpnaC/27DUMlkBccyrEtCbVRofFm7v4tkM Qv8g== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce11si5178089edb.391.2019.11.22.05.59.45; Fri, 22 Nov 2019 06:00:08 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727777AbfKVN6k (ORCPT + 99 others); Fri, 22 Nov 2019 08:58:40 -0500 Received: from mga18.intel.com ([134.134.136.126]:58270 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfKVN6k (ORCPT ); Fri, 22 Nov 2019 08:58:40 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2019 05:58:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,229,1571727600"; d="scan'208";a="259730215" Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP; 22 Nov 2019 05:58:39 -0800 Received: from [10.251.82.176] (abudanko-mobl.ccr.corp.intel.com [10.251.82.176]) by linux.intel.com (Postfix) with ESMTP id 4DBEB58049B; Fri, 22 Nov 2019 05:58:36 -0800 (PST) Subject: Re: [PATCH v1 2/3] perf mmap: declare type for cpu mask of arbitrary length To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: <26d1512a-9dea-bf7e-d18e-705846a870c4@linux.intel.com> <0c716b33-a91e-2972-637f-e7c3a187fa77@linux.intel.com> <20191122131513.GE17308@krava> From: Alexey Budankov Organization: Intel Corp. Message-ID: <53af9c5c-a33d-4fc4-88e9-851b1caad3f1@linux.intel.com> Date: Fri, 22 Nov 2019 16:58:34 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20191122131513.GE17308@krava> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.11.2019 16:20, Jiri Olsa wrote: > On Wed, Nov 20, 2019 at 12:37:48PM +0300, Alexey Budankov wrote: >> >> Declare a dedicated struct map_cpu_mask type for cpu masks of >> arbitrary length. Mask is available thru bits pointer and the >> mask length is kept in nbits field. mmap_cpu_mask_bytes() macro >> returns mask storage size in bytes. >> >> Signed-off-by: Alexey Budankov >> --- >> tools/perf/util/mmap.h | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h >> index bee4e83f7109..a218a0eb1466 100644 >> --- a/tools/perf/util/mmap.h >> +++ b/tools/perf/util/mmap.h >> @@ -15,6 +15,15 @@ >> #include "event.h" >> >> struct aiocb; >> + >> +struct mmap_cpu_mask { >> + unsigned long *bits; >> + size_t nbits; >> +}; >> + >> +#define mmap_cpu_mask_bytes(m) \ > > we try to have all macros upper case In v2. > >> + (BITS_TO_LONGS(((struct mmap_cpu_mask *)m)->nbits) * sizeof(unsigned long)) > > we have BITS_TO_BYTES In v2. > > thanks, > jirka > ~Alexey >> + >> /** >> * struct mmap - perf's ring buffer mmap details >> * >> -- >> 2.20.1 >> > >