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 09AE3C433F5 for ; Wed, 5 Jan 2022 06:15:54 +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:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=+OqKgMjIkcEvUMHFugtpSS9oqL4vj2H742g6rKaezSc=; b=CwhU5B1nbK3P06q2anpjwMmiEW z5coOnRSlNcvcWKcfrXpI0wYCnzeE70EEjhR34JZwpkxNtL/iiP20s2cjEZJjPQxb7CIhpryAOela o3raVC5fsCIE6SaLJF9qvO2NLR06c0+b2laftxJ7JIN/VXI8+doxKURO3YEvRsypk//cfxxEalAQ0 awlNHtjP6Sf4RdbAk4eI8mu5M9wUb36uRdU1/sLO4ZZ5raniddCHum8CctNVS1rfrVsf4weKDcLVr VJhsIGJCHewV4dq1/VEsyCIraUva8fq1OGIQU0p6Uqs/UOFiU06KQ6fIvZoUxRfLzd/nEEIw8NRdP Nq3f4rKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4zYq-00Dfey-5p; Wed, 05 Jan 2022 06:14:12 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4zYf-00DfaN-2x for linux-arm-kernel@lists.infradead.org; Wed, 05 Jan 2022 06:14:02 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id d5-20020a25be45000000b0060fdc206836so11904301ybm.21 for ; Tue, 04 Jan 2022 22:14:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=R/ciplz7o8MJIByj4LFS+saOMsnt5V7JtjWFtjIV8fs=; b=V7JpZzJs2gXL96POm5sWbjGVFsxCEyU6yORHL0piIH+V2J0iDr8cqIhAdgxMk0NpG2 ihnITjj6WX7sLmfTox6NWzGspuIm62GIfml/65OOMvopJzBHOpAV5NvT/hhGQxNEuRnW 8RDHYeRtMWKki5fSh7Ny6J+QjLlwjf1vnpt95IVV8w5qDw/8x8bYkAK2pUBRQjBBuxYv x/hTszUvFk2V+4W/SRtHl/Wj/u0WC/ajefYMlRQKUkwfQw2Mn8SXIv8gd2ewaIfXVBkb KrxpGq9fT4o2/ny07PtqZNv6f5H4hmZvffJuvOcQ46bw0cftsmQ7f7IKboepRuzgeIqq CflA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=R/ciplz7o8MJIByj4LFS+saOMsnt5V7JtjWFtjIV8fs=; b=yXVRG9D9OaxzLOn2G0BT6+q92YSOPFozaniHOA3XAmr+JEzvt43Kk/UxDW168F9vzv Qoz4rWwLPBIaZOFlCf0x8GlxB9uqTU/10QsXgxmVZG/KltWCG6ATokYnckJXQ0kwaMgc iL32zd7kFxMAy4rJUu8eXoosN3fB5XIY6kh16bWIZlmIcJRgiv85WDv9XEQRcoNv0aOc 6vQGD8wEPG+8jg+cb2MmMxoEdbXGZzr67RJjX/mY6a8FTfSPQzEXFrS7M71FFwy9tVS2 N2wyTwC7rbe70VKnLJGNfjKtxn1XvMa+7KrLQ8bgvXoGyjmVdasL2QUdlPmi1mTIjV4k c0gA== X-Gm-Message-State: AOAM530tPR8dpy1K/1LMWeI7QCgucCbSwVhd4MCHoufrpTGHK18Xsjn/ po8ExQXRAzPC4/x5HvlfhWu32SyCrluE X-Google-Smtp-Source: ABdhPJwdyf0wgTd2lSIk7nzyWpLw+BQ96MKzNpX/BLsv/eD23F915G6JTUqMUfh21ANltJJj5zhS0aBjI+rg X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:3af1:caef:2937:5d2b]) (user=irogers job=sendgmr) by 2002:a5b:950:: with SMTP id x16mr51295346ybq.764.1641363239591; Tue, 04 Jan 2022 22:13:59 -0800 (PST) Date: Tue, 4 Jan 2022 22:13:04 -0800 In-Reply-To: <20220105061351.120843-1-irogers@google.com> Message-Id: <20220105061351.120843-2-irogers@google.com> Mime-Version: 1.0 References: <20220105061351.120843-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.448.ga2b2bfdf31-goog Subject: [PATCH v4 01/48] libperf: Add comments to perf_cpu_map. From: Ian Rogers To: Andi Kleen , Jiri Olsa , Namhyung Kim , John Garry , Kajol Jain , "Paul A . Clarke" , Arnaldo Carvalho de Melo , Riccardo Mancini , Kan Liang , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Singh , James Clark , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, zhengjun.xing@intel.com Cc: eranian@google.com, Ian Rogers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220104_221401_151015_B963F9EB X-CRM114-Status: GOOD ( 12.63 ) 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 A particular observed problem is confusing the index with the CPU value, documentation should hopefully reduce this type of problem. Reviewed-by: James Clark Signed-off-by: Ian Rogers --- tools/lib/perf/include/internal/cpumap.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h index 840d4032587b..4054169c12c5 100644 --- a/tools/lib/perf/include/internal/cpumap.h +++ b/tools/lib/perf/include/internal/cpumap.h @@ -4,9 +4,18 @@ #include +/** + * A sized, reference counted, sorted array of integers representing CPU + * numbers. This is commonly used to capture which CPUs a PMU is associated + * with. The indices into the cpumap are frequently used as they avoid having + * gaps if CPU numbers were used. For events associated with a pid, rather than + * a CPU, a single dummy map with an entry of -1 is used. + */ struct perf_cpu_map { refcount_t refcnt; + /** Length of the map array. */ int nr; + /** The CPU values. */ int map[]; }; -- 2.34.1.448.ga2b2bfdf31-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel