From patchwork Wed Jan 5 06:13:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12704079 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 2C35DC433EF for ; Wed, 5 Jan 2022 06:23:45 +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=HI05I4h3qgqVjkEPwjzqbzBZuGjdPD7mDXOqYPgYjF8=; b=2PlZ1Phhf2RsI0AQvX9pOxzJY0 oxWTwHWet8GIXro7RZxPDDauk1I6W3/fL4JDhrsJv+Y39r5+CyIqxxrGMzF4YuLR//8/2KzzCDA2M nFcqBrLL4xeLvArxKVINWc/OuhmY/YI9O9Trl+TgTxBG/KfcMcuMNVN7U5Y1jM7WGxE1bKnD9NYmz jQnEwSF+qeutoE3gbBrZhKZd67z8g8G9BoOp/irNj1zH8Ib4VKFc8Q9RFugUFzOy8raNQBhESlJLo 3+kzNs2dV3rd7K4r8umogBADH60QCHIhkqanLS40kW9o6KNn5QIvPJDFCzxY8TzjRWFMO1rtakPdh ifgaaUrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4zgX-00DjYV-CI; Wed, 05 Jan 2022 06:22:11 +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 1n4zZD-00DfpF-L5 for linux-arm-kernel@lists.infradead.org; Wed, 05 Jan 2022 06:14:37 +0000 Received: by mail-yb1-xb49.google.com with SMTP id z188-20020a2565c5000000b0060be1f32877so53255398ybb.7 for ; Tue, 04 Jan 2022 22:14:34 -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=s2CIczuM8teFDrPnQG9a+NBNIXG/EojqlmU2x3Abtwk=; b=iQIZP6v+aQzjsT+5N9yl+8VS+kP6IxJ2BXJmJAzub0bF7IeOeuU7wpoypLHRvvE45g GSaRw8X3Y0A90fQUhksSvAjePe5Zngijp3bk1+2ATCPhZ2gWYhwiep91Y/BX6/nFlqXR 30Jjpui33ZCipogp0BV2hT5XhnjhXi1z+Lug+4tzC2wtshmzaGUWK3UAK6+m8/M9feR6 j+Hn/BahVyZXzVQ+PwZNOYnVw8MguTX+cV8+mUKu3PBvHwHyplaRXioz4W8Bi7ei4g9l U/qIol0P4d5CfKIx8LOBaNH5yeN5lS3uj8vyniPf9tYX0zpe2hG1ED81s5UHmhLXfVPh ToOA== 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=s2CIczuM8teFDrPnQG9a+NBNIXG/EojqlmU2x3Abtwk=; b=L2mRczhLvXa3lP0/QCNESu8/1mUPJm8L99G9hmClY2TYnA9OaRgWy26c+Vxji3XiSU ZDu50z+bUjwWsQmvHzCdQgCWsTgLa7C/LhRmzqGgr15XAwXic5V24wwYtyWeWILI8DIB D7yfqCeeDribAC5Xto0vjM++8dI3iwlhu6PVxBpSPsBY1PAl9lOLs/nt2vohK5i3UWEh ottCmd4TCnfSUv90/e0B3UXuwZQPOTf6jxMb82gdvz5nbwVMxCMZlXY04CLMvtn3gJ1/ 2VZhASFc39jxHFmAmzUVui+K2t9VJ3hrFAHEHPaHrszIO8R8k3oifKRe8UYDYzI0qRp3 IqMw== X-Gm-Message-State: AOAM5309UgM4cAW9a5neVHvNwIkqeZ9H0JQduOkP4ARWCMpc1WaPZlu1 EcqCWla2dx0KUIjwPt5wgwwghBeB23a4 X-Google-Smtp-Source: ABdhPJwhi3sud4t5iO6w6NBX4cfopeOHeN4mFoamBz1INVVY+4KehX3qmXCk55EYnJNSBhZQ2PieSk8uqis8 X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:3af1:caef:2937:5d2b]) (user=irogers job=sendgmr) by 2002:a25:3b10:: with SMTP id i16mr48115251yba.292.1641363274287; Tue, 04 Jan 2022 22:14:34 -0800 (PST) Date: Tue, 4 Jan 2022 22:13:18 -0800 In-Reply-To: <20220105061351.120843-1-irogers@google.com> Message-Id: <20220105061351.120843-16-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 15/48] perf cpumap: Document cpu__get_node and remove redundant function 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_221435_724261_7B76F5FC X-CRM114-Status: GOOD ( 12.77 ) 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 cpu_map__get_node_id isn't used externally and merely delegates to cpu__get_node. Reviewed-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/util/cpumap.c | 11 +++++------ tools/perf/util/cpumap.h | 5 ++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index b3e1304aca0c..1626b0991408 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -16,6 +16,10 @@ static int max_cpu_num; static int max_present_cpu_num; static int max_node_num; +/** + * The numa node X as read from /sys/devices/system/node/nodeX indexed by the + * CPU number. + */ static int *cpunode_map; static struct perf_cpu_map *cpu_map__from_entries(struct cpu_map_entries *cpus) @@ -222,11 +226,6 @@ int cpu_map__get_core_id(int cpu) return ret ?: value; } -int cpu_map__get_node_id(int cpu) -{ - return cpu__get_node(cpu); -} - struct aggr_cpu_id cpu_map__get_core_aggr_by_cpu(int cpu, void *data) { struct aggr_cpu_id id; @@ -250,7 +249,7 @@ struct aggr_cpu_id cpu_map__get_node_aggr_by_cpu(int cpu, void *data __maybe_unu { struct aggr_cpu_id id = aggr_cpu_id__empty(); - id.node = cpu_map__get_node_id(cpu); + id.node = cpu__get_node(cpu); return id; } diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index 9589b0001a28..f849f01c5860 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -45,7 +45,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); -int cpu_map__get_node_id(int cpu); struct aggr_cpu_id cpu_map__get_node_aggr_by_cpu(int cpu, void *data); int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **sockp); int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **diep); @@ -58,6 +57,10 @@ int cpu__setup_cpunode_map(void); int cpu__max_node(void); int cpu__max_cpu(void); int cpu__max_present_cpu(void); +/** + * cpu__get_node - Returns the numa node X as read from + * /sys/devices/system/node/nodeX for the given CPU. + */ int cpu__get_node(int cpu); int cpu_map__build_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **res,