Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp93668rdh; Mon, 18 Dec 2023 12:36:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IE41tsXpJUKHe4DaeK9oDPaYU77wxnZ9aArCc3pVa6lnlF1kZNmvK9aPQwm9jlnsmlX6jlr X-Received: by 2002:a17:902:c1c5:b0:1d3:9baf:3d3d with SMTP id c5-20020a170902c1c500b001d39baf3d3dmr4628145plc.129.1702931809255; Mon, 18 Dec 2023 12:36:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702931809; cv=none; d=google.com; s=arc-20160816; b=YfxM2J6CI8X/fB1o7LNL7QB0JnYfUAECXQesX2/yuiiZ4vCvpbZUbanMHA9wVv0C6F ycc4AtkrIaO5AvDRP4VT94xiCGlQcDZPTPd8++gdtHQYVcf/ddLydVO/Hz6gqZ2JNbhM esP7KLXRUEvZa64K9cx5EFTw0mHU8yMhDCQ3qn5Sn4o4dSv9p8zWzuO40oegBQ2CxoKL UXdFbQS6RKr4KxZuFb9opHOBBXgEpGe+BVQJIN+AFhjwBUfcbSGt0oHI1j/PmShOfBdL 1Y2izc/E9bX+XHoJNIlLj4+tm4tkNfdMnRmLOPZyDhpODrMxMuvCCNyTkvzbPKczV6mj TGcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QdZ2l+t1qlgDPa77JT0bhYR4yiXcfyWNF1MRelJxMCE=; fh=FWQt6Qhlfs4LWiCj74nI3s2zWEKWl2ZDJBpc7A+1bPs=; b=MzWpY9mb6m/iLLNylns7Y/5qtzUmXIagzWkjthcaL5oym/OWK+8+TtICqZ2aoZRIow of5sld7M7YrE4Os+5de818CfJMbSvL5rhGzD3ha6PD/LH+qWBY91bTt+nRvElGkXXHnD Lyw3WbvcsqWcTtKP4ZgSGTf9z1NQ0Aaj3537NAopZ+HtOMupX5LzU36NIKeG1rB9lAG1 L96rT+2hQskJMj+sbsi3syRAH4yxr1XHV8l1PJEdHJ4OoRR6GRyDSGgr4g1EwvUvrGiL pQ2GEqYNUpIesiSiwhx8DSGKKVDs/vrXh2P46gK4Vl3lwUiQ7xReZ2hWk7XQU6wBi96d GaJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JoDCASE/"; spf=pass (google.com: domain of linux-kernel+bounces-4363-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4363-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t8-20020a1709028c8800b001d08be55d01si17996704plo.101.2023.12.18.12.36.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 12:36:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4363-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JoDCASE/"; spf=pass (google.com: domain of linux-kernel+bounces-4363-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4363-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DF740284B14 for ; Mon, 18 Dec 2023 20:36:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 353B573482; Mon, 18 Dec 2023 20:36:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JoDCASE/" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56D351E52E; Mon, 18 Dec 2023 20:36:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B30E9C433C8; Mon, 18 Dec 2023 20:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702931801; bh=dAOyyU+aPtQu+XM1BL0WUdir2IdvIhUUVAbyrsyrv5k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JoDCASE/Y//4LPYrP0o1Xcn64hqxs+o300P3uGJ/HzPNqHWzfHPby2IHVK1pbpjR8 1BBWH7/zQQNWkeJHSBuWGE+D6+kFI3MVA7L97YMZgASi7b77kjIU0M82pH3xtFl01x iYdG/D/57mPT9iktPSgBEMYl9ESEvCjMzZXpV+c9A+qRyBzFmFikLsumuppUoUVBe/ JNCJeC9Sb2l7raDx8n+dg0O+Csq5qBEV9vPhXtULBI1r/nwvbF9bPwwg0i2Fusgw1P tR2X+yzEbtpkD0miAw7EFY8Dw0FfH8RWrr62kAdhnn/g0jAyUMHPZsi2rgEQHw6HA2 GhIfFaW6edzyw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 12F2C403EF; Mon, 18 Dec 2023 17:36:39 -0300 (-03) Date: Mon, 18 Dec 2023 17:36:39 -0300 From: Arnaldo Carvalho de Melo To: James Clark Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Suzuki K Poulose , Mike Leach , Leo Yan , John Garry , Will Deacon , Thomas Gleixner , Darren Hart , Davidlohr Bueso , =?iso-8859-1?Q?Andr=E9?= Almeida , Kan Liang , K Prateek Nayak , Sean Christopherson , Paolo Bonzini , Kajol Jain , Athira Rajeev , Andrew Jones , Alexandre Ghiti , Atish Patra , "Steinar H. Gunderson" , Yang Jihong , Yang Li , Changbin Du , Sandipan Das , Ravi Bangoria , Paran Lee , Nick Desaulniers , Huacai Chen , Yanteng Si , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org Subject: Re: [PATCH v1 14/14] libperf cpumap: Document perf_cpu_map__nr's behavior Message-ID: References: <20231129060211.1890454-1-irogers@google.com> <20231129060211.1890454-15-irogers@google.com> <0e1ca950-b5a4-1e08-8696-4e3e12e21b19@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0e1ca950-b5a4-1e08-8696-4e3e12e21b19@arm.com> X-Url: http://acmel.wordpress.com Em Tue, Dec 12, 2023 at 03:20:47PM +0000, James Clark escreveu: > On 29/11/2023 06:02, Ian Rogers wrote: > > LIBPERF_API void perf_cpu_map__put(struct perf_cpu_map *map); > > +/** > > + * perf_cpu_map__cpu - get the CPU value at the given index. Returns -1 if index > > + * is invalid. > > + */ > > LIBPERF_API struct perf_cpu perf_cpu_map__cpu(const struct perf_cpu_map *cpus, int idx); > > +/** > > + * perf_cpu_map__nr - for an empty map returns 1, as perf_cpu_map__cpu returns a > > + * cpu of -1 for an invalid index, this makes an empty map > > + * look like it contains the "any CPU"/dummy value. Otherwise > > + * the result is the number CPUs in the map plus one if the > > + * "any CPU"/dummy value is present. > > Hmmm... I'm not sure whether to laugh or cry at that API. > > Reviewed-by: James Clark Thanks, applied to perf-tools-next. - Arnaldo