From patchwork Wed Jan 5 06:13:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12704105 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 121BFC433F5 for ; Wed, 5 Jan 2022 06:46:09 +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=EgGWcSkKDXNdXN+wrUNH6Sw9nKaBOR1YkWUuQBItfn0=; b=ObMqHGWFiZiVWDAiqB+MIkp/c2 g242bSMsZuXTc4jT6zEoZ1060rjFosUmpJA0VZKWfjghzns1xtWDX7qbsay5w4ZCHXwEEOnEpxVKI hjF7otgv8++5Fvk71rO07TLNaKR5gnEDYn2rUjKBFWIXggv7tcxbaWaU+emg+Skxcx1DpeQcbSTVT EuVSww4oMg2iojA0DaRmmevqIEk/hWsl4EpVKNoe1nyjqMqYMIQtv3pXZOr2z9PwaOTcIb2V2bazz Phv2cdcB4tYNwMDi1J5r5EjmPcbEP/3Fl/cvTKWJZ+CmSA6Hw+ULgCTTHdmqKkYPKSvdTFajkTf13 YUW8Wugw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n502G-00Drbq-6e; Wed, 05 Jan 2022 06:44:36 +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 1n4za7-00DgPT-ED for linux-arm-kernel@lists.infradead.org; Wed, 05 Jan 2022 06:15:33 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id n2-20020a255902000000b0060f9d75eafeso15619783ybb.1 for ; Tue, 04 Jan 2022 22:15:30 -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=XzElm/I104YF1oOu+ETkQDoVDrD7T7dkjmJMXov3Vlo=; b=QZ2qFGHJYt+gz6xOXt1LhDiyGD+OPylHFok9czJlkdjuWFUMdmdaVPI6oWRcEqfwK3 XwF3f8SH1obOmcA2aH+7S9uxsp/MnFT8O7h0CRlq921GR3uNm82uuW0G7VA049i6Fpod HDxG9APN7M8zfaIhi+5h71bK/cVV2YcEDiFdK7po8enphcw/uerbn6SaNgEaw/kuAWXk G3z0WkaYphAsdgTqS9FohJRPxxtzAgrLCLADCU4thPERKLo9avwHssOY5J1Vh6cGBvF9 ilgXMJld057L5ODWQRYooaOgwVrE3hu/x9OdDD9OHAczymIIiU+ZHzvpKW/rF0CWy/Z1 LDxw== 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=XzElm/I104YF1oOu+ETkQDoVDrD7T7dkjmJMXov3Vlo=; b=1bAZ399i7ncy0c1Kbt+oeHm/ivE8Dn3DAsGUPnvsR+8Ke36P8Ssxg9cvMwxkNIkIts 9iKEoKVMOlrp1mfzEbPsHcFN1P9lrKSXRXqAkRrhCxlvXUFl65lmboB/fl9eUycPMcKB pQazWyoptQeLDB/VZK1diaRZRW1ubNWoLLz+rFb7fl/ugDJ/2teyKiFREq+akSPC/xcV YSCGayxHu9srNQ713lzxGQf6hlCzwfncthjGP0YZ3AALvn6g04GIZsyFh90lKVIQ+sJa dgDalOCd2KT8Ikv6huGQUEa4Uu8e8xq17T6bHNXYw9BEfv+vuoSmAXjrTD4y3+0lz3YG Lr6A== X-Gm-Message-State: AOAM533O/liQOGOz+/QT1882YQRq2ZXRWbh0jiivnt6e3JmRW8/MqFIx sFA3VgZV3EoEd3lxvzMEfTIHtFQtHqFx X-Google-Smtp-Source: ABdhPJwJ4RM9VYWq41fwhECqsHWaa6AOOt7H64isVIpH1h7i/JrS6rHORFMIbAVgnUhB8OfyDtXA7jZZ/TVS X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:3af1:caef:2937:5d2b]) (user=irogers job=sendgmr) by 2002:a25:ab4c:: with SMTP id u70mr56995726ybi.211.1641363329998; Tue, 04 Jan 2022 22:15:29 -0800 (PST) Date: Tue, 4 Jan 2022 22:13:40 -0800 In-Reply-To: <20220105061351.120843-1-irogers@google.com> Message-Id: <20220105061351.120843-38-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 37/48] perf evsel: Rename CPU around get_group_fd 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_221531_545969_351883A7 X-CRM114-Status: GOOD ( 14.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 is really a cpu map index, change names to make code more intention revealing. Signed-off-by: Ian Rogers --- tools/perf/util/evsel.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index b4a2c5034cfe..4b3ba4408af2 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1591,27 +1591,27 @@ int __evsel__read_on_cpu(struct evsel *evsel, int cpu_map_idx, int thread, bool } static int evsel__match_other_cpu(struct evsel *evsel, struct evsel *other, - int cpu) + int cpu_map_idx) { - int cpuid; + int cpu; - cpuid = perf_cpu_map__cpu(evsel->core.cpus, cpu); - return perf_cpu_map__idx(other->core.cpus, cpuid); + cpu = perf_cpu_map__cpu(evsel->core.cpus, cpu_map_idx); + return perf_cpu_map__idx(other->core.cpus, cpu); } -static int evsel__hybrid_group_cpu(struct evsel *evsel, int cpu) +static int evsel__hybrid_group_cpu_map_idx(struct evsel *evsel, int cpu_map_idx) { struct evsel *leader = evsel__leader(evsel); if ((evsel__is_hybrid(evsel) && !evsel__is_hybrid(leader)) || (!evsel__is_hybrid(evsel) && evsel__is_hybrid(leader))) { - return evsel__match_other_cpu(evsel, leader, cpu); + return evsel__match_other_cpu(evsel, leader, cpu_map_idx); } - return cpu; + return cpu_map_idx; } -static int get_group_fd(struct evsel *evsel, int cpu, int thread) +static int get_group_fd(struct evsel *evsel, int cpu_map_idx, int thread) { struct evsel *leader = evsel__leader(evsel); int fd; @@ -1625,11 +1625,11 @@ static int get_group_fd(struct evsel *evsel, int cpu, int thread) */ BUG_ON(!leader->core.fd); - cpu = evsel__hybrid_group_cpu(evsel, cpu); - if (cpu == -1) + cpu_map_idx = evsel__hybrid_group_cpu_map_idx(evsel, cpu_map_idx); + if (cpu_map_idx == -1) return -1; - fd = FD(leader, cpu, thread); + fd = FD(leader, cpu_map_idx, thread); BUG_ON(fd == -1); return fd;