From patchwork Thu Dec 30 07:19:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12701269 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 4F3D0C433F5 for ; Thu, 30 Dec 2021 07:26:53 +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=vAlD3k0U2crucfw050PX56qjcZDHixkor4qsATBTyHw=; b=LHfMkDpkjkBBWhe988Lew4sYc7 moZqvVw2yoN+qAB1bLBv92k8SHZTk5h1lkARusBn+lxmsMQchzyWGr9sj0lOuzt9fYY3AQX8brctH zNluxSJlK51Sz/5wmKH4pPoPb6yQ8puXJOra5Fm93XSd+4lC+NxhTADg1WA9WPPI1HpTXIxFXe1T1 50z8gkTHigRBFCL8f1isfxps2Jp346pJFDSB3+Gk7KfWre9RI9PHSJNJblBY0HXQcfOLSwJ85o4V0 uyVWh1mqWaeS0noGO9gIKhaxuYbSfYSMHj0UFll8H7BUt3FnZU+1PQISMszlgPk5zMggsR0dqFjWi chFTLD9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2poM-003lVG-8R; Thu, 30 Dec 2021 07:25:19 +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 1n2pkE-003jYg-VH for linux-arm-kernel@lists.infradead.org; Thu, 30 Dec 2021 07:21:04 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id c5-20020a25f305000000b0060bbdf755f7so25224524ybs.14 for ; Wed, 29 Dec 2021 23:21:02 -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=Zr180MbAuyMK3FOJ6p+f1v/pd05fFRyT7sFFspoiHfQ=; b=fP1j5ptzi9GlhwtnDvoqIyo74ilM6/YDYz1fP/LS32JpV9WtF2ADtQMONbQeWdcBNr OptvIPdqkgV4kFSvsZ1QsXNS2K/Fcf0b8RpyPjNxGoRbY1N1r2zcDhgqRSs2HDfVqH/+ yXYctxMFAYB0cC6EnjxMGShfoysusAOtFsfnbfE3RPCFMncRBow/76+4W4Lad2WBCEHK 2EiAKWKdDuKOuTbz8zTHq0zJxvWq16YJoFZyje/Ma+OF1LEZSt+XiXcUr6Gtz7wzmTZl ki3l4gK1+P/KlGJoKj19GUMOkhyCD2wB5KNtDjcyHF1aP97A4LhaJ7qQdZgUSvBcqdNv Prng== 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=Zr180MbAuyMK3FOJ6p+f1v/pd05fFRyT7sFFspoiHfQ=; b=Ol5ihufD72Afnl8YtBt2hYUxSQqgiJUidGMTiA5p090RGnw2fZNNCxM0g0SC6+I6Dh fBc0nTvYB9F2Kf4SB8C7D78jOD+EjNK3RqyR48IX/XTVhdkMLGySQe746WBnm92/d2Bm LEcP4qg4T5Qg537yQ1mXftCtckCH7HypSVk4bRvUUelNBOnlpomiFPS6dZY9MNSxq2Iy WNJOpdsDO2Ad6BJ4iEutE20sN4f7dW2DlUY4OASMurFAcNMjxCmN0QRBeFsh1uhhLUtr +zLVWkSICOdgh8VSKwJY452VE1WqTKBsrqr/jEnPhO9V7WZWO6gCjyciGkISn60ARjhD dUig== X-Gm-Message-State: AOAM533dtUj4JvvC92iqTy60BY4KcA6qBZ2gMpPM05FvooauSDCfa9dj sfG00R89+oU7E9b+IEDfQapWuXdWO+AR X-Google-Smtp-Source: ABdhPJx7W8qgBsUFQ6UIrvbnMt3qUKs9cQzNi3g3VfufzTwauI827c+pL7b1ClFQ+Ed/Zjmjs5ush3YBLm1O X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:31c4:9539:dba1:a82b]) (user=irogers job=sendgmr) by 2002:a25:aa34:: with SMTP id s49mr22340468ybi.356.1640848861508; Wed, 29 Dec 2021 23:21:01 -0800 (PST) Date: Wed, 29 Dec 2021 23:19:51 -0800 In-Reply-To: <20211230072030.302559-1-irogers@google.com> Message-Id: <20211230072030.302559-11-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 09/48] perf cpumap: Remove map+index get_core 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_232103_052263_B9CD3841 X-CRM114-Status: GOOD ( 13.89 ) 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. Reviewed-by: James Clark 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 ce085b6f379b..9a671670415a 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -121,7 +121,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) // Test that core ID contains socket, die and core for (i = 0; i < map->nr; i++) { - id = cpu_map__get_core(map, i, NULL); + id = cpu_map__get_core_aggr_by_cpu(perf_cpu_map__cpu(map, i), NULL); TEST_ASSERT_VAL("Core map - Core ID doesn't match", session->header.env.cpu[map->map[i]].core_id == id.core); diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index ff91c32da688..e8149bcf8bfa 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -246,14 +246,6 @@ 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) -{ - if (idx < 0 || idx > map->nr) - return cpu_map__empty_aggr_cpu_id(); - - return cpu_map__get_core_aggr_by_cpu(map->map[idx], data); -} - struct aggr_cpu_id cpu_map__get_node_aggr_by_cpu(int cpu, void *data __maybe_unused) { struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id(); diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index 365ed69699e1..7e1829468bd6 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -36,7 +36,6 @@ int cpu_map__get_die_id(int cpu); struct aggr_cpu_id cpu_map__get_die_aggr_by_cpu(int cpu, 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); 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);