Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4260311ybp; Mon, 7 Oct 2019 05:56:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9rJ2125TGWHASHpDcu+g+DiDvL+FhJozbwkpYDy9ZxxC/AefHLAt7y/or+V18ZIXR2BQP X-Received: by 2002:a17:906:b74e:: with SMTP id fx14mr23192000ejb.226.1570453011069; Mon, 07 Oct 2019 05:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570453011; cv=none; d=google.com; s=arc-20160816; b=w1N+dHATKCV5EA3DtQolIwGkeVWZqhivA2lenvItQ3r97FwmOicTJ9/I7VrK446AOd N5dMhJ49TIhCTVYK5rVhRK5v8aAhNnen4Q5w5Ao+G/7HC8fh2cUWpH4+FnpoKk8nzjgd 3CFMY4wn0TVYwzCbo6JW0Xtkyk257OKXpobcLnGM1k14jTosJW4BPzIsWxAEgBNetD39 UYQ4/dH85bYnxFcPcXQDMUcmxAQJJLRPJF2Kf/qvP12A4iAPDRbIjQflVAftiELiA6lw 9wX/J++K8eroo11YDQFSE4sANUPV+5Yw5YV+ojzexSN/6n9Yp7n4C2bSl9kJ94YlHAiQ eb7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=64/ME2w1jE7WxKxwrUxl2/BGHYp3FKrKXe0qAuXkADI=; b=e+HYdrMx1n1xuW9Sc3t0wf1PYkh2RhkaLxVQnw/APJCwC5QTEw4qDKhcQ4zCa+WNmD oGk8xw/QRjnYt4Pto32CAUS1Xd9oeRPqe5S44/cfPgtEqe9McKzMtn8eOFTgs99rLy0m Q9+ZD+Gwhgnnu1WIbiGTKy7sSQg0XRkHJowXpP4fXVTXGOVblietHcSLoU+r0/Mh3skZ /NWeNF6UBRowonP9iRtY9TRzmlpLrtuXwQSrz8E5nuuxWF0H6NCCFgn/s145yx/4LYJ8 ZDM3c0k9kIDdrsoiPEKxLxcXctQiHdmGjGSrxeI6Kr+3F+EDpcJ86VMm1X7ePwSA2RIH 6Yag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si8208416edw.51.2019.10.07.05.56.27; Mon, 07 Oct 2019 05:56:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728445AbfJGMy5 (ORCPT + 99 others); Mon, 7 Oct 2019 08:54:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48726 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727869AbfJGMyz (ORCPT ); Mon, 7 Oct 2019 08:54:55 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 668F930860D7; Mon, 7 Oct 2019 12:54:55 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1C6E5D9CC; Mon, 7 Oct 2019 12:54:53 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 29/36] libperf: Move mask setup to perf_evlist__mmap_ops function Date: Mon, 7 Oct 2019 14:53:37 +0200 Message-Id: <20191007125344.14268-30-jolsa@kernel.org> In-Reply-To: <20191007125344.14268-1-jolsa@kernel.org> References: <20191007125344.14268-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 07 Oct 2019 12:54:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Moving mask setup to perf_evlist__mmap_ops function, because it's same on both perf and libperf path. Link: http://lkml.kernel.org/n/tip-z31pepohuxlgecf6400wbvt0@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/evlist.c | 3 ++- tools/perf/util/evlist.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c index 61ed27526e08..8163b5123c55 100644 --- a/tools/perf/lib/evlist.c +++ b/tools/perf/lib/evlist.c @@ -578,6 +578,8 @@ int perf_evlist__mmap_ops(struct perf_evlist *evlist, if (!ops || !ops->get || !ops->mmap) return -EINVAL; + mp->mask = evlist->mmap_len - page_size - 1; + evlist->nr_mmaps = perf_evlist__nr_mmaps(evlist); perf_evlist__for_each_entry(evlist, evsel) { @@ -605,7 +607,6 @@ int perf_evlist__mmap(struct perf_evlist *evlist, int pages) }; evlist->mmap_len = (pages + 1) * page_size; - mp.mask = evlist->mmap_len - page_size - 1; return perf_evlist__mmap_ops(evlist, &ops, &mp); } diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index b58ef3147163..78185f984f0e 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -788,7 +788,6 @@ int evlist__mmap_ex(struct evlist *evlist, unsigned int pages, evlist->core.mmap_len = evlist__mmap_size(pages); pr_debug("mmap size %zuB\n", evlist->core.mmap_len); - mp.core.mask = evlist->core.mmap_len - page_size - 1; auxtrace_mmap_params__init(&mp.auxtrace_mp, evlist->core.mmap_len, auxtrace_pages, auxtrace_overwrite); -- 2.21.0