From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09998C35274 for ; Mon, 18 Dec 2023 20:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=02UpDxz3hCAGCnEqV8JZhRek3BAFXjhMwzD6U9hJXyY=; b=0d/qN1NJD7J99b yczxv3t59vzQnZSA7ncIFXksQG3jcfXu8LBgPTdYzsD2Km5ts0qm9cn+rbeTB7zFB2aCxxnqtNgpm P/HiTOyn1vZ77FZo1f2729rlMyEXNj85ZbbvVJC7Y9JCPb/219sRGdAGOjhF07GHlFyhU4Z9kqllp t1nxt5CMMhp+gp49aUwONSU70DSEZwpgwZuOVv4Qjl1CSm5Yn7clmhKp6+cTej+UnOKHCE2QrBeM7 g0mlRBTzu/IA9dvvEijl5ZS5iJLcEUGQ+Acgxl2fSa8pNWMmC/SnMVkZ+Mdrn1RokqGV7QLUCoyEC YIaHvUDgXIeeEabd4I2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFKM2-00C2Pc-1J; Mon, 18 Dec 2023 20:36:47 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFKM1-00C2PE-0Q for linux-arm-kernel@bombadil.infradead.org; Mon, 18 Dec 2023 20:36:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QdZ2l+t1qlgDPa77JT0bhYR4yiXcfyWNF1MRelJxMCE=; b=WsyXjCuSzCHiwRU3d3klCyFwdt LiUUnM9XevpoXbep75fLur6xifhDYp/Ib95/4gCtgPx0gXCOrk7yM8aOr3IkSmAvqnkxBHI9dBHv8 AXQIVRRshua5pUP93Wqzrws5pzmB6Tmd+eeiqIwFwNS0aDr4Tyj1EL/NbN5Sew73YmCxEGl74vYuL aiOZKyP/x/iaR/jLUJSN4l+0xtXccKoG3rO9Q681ZI9QIyL0721h5LI7K2IYX4db3rekFG12kuY/F TtHEgdQ30Hmp8EMxya+BwjCS8Ev1M45NJ4E9So9WFY/IgVIkZs7AAZLYZpNyXQ+tfQHeKu+kfNIu2 NpuGgS1Q==; Received: from [187.19.173.117] (helo=quaco.ghostprotocols.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1rFKLw-00FX9e-BU; Mon, 18 Dec 2023 20:36:41 +0000 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0e1ca950-b5a4-1e08-8696-4e3e12e21b19@arm.com> X-Url: http://acmel.wordpress.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel