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 78BEEC433EF for ; Wed, 5 Jan 2022 06:26:20 +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=LcTqA8CNpzYRrTxyRaMI+QHl1W1HePDXT332cTKgPIQ=; b=m8YnqOzXoXR1r0MOWoQF1tH0C5 QUqDXS4BplRZwpegeZsVB1lqQQTXmaV++k1y01uqrfPcolkxjhYHC2ZqQAJlhi5vtagU0LgUp1eQA vX8LMA5DR3fNVOqjiVvOp/A+nGO2q+BZ5YYf0dDJhrh89bzI4dVHbTO9wOfDufXUgW/wJg+RLZNfC i4WS9Vynrt7/RIBamiPPD+C7fgZnxGDF/yQe+6YPyOePkcklcN2R3AOqCPeqoPB+fJQKEu9psbb8n lcPHNch2VbrgT9pP8oqoZDAUAvvGzuBeTyoNnIOjUdj4pOMtlqCmhka5opFaQf6X3d6gLigP1662x ERV66a7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4zip-00DkKH-Es; Wed, 05 Jan 2022 06:24:33 +0000 Received: from mail-pf1-x44a.google.com ([2607:f8b0:4864:20::44a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4zZK-00Dfrk-Dv for linux-arm-kernel@lists.infradead.org; Wed, 05 Jan 2022 06:14:43 +0000 Received: by mail-pf1-x44a.google.com with SMTP id x128-20020a628686000000b004ba53b6ec72so19864312pfd.9 for ; Tue, 04 Jan 2022 22:14:40 -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=hhL79Wui00dZGSHTjWRVzw6lUcXgmSFmqf1bVRl6br0=; b=QQWIKuaAQV7OWXgNCSnzt+Y4XRNpzeM4L+ByfkwwC4PUgTSQLvUUrcseNc66BMqd74 OXOrzB2aCKQJGTOxFDqHgXrnF/36ryX31nlIj7N025uWmL+jlEYu712JQY9SGJ+Ec5sB YPdgBjbibTd3DSDnSN9mwZVmZkSyiSE3pyBc/IuUDrSKCUEiijTRSW5Lgk1H4kvnf/iA JHCH7p1J1fIKKX/QjxyyQv8fwqNEFIo8lAaWqsozUKtgGP35ylJDHC71Div9p5LYmHa4 V00tln/Dbiec7phK/NizcOEEQblCGWjavv/OM0JeZRgwi8l1G8c7RntYVMVunPWNXWyL a91Q== 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=hhL79Wui00dZGSHTjWRVzw6lUcXgmSFmqf1bVRl6br0=; b=rDjKPfSU7STBxjd+Nsym7l3o/aBcJE/Ac6Ff0AwVN6qhRhVFFVhha5vxkX86EJ4XRs q7YXU7gP+rYze/tdY+JnPu2efsJtefoicWmzTVWGbQ1Uv5OIdlKlIteuAuiWcifcIbua DBJzk8f7jLmFQ8s08cJXnSqHINyJ9ytQHf2+9z/YKWPGthoDpZ+Ck7pIiMOoSygGw1NR dhJ2A18nQbZn82Un0rSv9E1nfCPwv3Zf51AECL4oB2dEtWAHiKHED3lcqsSkjcDbaseX n9uv26Ov2etkUVXQFOxbwbsoNt1+aYje7JZBS942tnCzNh9xj89JDG6OXbq7momkdbVN tlig== X-Gm-Message-State: AOAM533/K3SeYgjJbBmzBPPFuimaMgNMwWDgABJe6MUwndVGIw5iVyNB MjgFhShYC+cD3CV7a/NL+p8lBa4HyhAa X-Google-Smtp-Source: ABdhPJy6psxdeEBYvd6ijaSaetGP32RibskvFVPWBcYnQl+kvABJM8R+CMks0kndvCEOhkxNVXnCdtByAJZW X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:3af1:caef:2937:5d2b]) (user=irogers job=sendgmr) by 2002:a63:724b:: with SMTP id c11mr1059529pgn.576.1641363279910; Tue, 04 Jan 2022 22:14:39 -0800 (PST) Date: Tue, 4 Jan 2022 22:13:20 -0800 In-Reply-To: <20220105061351.120843-1-irogers@google.com> Message-Id: <20220105061351.120843-18-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 17/48] perf cpumap: Remove cpu_map__cpu, use libperf 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_221442_519609_BE14B538 X-CRM114-Status: GOOD ( 15.54 ) 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 Switch the remaining few users of cpu_map__cpu to perf_cpu_map__cpu and remove the function. Reviewed-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/builtin-ftrace.c | 2 +- tools/perf/util/cpumap.c | 9 ++------- tools/perf/util/cpumap.h | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 2b54e2ddc80a..f16c39a37a52 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -281,7 +281,7 @@ static int set_tracing_cpumask(struct perf_cpu_map *cpumap) int ret; int last_cpu; - last_cpu = cpu_map__cpu(cpumap, cpumap->nr - 1); + last_cpu = perf_cpu_map__cpu(cpumap, cpumap->nr - 1); mask_size = last_cpu / 4 + 2; /* one more byte for EOS */ mask_size += last_cpu / 32; /* ',' is needed for every 32th cpus */ diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index e0d7f1da5858..32f9fc2dd389 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -485,11 +485,6 @@ bool cpu_map__has(struct perf_cpu_map *cpus, int cpu) return perf_cpu_map__idx(cpus, cpu) != -1; } -int cpu_map__cpu(struct perf_cpu_map *cpus, int idx) -{ - return cpus->map[idx]; -} - size_t cpu_map__snprint(struct perf_cpu_map *map, char *buf, size_t size) { int i, cpu, start = -1; @@ -547,7 +542,7 @@ size_t cpu_map__snprint_mask(struct perf_cpu_map *map, char *buf, size_t size) int i, cpu; char *ptr = buf; unsigned char *bitmap; - int last_cpu = cpu_map__cpu(map, map->nr - 1); + int last_cpu = perf_cpu_map__cpu(map, map->nr - 1); if (buf == NULL) return 0; @@ -559,7 +554,7 @@ size_t cpu_map__snprint_mask(struct perf_cpu_map *map, char *buf, size_t size) } for (i = 0; i < map->nr; i++) { - cpu = cpu_map__cpu(map, i); + cpu = perf_cpu_map__cpu(map, i); bitmap[cpu / 8] |= 1 << (cpu % 8); } diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index a053bf31a3f0..87545bcd461d 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -80,7 +80,6 @@ int cpu_map__build_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **res, struct aggr_cpu_id (*f)(int cpu, void *data), void *data); -int cpu_map__cpu(struct perf_cpu_map *cpus, int idx); bool cpu_map__has(struct perf_cpu_map *cpus, int cpu); bool aggr_cpu_id__equal(const struct aggr_cpu_id *a, const struct aggr_cpu_id *b); -- 2.34.1.448.ga2b2bfdf31-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel