From patchwork Thu Dec 30 07:20:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 12701290 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 690FEC433EF for ; Thu, 30 Dec 2021 07:43:50 +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=TaoQSjFCvizHYNNoCS+IyieEpMTZqTF/mJ3uU8QY4qo=; b=htp9r8gYIEQIRv30SEWqvc3sk1 tPltCgEDgukmQE4yOGc04nwVeCgNg9ihCcaNQMJuh2aKNHjIsNSB5wxOg9K2Qg1QlaUnhIIwUjmI+ wQqlAt1nmYiwv6WZUGksscyv0OeDyAii1wRhtb4B8DfmhacAZthcCV0E3V9gnFeepoPvhthvLFqOf fprmqeCUHx8pUp6pSiqHhQ34wM3YlJlOMT3GJsnqV7NMHGtHvLSIKouv8pKfyqz90V+dgSNjsrSq9 xpuXk063FhIYo8HCVSsCBQ6pc+RibRQ+Vh53QVkptqXLLoObFCYTGvrQsMYqKScCbar6dujW03JCr Npbk+Eow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2q4u-003rRa-3e; Thu, 30 Dec 2021 07:42:25 +0000 Received: from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2pl0-003jyY-4Q for linux-arm-kernel@lists.infradead.org; Thu, 30 Dec 2021 07:21:51 +0000 Received: by mail-pj1-x104a.google.com with SMTP id 35-20020a17090a0fa600b001b160e1ecffso15226768pjz.9 for ; Wed, 29 Dec 2021 23:21:48 -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=awNrzmXXwhgHegLo/XT1TXhJodtpZbEQSRhdkuOAA7A=; b=PG2diDhkb5i7ogEM5VvdDCDHxrJYDQzZwNMq4MtIk6SnVaypQKlShQlUuhPeWSh1Kj 9M8Nl+9CT0Y/Ky1eReJa4PSxNm1ytCwF+LS/7ujzbJjxZ4+XUVv5Bdk8GosiaZTAl/6M 8tcxJEC4yJm/wkb+WvldQ1MQYgmCNlxI8hqiLP/wVqcSslcgrguLVYHYPbbblV48U29N JV+LjNQSQ6vDw1hMQM96+0C/QIZd/mqyfXunlffbLoNv/HbwW2IBG3Ge8ZA0SLLvTEES tJK4vRxJokHa8njyWH4u62vFUlBP1RbQrPlCb7O0keKwoVCaXXVdTVmMZvbTfgRZLWML a7IQ== 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=awNrzmXXwhgHegLo/XT1TXhJodtpZbEQSRhdkuOAA7A=; b=7Sza8XZT20xceKtO50WCGOPOvPD6Ct8YtT7kG0uCFi7cP6ubndtVY2scAuEw451qdo DryC20MClh1te2mI03Z+jvjy0WHU4xVhpKp7Wc9SMNdjiDwAdqoIfRPCwruqrl+f/4GZ JLrOfdwikffMMOQ4tIwBoAXr0VyhnmZElg24qTB4wgcd028MpxDri+IHkY3DXnnFilod TqSVPkDM189LSNjELUKVKwE+sVrzKY9D1ZQTnuYEfL8ze8U71uCay4i0nYa0RjJFx+Pg 1s3ZA/GDw1p4NkTicU8XtLmcwCMUQoxs4l/aejzBsPE0K2z5LGFbWCfIFGlmEzNPCdTy 6Nkw== X-Gm-Message-State: AOAM5331YpPYP8TpeAHIA22515WbLds2hKzhehjYkN6T2pwQw9uaze80 wkF0tBRH4Fy0hbOs96YgFZPXWxSu51yU X-Google-Smtp-Source: ABdhPJzV/t/Mm6XrZ55WBlWiVBPAgYNKl8mk/J4YgsYsaDqr7uQSS9skiOIuSxze7KHWOuzFZh9/58Wx3cG4 X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:31c4:9539:dba1:a82b]) (user=irogers job=sendgmr) by 2002:a63:a744:: with SMTP id w4mr4176724pgo.142.1640848908047; Wed, 29 Dec 2021 23:21:48 -0800 (PST) Date: Wed, 29 Dec 2021 23:20:10 -0800 In-Reply-To: <20211230072030.302559-1-irogers@google.com> Message-Id: <20211230072030.302559-30-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 28/48] libperf: Use cpu not index for evsel mmap 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_232150_238121_D1500678 X-CRM114-Status: GOOD ( 12.37 ) 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 Fix issue where evsel's CPU map index was being used as the mmap cpu. Signed-off-by: Ian Rogers --- tools/lib/perf/evsel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/perf/evsel.c b/tools/lib/perf/evsel.c index 8028b5a4da69..f1e1665ef4bd 100644 --- a/tools/lib/perf/evsel.c +++ b/tools/lib/perf/evsel.c @@ -252,6 +252,7 @@ int perf_evsel__mmap(struct perf_evsel *evsel, int pages) for (thread = 0; thread < xyarray__max_y(evsel->fd); thread++) { int *fd = FD(evsel, idx, thread); struct perf_mmap *map; + int cpu = perf_cpu_map__cpu(evsel->cpus, idx); if (fd == NULL || *fd < 0) continue; @@ -259,7 +260,7 @@ int perf_evsel__mmap(struct perf_evsel *evsel, int pages) map = MMAP(evsel, idx, thread); perf_mmap__init(map, NULL, false, NULL); - ret = perf_mmap__mmap(map, &mp, *fd, idx); + ret = perf_mmap__mmap(map, &mp, *fd, cpu); if (ret) { perf_evsel__munmap(evsel); return ret;