Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp200230pja; Fri, 22 Nov 2019 05:23:03 -0800 (PST) X-Google-Smtp-Source: APXvYqyGsE9c0h4xEawMARJ+0EzP0i9XoixJ+8yejwCJvMX/sBo5T0QPDPCtObKf2UB12fsWSJ4P X-Received: by 2002:aa7:d342:: with SMTP id m2mr1044317edr.215.1574428983526; Fri, 22 Nov 2019 05:23:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574428983; cv=none; d=google.com; s=arc-20160816; b=tA4zr3ylFgYHGgFJXxVeM4YvCkWZij1pAsk5BzdiNITRMgdt5lseCPLSzpkd0/kjK0 9ARcZnmi68NhMVBLFb3XDoI6xJ9pUpSOeK+583UcmEkucvuLCiHn46KZ/RiBUUFt34Vq E2zHt/7ZvhsUolhyf19rwkLCCXZFExGs01QsFmPzDnpuZPHoWvZ8xK+dGJ1+k+qCs2A1 HLzvrEoSy1TzvP2Q0QFkwlFB6+j8Eh79JPu0qZ9eixX2uWmsqeAkQr3paOJAtLjnsZMM 4UVh3Mi/YqWfhp5aWF7Tl5rZr3sgsYEMY7d0nQpjZfA/eNW2+Ijmqmzss8JnDnR5oU9g xFWQ== 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:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TcpMO7N5Av7TXp8MXIEndacd5hJ7I/V4hiUn3Vf4UDs=; b=F0TN+o88O9lZQngAKpCahJ8oQPiD7s74A3H2bvBXFYYrpfIEhZDbmYoDWs9lvunvad xFspheBzMD81Up7WlBTH+81Vzs1cWePpxntoHbv1xkeHWMsDOpWUbZPQ8MbWdsHCDXvl anjW/ThIaoJQbtj9pDqESccFQuASivcwCDyG8W+dXaRfv3FWH+T4VMYlU6Zb/I2rZY/J 45zV6rMLwzDKGdkaJpGst5YAIZwGCE58rAqDh1rxEBBMyduWcrFqENGdvA22PyAaoFiS nk4hCd1cucOGRG3938Ss0uvlls5EcDLlR8k+nIycuAMKr1ftTOaBq6usrJWu0nHAmMlu jdmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ARM5VetO; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i19si4571992edy.125.2019.11.22.05.22.38; Fri, 22 Nov 2019 05:23:03 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ARM5VetO; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727876AbfKVNUo (ORCPT + 99 others); Fri, 22 Nov 2019 08:20:44 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:36587 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726548AbfKVNUo (ORCPT ); Fri, 22 Nov 2019 08:20:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574428842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TcpMO7N5Av7TXp8MXIEndacd5hJ7I/V4hiUn3Vf4UDs=; b=ARM5VetOd1nxc6Pf/whHhMs5KQ0vJM8pVXX7kv9LBbbZBHbCIMxz1CJ3YLK1TdWVe8dsIX Qces3D76rE3A2kPxmbUZJj653Dq/pz/3nKpyAooBU7Im5JHhLqhf/HCg7oxR2YtsEYRFkR l3xE0vjeZlwlPwz2DxcF8lJ21XM/ZZc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-9I8s34nrO3iYDcaehz-16A-1; Fri, 22 Nov 2019 08:20:41 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD97D800054; Fri, 22 Nov 2019 13:20:39 +0000 (UTC) Received: from krava (unknown [10.40.205.117]) by smtp.corp.redhat.com (Postfix) with SMTP id 8491028DFD; Fri, 22 Nov 2019 13:20:37 +0000 (UTC) Date: Fri, 22 Nov 2019 14:20:35 +0100 From: Jiri Olsa To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel Subject: Re: [PATCH v1 2/3] perf mmap: declare type for cpu mask of arbitrary length Message-ID: <20191122131513.GE17308@krava> References: <26d1512a-9dea-bf7e-d18e-705846a870c4@linux.intel.com> <0c716b33-a91e-2972-637f-e7c3a187fa77@linux.intel.com> MIME-Version: 1.0 In-Reply-To: <0c716b33-a91e-2972-637f-e7c3a187fa77@linux.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: 9I8s34nrO3iYDcaehz-16A-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 20, 2019 at 12:37:48PM +0300, Alexey Budankov wrote: >=20 > Declare a dedicated struct map_cpu_mask type for cpu masks of=20 > arbitrary length. Mask is available thru bits pointer and the=20 > mask length is kept in nbits field. mmap_cpu_mask_bytes() macro=20 > returns mask storage size in bytes. >=20 > Signed-off-by: Alexey Budankov > --- > tools/perf/util/mmap.h | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > 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" > =20 > struct aiocb; > + > +struct mmap_cpu_mask { > +=09unsigned long *bits; > +=09size_t nbits; > +}; > + > +#define mmap_cpu_mask_bytes(m) \ we try to have all macros upper case > +=09(BITS_TO_LONGS(((struct mmap_cpu_mask *)m)->nbits) * sizeof(unsigned = long)) we have BITS_TO_BYTES thanks, jirka > + > /** > * struct mmap - perf's ring buffer mmap details > * > --=20 > 2.20.1 >=20