Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp873830ybg; Fri, 18 Oct 2019 08:37:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1CZrwE3z7oxjFBcYlFy+ndGJzBGIXCa7jQ63MF+vKdGaxf6ik0pLU7Xf/jSy3f4yoSpfJ X-Received: by 2002:aa7:c48c:: with SMTP id m12mr10307411edq.280.1571413062122; Fri, 18 Oct 2019 08:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571413062; cv=none; d=google.com; s=arc-20160816; b=dZ36oJ4+y0HmbpEqv1ReG2VJoZxpNk2dpRYJvB4pNDdyuDUsYGBAOFtsjG952I9Kwb xX6v9tusdlnaeGjOcUCG9f08NL1OGAqpVxkmv8sAorZh08XegpTZzDN89vyr4kr8PCAF 3IqOWnBuRpNn4XIUeZ0D46HYy2NJhOE5gweU16TzgihtB+J/vKkmWNoiqDZujG4+i43Y k48DhPbuhwMR6y4rFCZuMQdZzLAuyWHXf8nqeDexPuJPy0u+rJoDolfZP4ErUrAYnHnB westNVwETAQ3sxEES1DPMd43V9XJWqM1tTp+EIDxBWTqhMWnxV8TuBVfzD73WJCLH+lo TobA== 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=ChtUq5Qql4B2Vah0Qu3nuGbYsdGwbyBfBiu273I9keU=; b=0aIVMJVcqredBlOz/L/AURLpP1LufoxqMTmyJ96+MlnlEFOk0+HJ8hk7/JztAzVRKg CkbfWItAkgw4AyO9dqcac34fqTYsWR3fz4hqI5iW+Fm8GRrx6hZfLaobZxRUHgtSDEdb h6M0Nskbsy3yQEQVX4jrn/u0fRIdH+46WHAdSH/yVKXZryBv9aE5EFzZrhMZIoSBy1xl ASqMKzkWhokRNQmvDW/9JyKIhZOIgRFkkQf92/Ye69EARqandwpUnupPX0U60/6XPO7u VgDNpTkLLKrW/opaoeV2dOZfqHpKBuVj1ijdZtkYNWInYPgH4NcC1GmC9DeiGDxaYTuK 4Ogw== 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 ck7si3479644ejb.250.2019.10.18.08.37.18; Fri, 18 Oct 2019 08:37:42 -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 S2409206AbfJQK7c (ORCPT + 99 others); Thu, 17 Oct 2019 06:59:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41382 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729441AbfJQK7a (ORCPT ); Thu, 17 Oct 2019 06:59:30 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D967F8980E9; Thu, 17 Oct 2019 10:59:29 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 990205D70D; Thu, 17 Oct 2019 10:59:27 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Andi Kleen , Stephane Eranian , Jin Yao , Alexey Budankov Subject: [PATCH 03/10] libperf: Move mask setup to perf_evlist__mmap_ops function Date: Thu, 17 Oct 2019 12:59:11 +0200 Message-Id: <20191017105918.20873-4-jolsa@kernel.org> In-Reply-To: <20191017105918.20873-1-jolsa@kernel.org> References: <20191017105918.20873-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Thu, 17 Oct 2019 10:59:30 +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 73aac6bb2ac5..205ddbb80bc1 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 5cded4ec5806..fdce590d2278 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -813,7 +813,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