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 E0767C433EF for ; Wed, 5 Jan 2022 06:17: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=GsVe+XQb8nDD0zjA1FmW6UW/rg5zgRIkl8sAKvZDK/U=; b=GKP6bgRgQ19ebHH1jrFPil2oXE 00toF2GkDK6hw3GLJngYdFxzBa4g0jLEMzFHF/7mpRAP1pE3T7f6D5TlSHPbPzfflBxosLRUKF8A3 HKYOyqJjKVysdDiUN1jUbCrxfwdXILrOt9Ao4PJ/phdfOI/7UKR6s5JGy2apWEv9pAS1FlS+R9PgE VeuSIG3/SYeV1Z5tCwTWODB16/yV9BYPoxW470h2AdKK5EZFTaDn6HCZ3LV5dqKIY+OhCyy/85Y2Z QzP5f34/V6pGPfmaphlTgJmO8WHM/QoYyYhX5ood9tLp40jZcO9btWYYeLsh5UxQDuMoTD5KAgPQz xdFD4kZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4zb8-00Dh5J-JZ; Wed, 05 Jan 2022 06:16:34 +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 1n4zYu-00DfgM-0J for linux-arm-kernel@lists.infradead.org; Wed, 05 Jan 2022 06:14:17 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id s127-20020a252c85000000b0060be2b7b8e9so53245082ybs.8 for ; Tue, 04 Jan 2022 22:14:15 -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=+LqJvo4BVSCC4z/ulo+DXz7muzrQZZ9UxIK0VJ0+cJw=; b=Q57qzroT+zMRuUF1+Ie93SVaslnj2hn0BlL4Y2M0HuCkicF14c3foFy6dGtMbte37Q xIIQlF+pxyofeGRVqaHYwPHUgtp2YdRfCIOV6RUTetsB27sUSylI7T0rQCjRbhQZ2Nz0 R18sgxBU/Inh7kU9Nz757hQUPL+PIIKv5ZW6m2QZ8hQyO943jM8eUgL39dF/+J7otJQb a2D5Eqdp9JkDKtX0MTwX7bCHEXvwU0Vq8noCdqkfNHt80CYK3bHWR7hdz/hizq8KC2Nr 9cezxfEQqVZMIe92A4P3imB/E/I/+tyDfGije++Cc6TXDlVYfnyQnxCchWpeO1vw/lFx /XrQ== 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=+LqJvo4BVSCC4z/ulo+DXz7muzrQZZ9UxIK0VJ0+cJw=; b=JUqiMIBXQ66wvmozBoGOgOb6AQWqhLqjztsLKfRmb7TQN8Dw7M6UDLeZ06y6CNuKiJ ump22BNoaedaT1yxb/8fAWTMip4VIO/nyU8VBHPhPvQZdrV9xlx2oNsPz9wSt+trSJY3 t0E4Y9Q+Dvvm1n6L/TprGz61hdu3EIBbOymqFxaiqUwz8CBOkPpGtmiHhDS8jUWBHGhO kUo0ftMPEHJCKEjuwWXrLVyVO9pX5AFuAaIXouwPIV5+hFfF34Vu2+ZTVgd9PUs3ojDa 2aNt87MZl75tbjkz18+iOMKwg6ZHVz7bswbArwNVbm7CV/ur/W6KMemjZWXHNMYxcrcR tMbQ== X-Gm-Message-State: AOAM531Iy4SHeWAxmP3JAQnPNKdZxeQZKyyFta3jBuXU7MVQ0lJdPFf4 wrOWyCj+VVTawkuFFMU/+Lli1b+FKzvo X-Google-Smtp-Source: ABdhPJyVsw4dwask+PsCk9nciRkdG6/hifEVE5oeCiYDoWWUP0Scr/PViX37+UyudXFX0RJuEjQay4UsoOWa X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:3af1:caef:2937:5d2b]) (user=irogers job=sendgmr) by 2002:a25:84c2:: with SMTP id x2mr19278226ybm.51.1641363254542; Tue, 04 Jan 2022 22:14:14 -0800 (PST) Date: Tue, 4 Jan 2022 22:13:10 -0800 In-Reply-To: <20220105061351.120843-1-irogers@google.com> Message-Id: <20220105061351.120843-8-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 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, 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-20220104_221416_085742_7B782729 X-CRM114-Status: GOOD ( 15.39 ) 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 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.448.ga2b2bfdf31-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel