From patchwork Thu Dec 23 07:45:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12697986 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 B84A4C433EF for ; Thu, 23 Dec 2021 07:51:58 +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=sfDEkDWxy9bzPxdoW5R1OfWILJJ38PayyzhZa7ntElM=; b=jO9YfPIXhMLaq8MpbEiO1jLNfU ihrnhdlzjsUqxyUr7sKNgxkuSr6onGE3ivOltlEDJJQtVIh/xFigqdmMoa1HHl5VfOXX51NhhLQ/j mppLcu0PWBOtIPX++3fa44qJHx0ffrW6EZ0RuCS9D8isDrCK7bEGf0aEsptbik5SGaqFjC6ecTnHm R+yUJ727ehfPcLhT7U5I+dM6STwAD2NBKLL5FKiLo7JKguJuIcfB647/BAgeTdEpbl+QWF4HYlZB9 KAriC/udmYcit3+UhD0CsGYMFvyAs7mVLeTE/qcQCVv2jWarfmg7bYRWJnkpOwBu4sxY0pue3DhW+ pOJhCpGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Irf-00C1Kw-Ru; Thu, 23 Dec 2021 07:50:17 +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 1n0Io4-00BzVP-1r for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 07:46:33 +0000 Received: by mail-yb1-xb49.google.com with SMTP id w9-20020a25c709000000b00608a9489fc1so8584097ybe.20 for ; Wed, 22 Dec 2021 23:46:31 -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=MCK3PXHKxnJ+ljXLSZiTWLvHtcXTKUfApdV6xTysANE=; b=KBqN6r7LevbIJ7DspJ9ZQuQ1H8mJQaV3PHwKSOvqliRrH0SmzqfHG43ZeW1Kd+mKpu 8wcjrP78XSYonUw1hZvvoIexqKj5cAjqs3aaFZYqsFj6YtS7sUzKdMxWb5EOiA5IR9UY AJ1Lw56EryjZ0NDW58jhV2uGdg3izc2DVHPMEYeUBMG8Ku66IwtNaC9/l7EeMLSYyhFl 6rvnc8+k6SXJmoWrCsmV7QnzkXXVeaO/hescaBe+W4Pq/nZAn7Z/CZrc138Kf7KZpBYS YI4ExYTI78g7QbmaMcGZ8vmbKe9gim6Mr2b01f8usfTgCMnPiUMgKAhNk2nxrPBAkg1a jLIQ== 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=MCK3PXHKxnJ+ljXLSZiTWLvHtcXTKUfApdV6xTysANE=; b=x15T4GIBCx91uGbugEcc+juyaVCg0TgDIxADaveW2VWXTgXxKUKlQBjCUPIadNq/tb krn/BWiwLpLk4r9VyUgYyIKfSnulWPznqBTCmkoEqsvT8XqwjeoymuBTPodwv2diQlH5 NFgUyfXXTGPVOhBz2e1JHpyNYeEw8Pf4W0x8mZzu4ysAWgmCdd99q+r3kwj2Ee16gimh BUzXGVoFE62pUsGrA6oijr+JojdibopOW3GOVV3oOTnuz83iUjEcKdSYKaZqv+pRuz8V /cMKWNhIUwi6Z3qt53GlBIHuEgAwpB0hsow+Vbl/M4iU6ppbJDUVHvy8CtoI8iBDVv+J yrIg== X-Gm-Message-State: AOAM531uFNHnpa07pe/De1x3Ks4vf+jF+YG3mPNuPfKhum4i+k0EhWK6 vbaWVAbYcN6+b85q3Ze4vNP1QZFUcgmf X-Google-Smtp-Source: ABdhPJy8YqT1jzES8T/J1ThGT2eMjmeaj38Tu5Uwrk0WsTJnid8jvKkoKLBXCSeX8B6vtH3kyibTDWhBeHuL X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:4fef:90ff:589d:24ca]) (user=irogers job=sendgmr) by 2002:a5b:c8d:: with SMTP id i13mr1771035ybq.354.1640245590498; Wed, 22 Dec 2021 23:46:30 -0800 (PST) Date: Wed, 22 Dec 2021 23:45:02 -0800 In-Reply-To: <20211223074541.3318938-1-irogers@google.com> Message-Id: <20211223074541.3318938-10-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 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 Cc: eranian@google.com, Ian Rogers X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_234632_119436_65B1761B X-CRM114-Status: GOOD ( 13.82 ) 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);