Message ID | 20220105061351.120843-22-irogers@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 33D75C433EF for <linux-arm-kernel@archiver.kernel.org>; Wed, 5 Jan 2022 06:30:56 +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=DXIUWp/YBMOfnQMl3vEVfP+4F0jIY++vTqjYFgYdp5c=; b=Rng7dkafPnLzc5PyPXqghUie0M DnuOPtooZS//I/zUQrQK8ZwhbyMOiiXOnaWZZCPs7RiDShRLYdAb0Ye6sMS1hu3fbRqlbZxhXfw1f wZZfuFlPq6kNZ9HmXWflcrVI9L+As8UmUXUnYnyaGKtyyKz4aGdhKdEm2bBbfgYbzHMvOZE+sevJL zEVUTffR64AIK+5cqdjSMbcI7/eS8rir5HxeZyfj6dGt9Otw0SH3rmfJVkKwgCGZl+8W+VZF7TLjX jdeNksyQ98b3HF888wgUtpuo7DoPyfoPJpssnQn5iTOa7Gsol7NPBkPaIqumpLTRGSdmKDVSWP6VC FUt7pcVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4znQ-00Dm39-2z; Wed, 05 Jan 2022 06:29:17 +0000 Received: from mail-qt1-x849.google.com ([2607:f8b0:4864:20::849]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4zZU-00DfxT-Au for linux-arm-kernel@lists.infradead.org; Wed, 05 Jan 2022 06:14:53 +0000 Received: by mail-qt1-x849.google.com with SMTP id x10-20020ac8700a000000b002c3ef8fc44cso30041047qtm.8 for <linux-arm-kernel@lists.infradead.org>; Tue, 04 Jan 2022 22:14:50 -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=dJyDU+u/GJKBsmxifkeZSF2d3RNx4NXgNE9GZmNvqGo=; b=mfQ93GOFFQWwD1/V9zuwhoc7hdP1dIU+1SS/UsaRXnOZEXp2o3lSvg/Qq6XwyRZV46 rcwK19RHfa10XGoRSwXyV+KG5Z2jEUOCPUWgJmP+vpN3PcDAGL7f7IsqOMWbq4JbKOUD HnlaPQHyk2HvZCsZ58MRV/wmsoxxSX0b8eeVlfvC5PRo0fOyGptmSsKr3MumTDoDNday JztogXJ0rf/hx4FBZeA1jPgbe7y24crpHiSHMK6Nwk20J121VoTQh68U2Sf8EuJ5D/Kg 2XWCl05liCE/bBZsWfBj+eFE2yZAjyqkthV5ETu8UKPc4vCvtHg3MHy2oM2yYw1fLyPc 8wcA== 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=dJyDU+u/GJKBsmxifkeZSF2d3RNx4NXgNE9GZmNvqGo=; b=Rw2uja+sEHRc9q/xQ5m3anhn3nm+ObHtuLpNYoSQqIv8jABw+e01fyAIxFgffYaBZC gJg70y3pjIvzYbTycFhtVjyqdznw/QJYBV7hm1Eaq1qfE+glrWAsMg0Cu2f9xEybRNb+ ICBST/0fQG9wTQwTa2g0HIZlr1O8//hwIzMpY3DMIgXwghVcOWXKElMUR6BqQmfL/rZX RDahugEoNUsBsGA8IhfLKddW1Es4SbiULPgikm9lIHynk2X+RHOa+K9zJFydlowV72TY JEIsOYBLTRfhYrJCVKFxKJi8NyyMMc9x1CLLvRTbUwZhSqZ/AAsZS+ZYvNf/lhdDEBVy rxlQ== X-Gm-Message-State: AOAM531iPqfNC+gbhnwXlrfCkeq/SAQQGo8PsvdJ13svrJpndv4ncIQO WLbY33NbSMRcBaU2KEvj6QjoD73awoMC X-Google-Smtp-Source: ABdhPJx5WDAPqLbwXmPGrLlPvWLCgrymybmT0k5DF0hFbjzwUl/a129iO3FIhWM9PkkwuRxHgk1U/xqVl43b X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:3af1:caef:2937:5d2b]) (user=irogers job=sendgmr) by 2002:a05:622a:144:: with SMTP id v4mr46433782qtw.191.1641363290011; Tue, 04 Jan 2022 22:14:50 -0800 (PST) Date: Tue, 4 Jan 2022 22:13:24 -0800 In-Reply-To: <20220105061351.120843-1-irogers@google.com> Message-Id: <20220105061351.120843-22-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 21/48] perf cpumap: Add some comments to cpu_aggr_map From: Ian Rogers <irogers@google.com> To: Andi Kleen <ak@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>, John Garry <john.garry@huawei.com>, Kajol Jain <kjain@linux.ibm.com>, "Paul A . Clarke" <pc@us.ibm.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Riccardo Mancini <rickyman7@gmail.com>, Kan Liang <kan.liang@linux.intel.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Singh <vineet.singh@intel.com>, James Clark <james.clark@arm.com>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, zhengjun.xing@intel.com Cc: eranian@google.com, Ian Rogers <irogers@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220104_221452_422756_7B60299B X-CRM114-Status: GOOD ( 12.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Refactor perf cpumap
|
expand
|
diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index 32b8b5178f01..25a08d640d81 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -24,16 +24,18 @@ struct aggr_cpu_id { int core; }; +/** A collection of aggr_cpu_id values, the "built" version is sorted and uniqued. */ struct cpu_aggr_map { refcount_t refcnt; + /** Number of valid entries. */ int nr; + /** The entries. */ struct aggr_cpu_id map[]; }; struct perf_record_cpu_map_data; struct perf_cpu_map *perf_cpu_map__empty_new(int nr); -struct cpu_aggr_map *cpu_aggr_map__empty_new(int nr); struct perf_cpu_map *cpu_map__new_data(struct perf_record_cpu_map_data *data); size_t cpu_map__snprint(struct perf_cpu_map *map, char *buf, size_t size); @@ -67,6 +69,12 @@ int cpu__get_die_id(int cpu); */ int cpu__get_core_id(int cpu); +/** + * cpu_aggr_map__empty_new - Create a cpu_aggr_map of size nr with every entry + * being empty. + */ +struct cpu_aggr_map *cpu_aggr_map__empty_new(int nr); + typedef struct aggr_cpu_id (*aggr_cpu_id_get_t)(int cpu, void *data); /**