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 0F9C4C433EF for ; Wed, 8 Dec 2021 02:50:04 +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=8PH04VS2i5FNc5AqMMSahIWO6P6rjLAZ4n6TY0V6t8M=; b=lwsb/dHgXUZ0fnyDyaNftVlRFR WjAbi5JhVQbg04JLDUg7ZNZHzJfx86ATgrpSlMGZQ+kicUvmzfzM5JFoyh8lQ2B60YoBXpAR4L1BW DMnaBnWpupzQHUkvpUWaYDs8Hx2asGaMNYtJz8GHwwvru+gj1uGO2CAE5q+indIfgCyt+I5o/qSni 1LKCX/mPNsNJw+8FFbrONeWL8kDYb4oPEKhOEYIRntMHO/+2X5sVzaacbiwO5GD/XmkJ1t8MJWLZP K4pxa07iTxuD4dwMcguIj6341/Az9r/dV+Vakr9QFUjCWiiAUlaZ8OburiXIoHTGXJqc4isHS17Vd q/Dlqz/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mun0M-00AkCe-MC; Wed, 08 Dec 2021 02:48:27 +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 1mumyS-00AjCn-3g for linux-arm-kernel@lists.infradead.org; Wed, 08 Dec 2021 02:46:29 +0000 Received: by mail-yb1-xb49.google.com with SMTP id e131-20020a25d389000000b005fb5e6eb757so2016050ybf.22 for ; Tue, 07 Dec 2021 18:46:27 -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=PpkGjAiD9Pmgxn49wBUdltRtlg09Ht80vguCmSdr564=; b=bsO1/BZY715fnD+OpzLRRRLLq+1Qkd/M0Xht4yQ/MxVcTs2Bh1E8mXbJ9PyQ+cMAgP SyagxJP4dEj1r9/723wMxvgRNQdbkCT/qnqDpHDk2e2kD2wopTmMemeioX5yY/WdW5nV LnDRjfYmgJhnYjWZK1PvHi0STgA2Zm5cV7K3MRKo/k3IV1+SmrV8atV4cQ8LujhpZWxB 5lV4i//hh7XeN1Hy9brrc/HBeEd6YSMjBr2/kgT63eXVocBws03o82mrA3+EmuRKLgJ+ A615t1HWG7FoUxyivnL6cljdngV5VRpLCNTHST4h5rWd9mSeAo+KjlSk549sajZbaYrR 5z9A== 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=PpkGjAiD9Pmgxn49wBUdltRtlg09Ht80vguCmSdr564=; b=b2LdUuQCwlajuCoAgZ3Z58LdSNunSlJKFokEsCnIQp08Km2ltA3IGtdLD/ydCC0or4 6odAdadYIayPl3ixk0eBTUxkLVLu3IqO2HAsmMhAppjKjIM6GRR1MfSJOy/sztglEeV4 OczcccZj6Ew2/oEfoZ4MszXn9lV4Hcku7+jKCICmCgAhmMGWOWIVD8aB325sV5kkJIaU 8L3AtmQq2JZ36PCdeMSpLNj2V0YWk97BVHPG7YY7g+givwEBM/vOZtDGNbTYKNvLXLPg CL2lI12dELonqp96Yuf4iMr4vuPCshk1Zp3T9Ca2UzX/QXw6eJDF0LqEnXL/2hs761kw NBFg== X-Gm-Message-State: AOAM5313MDSxw+squbwDwV9Hhc0q8NG37ZxC4BE0xQ+tomaIygHgCr1y vz2SEEtO7yrd8d/tRDwl/zodn4qVj2Bm X-Google-Smtp-Source: ABdhPJwRmlwXDMukk/OYba0wtfwfmmVyY39c1bnnpqA5sfA+W/TjhAXx8fflfpjQkKYAjg6Ahw88I/fRGCH/ X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:57e:1dbb:34b4:8257]) (user=irogers job=sendgmr) by 2002:a25:1c5:: with SMTP id 188mr55479456ybb.292.1638931586429; Tue, 07 Dec 2021 18:46:26 -0800 (PST) Date: Tue, 7 Dec 2021 18:45:51 -0800 In-Reply-To: <20211208024607.1784932-1-irogers@google.com> Message-Id: <20211208024607.1784932-7-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 06/22] 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211207_184628_213152_D5C07F0A X-CRM114-Status: GOOD ( 15.07 ) 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. 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.400.ga245620fadb-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel