From patchwork Wed Dec 8 02:45:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12695226 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 C8AACC433EF for ; Wed, 8 Dec 2021 02:52:11 +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=vwoxqIUBhmcuu+TZxZyUO1B9ZGR+hE/sHzV+i2J7G7U=; b=kCGhh/2J0NyKjFDk2pv4xxBUkX NttqQnUXDt551xzkgmEDMFCJjEEPfb74JAaFaZyVC2Kk9ygqIMBQp1wl5NSfYr2kMGEwydGl+RMci cS8jlr8qDKIm7DMEYmqxNz+z9kRHBGN1dK2iIXdHKCA3ICfB8CdL/eQP4vHNok61HVosAXMwDMZJh 1eB1h0tK3mOVsd3G0GNrsa5WsZyGUfdR0Cmi99EJjZamoTQfODxWtR9Q6UR5QtmpF8hN0KhYHVqCB zibOB29TsH90D4G3/M1ZWhi6F8HTyPVdFUHczCZhoPinUm3/Wlopmxo4WPtmKZi+rYw/8e8lEZoHK R4ClsObA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mun2J-00AlDH-HN; Wed, 08 Dec 2021 02:50:28 +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 1mumyZ-00AjHC-Bh for linux-arm-kernel@lists.infradead.org; Wed, 08 Dec 2021 02:46:36 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id q198-20020a25d9cf000000b005f7a6a84f9fso2107991ybg.6 for ; Tue, 07 Dec 2021 18:46:34 -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=qCcWQm7ULaKXv7EpzsJ1qS6IpbWkCU7LdRBfAG0kAPA=; b=JUhamctQ3qrTiZdiWXm5rjzzvF8rm6K1KVWWRTXCag/Q0GDX/jFOeNsLlZzhHsg+WT p3mANoXaz7q/TQ33ddEokLt/q38PFyB7fCaYRRrjcIWWvCtlMEOYgsHKPTvqL4K9lWaM cX0QHNFyW6grElO0zbPUlAQhtZeL2Kc4OsDAj37JEqB17zz9PyvLXgZ2zg4apR2X8UzD 6e4COJT7/wAfrwVucscPyGa6LM3Z9KYDzAsB6W/poNnF+SjTUNIdhq8IXIO0UlqLLNKR FXbpB3lXunf7xuFzDxsPwFUci+z8Pmrq+gAS+5yOVhQ/T8hTrO/GB8s5R8iHl81J7Gab bcbw== 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=qCcWQm7ULaKXv7EpzsJ1qS6IpbWkCU7LdRBfAG0kAPA=; b=uzensuSm/lXNX0o25yGVImgDXgVB8Lto8xy5qjVIV1iou1QH2JcnMS/XOoqWE5hgEI ldzW2OIR51rua0xt9UxWiMDjCnwvbdr5i0pCYfTy/AvyFYMAEg1BLn3dXtjLDcLb2OQ/ 0TYeFxJQqIw0nqyRv74+ZIPeUKYy4TXn/xK3UZOEuQRXKH8S4rqf644zYrEJ4OAPKMuR 7UoFH67bXgydnNS/2zp6qX3KZNwN/6ejGeyNop/g1/Wqz8vGDWZqzMq+XtR9SpQMn2py 16NjzEIWT5NP2GP/SeJKGRstXa+wN2cxuBZ508bkedoeicNjQDJ3BZZDOc3fZM0JM7Hw Hb6w== X-Gm-Message-State: AOAM530gujguMhUFY37AZ6IDIPxSER0YCOqbFrPnMgzloah0zt9mOqsc xM5kPWbC6YK7i3+gOEBdfHowoSZ6n3D/ X-Google-Smtp-Source: ABdhPJycwV1Bbk3HYBtPNArxi0kiGj/djJFIS15dtHWtRyLPYZF7FzfNjhe/Rc2CC66KvaGLeMWzFNKsh7AH X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:57e:1dbb:34b4:8257]) (user=irogers job=sendgmr) by 2002:a05:6902:709:: with SMTP id k9mr18161708ybt.222.1638931593911; Tue, 07 Dec 2021 18:46:33 -0800 (PST) Date: Tue, 7 Dec 2021 18:45:54 -0800 In-Reply-To: <20211208024607.1784932-1-irogers@google.com> Message-Id: <20211208024607.1784932-10-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 09/22] perf cpumap: Remove map+index get_node 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_184635_478086_6BDDB08F X-CRM114-Status: GOOD ( 13.74 ) 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 Migrate final users to appropriate cpu variant. Signed-off-by: Ian Rogers --- tools/perf/tests/topology.c | 2 +- tools/perf/util/cpumap.c | 8 -------- tools/perf/util/cpumap.h | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 9a671670415a..5992b323c4f5 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -162,7 +162,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) // Test that node ID contains only node for (i = 0; i < map->nr; i++) { - id = cpu_map__get_node(map, i, NULL); + id = cpu_map__get_node_aggr_by_cpu(perf_cpu_map__cpu(map, i), NULL); TEST_ASSERT_VAL("Node map - Node ID doesn't match", cpu__get_node(map->map[i]) == id.node); TEST_ASSERT_VAL("Node map - Socket is set", id.socket == -1); diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index e8149bcf8bfa..f67b2e7aac13 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -254,14 +254,6 @@ struct aggr_cpu_id cpu_map__get_node_aggr_by_cpu(int cpu, void *data __maybe_unu return id; } -struct aggr_cpu_id cpu_map__get_node(struct perf_cpu_map *map, int idx, void *data) -{ - if (idx < 0 || idx >= map->nr) - return cpu_map__empty_aggr_cpu_id(); - - return cpu_map__get_node_aggr_by_cpu(map->map[idx], data); -} - int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **sockp) { return cpu_map__build_map(cpus, sockp, cpu_map__get_socket_aggr_by_cpu, NULL); diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index 7e1829468bd6..f0121dd4fdcb 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -38,7 +38,6 @@ int cpu_map__get_core_id(int cpu); struct aggr_cpu_id cpu_map__get_core_aggr_by_cpu(int cpu, void *data); int cpu_map__get_node_id(int cpu); struct aggr_cpu_id cpu_map__get_node_aggr_by_cpu(int cpu, void *data); -struct aggr_cpu_id cpu_map__get_node(struct perf_cpu_map *map, int idx, void *data); int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **sockp); int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **diep); int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **corep);