From patchwork Wed Dec 8 02:45:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12695218 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 14C10C433EF for ; Wed, 8 Dec 2021 02:48:09 +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=dOXU5mJ8K08g3vwWDn0ZoUInkTdSyDiMO5ASWNWcmGo=; b=Hpo/EUl18dNpuTjDop3ZZal7OL sx9f5yr6kji2iRkjGYOApGpL+0pV9vp3gOekm1sLGjvQy9JTGiogfo5C5/dtSTPtLQDzfaEG1tKYJ 1O7mO3ku73Xih3u6sjikfLEOolrZtEP7nwrD9rkd1nfON4fC5+9JpBaDVl7yb+6RuLS/hl3LwRAE0 DLPq1FlgTuWMvujXkWCBCyG01AsjuBlrSwjcOsWUeOiYANS1z8Ksyps4AEtBkq5QIsNLf7bX6Qj29 Y7LIKFkn9q0b93nqXsF+qZazMB7Suz/lU3/ikiwghn8JL2J5jqishmFolsHTp+sdrwsfcevPnIG/d R/97GiGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mumyc-00AjIq-G4; Wed, 08 Dec 2021 02:46:38 +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 1mumyF-00Aj5d-Rs for linux-arm-kernel@lists.infradead.org; Wed, 08 Dec 2021 02:46:17 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id t184-20020a2546c1000000b006008b13c80bso2175401yba.1 for ; Tue, 07 Dec 2021 18:46:14 -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=wlzvFhqo5Ob2FwSLKutkF1C2G0YnCryxWNekd2r2c2M=; b=Q8t3vuVt5q7bW590pG9nfgKeyqZ0Co6klwyMM5o4/s2kFV1RCqA9wgvbb6E0+ZM6RT UZQfEsOgxsd14ixKImooKlXrhBUlmsHt5SA1YCIelGWvUEC4HugO2tJ2RrCKVNNY6TfU OVLkMbvmHKlVq6r8yCTzn9ICfIk6FpRkYOq160a9v8JIVFuFv7i20J2Sl9WBRsPCrL9l EteHUVRn690jGncjOZRPeDgFtK5+c9TKUDPwlvCPnp2NlaDS+EV/h2o/GeXoSWcpUkzB QtO8De/+wJY1LEGyW3J6QpPqUgwl9PVC2CMq/rHQYt3BMtKVpOO0aFzk/s7R5VJ8lbub JAgg== 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=wlzvFhqo5Ob2FwSLKutkF1C2G0YnCryxWNekd2r2c2M=; b=VA30qCydMQfkQb1bsMUeiKpy2iTNQUNJSWaLOO90B3PpTnOfWSdtlHcm8zeY8+XMQK DA1zdGvaKe9kRrZ9Nsr/o1pXibdpKfcK0JEJlaYUzQe87EFCdFGG8K4927u9sxhtmXWr nYBuLaKKoJItLOP9l8oVUcZYU+kROdeU7UzYPRPup/hvG2fWBONoqVPbWi4buI7t3TFY T2GqMKLYOjvm5n1L5+wqOiD2h+Z/6twGQplsFmIimdXXYm11c5+h66hqEOMFSMTrvrsE nMWWuN85J1dagEP5oVPza659h1S5iKRrk2JdBDCWqZ+c/aZLKXLXooZ7etDey2o91rb0 w0hQ== X-Gm-Message-State: AOAM532bBTtj79WVB1xhc6wbb4vPEyBv0rX6g5D9sm49qKCqh+jB1zMs 7RCmCUTVLKr1NnGWgCZbFFH6xPL5aMbE X-Google-Smtp-Source: ABdhPJwPLdvV4+k3N1J9vtHeKfWpSN8ZFNP1H2Dx+thd1lOFDc+08AeCs8ZCcfhvyR8H0iivKwE9YjuCBMcg X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:57e:1dbb:34b4:8257]) (user=irogers job=sendgmr) by 2002:a25:aa43:: with SMTP id s61mr52118737ybi.186.1638931574080; Tue, 07 Dec 2021 18:46:14 -0800 (PST) Date: Tue, 7 Dec 2021 18:45:46 -0800 In-Reply-To: <20211208024607.1784932-1-irogers@google.com> Message-Id: <20211208024607.1784932-2-irogers@google.com> Mime-Version: 1.0 References: <20211208024607.1784932-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH 01/22] 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 Cc: eranian@google.com, Ian Rogers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211207_184615_927751_C33445A4 X-CRM114-Status: GOOD ( 11.81 ) 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: , 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. Signed-off-by: Ian Rogers --- tools/lib/perf/include/internal/cpumap.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h index 840d4032587b..1c1726f4a04e 100644 --- a/tools/lib/perf/include/internal/cpumap.h +++ b/tools/lib/perf/include/internal/cpumap.h @@ -4,9 +4,16 @@ #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. + */ struct perf_cpu_map { refcount_t refcnt; + /** Length of the map array. */ int nr; + /** The CPU values. */ int map[]; };