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 145CFC433EF for ; Thu, 30 Dec 2021 07:26:20 +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=Jzj4Jbz0nDyZZoJp8IdKXytgDDRCOz6FrH/YBUjgr1U=; b=Wr+WXCLSQtL+1TsCi8oK5tEsP1 lAvltEfav5jMvg74cqO7VRJWVxezKSnhwy7bth5tWXVtyJPeyZroRszDsMAhw20eC7S4VF8hCcl5H XSWz9wm9WP/ti93eJe7vCw5iZ1V5lDepzstje8aUi6sLBFouitIqoGPR0pnamwwxpwukGeLGLB2E/ srbkgCT25IrJUxy3Y1EenAR0zbyOKtE1z8FF4wY55aTXSeKB4CUNyCrbL6etvMEvF2YwFVvQBNIEy Poc3Z+lPmlTd5IuNirwQzCE3rHo5x7J7n7fJL8QF1fKuxVOtcMBy7kcyryk1gao4I5GlFYlTfNxAn ZLIL6LwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2pnt-003lLR-8N; Thu, 30 Dec 2021 07:24:49 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2pkC-003jX4-Cb for linux-arm-kernel@lists.infradead.org; Thu, 30 Dec 2021 07:21:01 +0000 Received: by mail-yb1-xb49.google.com with SMTP id z188-20020a2565c5000000b0060be1f32877so24505772ybb.7 for ; Wed, 29 Dec 2021 23:20:59 -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=I+B8qrA2cd/SP8Q+1EIjfviQAYs+Z/hoSScOqv9Gel0=; b=lCkRWKAn7Fa+jfz0d4hgkdKJv2mjjGswz+NBQBUOuRSoCdOBKJbyl3sEvCZH9S50rw PS4AVhK6dZ8fNZf57BsBrrGwEHk5IejbHwTK9PDcvy3qbM59VWWBOlAyxBkEbBUKzLwa JjQDd3iq9sNkIsH9g5Umm4CJ8rbSoehVuzGnUJIKTvNjp2GOCjWXCD91TgzHAIjaF5vc EuRtkvY2PYQ9GkbyJya3wkcWUDL0iLHN/fbnenkRx8SME6nB7Ga7R3Hu0eZPb1CFRiUU muh9+6RsbFN3cziMaL4lHVrztq3YFrdODhj7VSBN0UZ8Ufjj7wLpanYnbAtheK9k7dfM 65Iw== 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=I+B8qrA2cd/SP8Q+1EIjfviQAYs+Z/hoSScOqv9Gel0=; b=0tUgYR6pFd+bbdBgouTMhNWvRSI3TSWI7KADiQXD6l3U64ZGLglxiqnPUQA3mQWmjT aDuj2XzrmYUpE5PdGwcmxiNdNQU6gvHrfCfbjKwi+K4Zcz8xSH27mdBv+1zSekK/hQ16 l03ZWbJMDP6i4BwRkC2kj6bV0cAIbt5TwwvcEOktwQaNEQFb1KSxhzORGUyDtAac9Vfd IWZK+4KSgQ4fwyi3HbkFeRRwZyGzD3IKH8PkcYwe9eser1TJAQilwRW65KAmF+jY+8EH hoPF+6GRNa+Hru13IQvKX678dzG6hyw0my7e/WywbpXnrXR58BYBX14zlTUnQR6o0Ir2 fu1A== X-Gm-Message-State: AOAM531e81ey2lf87b5kc9R12ByOtG9bXxKqSp5+KT6/9/AfT4lYXwOz tOqWiN9qRJEgscFPS26psCb+XpCyaeLx X-Google-Smtp-Source: ABdhPJwyOytQjn1OiPL02zTtOTw3G5TCU33Bkd3QWN2ohtlxmVv02HGZDXzkKLx1KZIDhEkQYV0+4Ot4P8+n X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:31c4:9539:dba1:a82b]) (user=irogers job=sendgmr) by 2002:a25:2d6:: with SMTP id 205mr28389439ybc.425.1640848858996; Wed, 29 Dec 2021 23:20:58 -0800 (PST) Date: Wed, 29 Dec 2021 23:19:50 -0800 In-Reply-To: <20211230072030.302559-1-irogers@google.com> Message-Id: <20211230072030.302559-10-irogers@google.com> Mime-Version: 1.0 References: <20211230072030.302559-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.448.ga2b2bfdf31-goog Subject: [PATCH v3 08/48] perf cpumap: Remove map+index get_die 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-20211229_232100_457606_046513F1 X-CRM114-Status: GOOD ( 15.13 ) 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 Migrate final users to appropriate cpu variant. Reviewed-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/tests/topology.c | 2 +- tools/perf/util/cpumap.c | 9 --------- tools/perf/util/cpumap.h | 1 - tools/perf/util/stat.c | 2 +- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 69a64074b897..ce085b6f379b 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -136,7 +136,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) // Test that die ID contains socket and die for (i = 0; i < map->nr; i++) { - id = cpu_map__get_die(map, i, NULL); + id = cpu_map__get_die_aggr_by_cpu(perf_cpu_map__cpu(map, i), NULL); TEST_ASSERT_VAL("Die map - Socket ID doesn't match", session->header.env.cpu[map->map[i]].socket_id == id.socket); diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index 342a5eaee9d3..ff91c32da688 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -216,15 +216,6 @@ struct aggr_cpu_id cpu_map__get_die_aggr_by_cpu(int cpu, void *data) return id; } -struct aggr_cpu_id cpu_map__get_die(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_die_aggr_by_cpu(map->map[idx], data); -} - int cpu_map__get_core_id(int cpu) { int value, ret = cpu__get_topology_int(cpu, "core_id", &value); diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index a53af24301d2..365ed69699e1 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -34,7 +34,6 @@ int cpu_map__get_socket_id(int cpu); struct aggr_cpu_id cpu_map__get_socket_aggr_by_cpu(int cpu, void *data); int cpu_map__get_die_id(int cpu); struct aggr_cpu_id cpu_map__get_die_aggr_by_cpu(int cpu, void *data); -struct aggr_cpu_id cpu_map__get_die(struct perf_cpu_map *map, int idx, void *data); int cpu_map__get_core_id(int cpu); struct aggr_cpu_id cpu_map__get_core_aggr_by_cpu(int cpu, void *data); struct aggr_cpu_id cpu_map__get_core(struct perf_cpu_map *map, int idx, void *data); diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 9eca1111fa52..5ed99bcfe91e 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -336,7 +336,7 @@ static int check_per_pkg(struct evsel *counter, * On multi-die system, die_id > 0. On no-die system, die_id = 0. * We use hashmap(socket, die) to check the used socket+die pair. */ - d = cpu_map__get_die(cpus, cpu, NULL).die; + d = cpu_map__get_die_id(cpu); if (d < 0) return -1; -- 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