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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3D59C433F5 for ; Thu, 23 Dec 2021 07:46:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346955AbhLWHq2 (ORCPT ); Thu, 23 Dec 2021 02:46:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346975AbhLWHq0 (ORCPT ); Thu, 23 Dec 2021 02:46:26 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10AFAC06175A for ; Wed, 22 Dec 2021 23:46:26 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id i187-20020a2522c4000000b006093b616e65so8615201ybi.17 for ; Wed, 22 Dec 2021 23:46:26 -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=uVyVqD21U2Soqznhfqq2tSEZ5WG+Ru8TxcMiQZbzBD4=; b=K+hioLFYWxIsTHvDePn3dCFjJ7SmLeflYQmFDXxOQ3TYga15SjzP+3mwkg8gYlY+xw MKDtUFd+0Z3jOMvAo1kXdHZ77m0At1myTt4iEKbGKzNMIfbgu3IPlVJqu1SXiTwdkT2E GdbyWj8MoAC3fVWErY10CAj7BNdmuRyKB670QLUEjX0f9XuUP0gVSli649x5P702cRar 9U82rQQblLXbYrc2/6fkGNfan8w1dV9/rm+39ZIDDSbhi0ulKXh6YX7GXSuxm1KEM5pS DydwdjpBSYybD5OYM54ZY6Ovga01RZXDhwC2/nG61Mb5Ve0+joZW7HsO7jQf5VBWBU/h nx9Q== 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=uVyVqD21U2Soqznhfqq2tSEZ5WG+Ru8TxcMiQZbzBD4=; b=GtBaherumtS7StHmqFPjfXXH4GKdeuL+YAY0HKOTBXvMWgMVEOjN8ZQ78/haBs/KSS YRGjP7+PFIizuXe2BuXeoYeQuLHogLiwkWAaSuwaxIlf+D77QoXD93rPXHWPaMaSpSIy uMWdkIucBBoVgS1P7a8NX8+7JLd60HazcNJIuX1VSp1LnHTxuFqLNHyfmoQ/8ZQRDk7p sVxJeIi9dNFOeHWEpuE8EaZWpcSWoRBjpCk3HixObL71oJVje5gMWaIZA5GSaTuDXYlQ bClLJbwtJbu/V715Zaq8nndGshCwv9g+FRH2ikFQFE31y96EEUUTIhQBvdHCKdpkuc09 rvlQ== X-Gm-Message-State: AOAM531FVlNTXQoPY9kr+k4hVb7qiDeIfXaY57BzAVIemSswB3wmBTGl rF2Eh6gEILXNJcFsK1XS1G67501hyE3e X-Google-Smtp-Source: ABdhPJyJGIW6yzS9rYiVxPItQMeHKyfomy5FZW4D3XI4uf7L/TyXgn8bsy9VPlHhgO/t5iA/Gj+WLYygoMts X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:4fef:90ff:589d:24ca]) (user=irogers job=sendgmr) by 2002:a25:33d6:: with SMTP id z205mr1633609ybz.36.1640245585299; Wed, 22 Dec 2021 23:46:25 -0800 (PST) Date: Wed, 22 Dec 2021 23:45:00 -0800 In-Reply-To: <20211223074541.3318938-1-irogers@google.com> Message-Id: <20211223074541.3318938-8-irogers@google.com> Mime-Version: 1.0 References: <20211223074541.3318938-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.307.g9b7440fafd-goog Subject: [PATCH v2 07/48] perf cpumap: Remove map+index get_socket 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.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 869986139146..69a64074b897 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -150,7 +150,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) // Test that socket ID contains only socket for (i = 0; i < map->nr; i++) { - id = cpu_map__get_socket(map, i, NULL); + id = cpu_map__get_socket_aggr_by_cpu(perf_cpu_map__cpu(map, i), NULL); TEST_ASSERT_VAL("Socket 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 feaf34b25efc..342a5eaee9d3 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -136,15 +136,6 @@ struct aggr_cpu_id cpu_map__get_socket_aggr_by_cpu(int cpu, void *data __maybe_u return id; } -struct aggr_cpu_id cpu_map__get_socket(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_socket_aggr_by_cpu(map->map[idx], data); -} - static int cmp_aggr_cpu_id(const void *a_pointer, const void *b_pointer) { struct aggr_cpu_id *a = (struct aggr_cpu_id *)a_pointer; diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index 9648816c4255..a53af24301d2 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -32,7 +32,6 @@ size_t cpu_map__snprint_mask(struct perf_cpu_map *map, char *buf, size_t size); size_t cpu_map__fprintf(struct perf_cpu_map *map, FILE *fp); int cpu_map__get_socket_id(int cpu); struct aggr_cpu_id cpu_map__get_socket_aggr_by_cpu(int cpu, void *data); -struct aggr_cpu_id cpu_map__get_socket(struct perf_cpu_map *map, int idx, 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); diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 09ea334586f2..9eca1111fa52 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -328,7 +328,7 @@ static int check_per_pkg(struct evsel *counter, if (!(vals->run && vals->ena)) return 0; - s = cpu_map__get_socket(cpus, cpu, NULL).socket; + s = cpu_map__get_socket_id(cpu); if (s < 0) return -1; -- 2.34.1.307.g9b7440fafd-goog