All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Nan <wangnan0@huawei.com>
To: <linux-kernel@vger.kernel.org>, <kan.liang@intel.com>,
	<acme@kernel.org>, <jolsa@redhat.com>, <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Subject: [PATCH v2 2/8] perf tools: Remove 'overwrite' parameter from perf_evlist__mmap_ex
Date: Sun, 3 Dec 2017 02:00:38 +0000	[thread overview]
Message-ID: <20171203020044.81680-3-wangnan0@huawei.com> (raw)
In-Reply-To: <20171203020044.81680-1-wangnan0@huawei.com>

All users of perf_evlist__mmap_ex set !overwrite. Remove it from its
arguments list.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
---
 tools/perf/builtin-record.c | 2 +-
 tools/perf/util/evlist.c    | 8 ++++----
 tools/perf/util/evlist.h    | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index e304bc4..08070f8 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -301,7 +301,7 @@ static int record__mmap_evlist(struct record *rec,
 	struct record_opts *opts = &rec->opts;
 	char msg[512];
 
-	if (perf_evlist__mmap_ex(evlist, opts->mmap_pages, false,
+	if (perf_evlist__mmap_ex(evlist, opts->mmap_pages,
 				 opts->auxtrace_mmap_pages,
 				 opts->auxtrace_snapshot_mode) < 0) {
 		if (errno == EPERM) {
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 3c1778b..93272d9 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1052,14 +1052,14 @@ int perf_evlist__parse_mmap_pages(const struct option *opt, const char *str,
  * Return: %0 on success, negative error code otherwise.
  */
 int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
-			 bool overwrite, unsigned int auxtrace_pages,
+			 unsigned int auxtrace_pages,
 			 bool auxtrace_overwrite)
 {
 	struct perf_evsel *evsel;
 	const struct cpu_map *cpus = evlist->cpus;
 	const struct thread_map *threads = evlist->threads;
 	struct mmap_params mp = {
-		.prot = PROT_READ | (overwrite ? 0 : PROT_WRITE),
+		.prot = PROT_READ | PROT_WRITE,
 	};
 
 	if (!evlist->mmap)
@@ -1070,7 +1070,7 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
 	if (evlist->pollfd.entries == NULL && perf_evlist__alloc_pollfd(evlist) < 0)
 		return -ENOMEM;
 
-	evlist->overwrite = overwrite;
+	evlist->overwrite = false;
 	evlist->mmap_len = perf_evlist__mmap_size(pages);
 	pr_debug("mmap size %zuB\n", evlist->mmap_len);
 	mp.mask = evlist->mmap_len - page_size - 1;
@@ -1093,7 +1093,7 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
 
 int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages)
 {
-	return perf_evlist__mmap_ex(evlist, pages, false, 0, false);
+	return perf_evlist__mmap_ex(evlist, pages, 0, false);
 }
 
 int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index f0f2c8b..424a3d6 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -169,7 +169,7 @@ int perf_evlist__parse_mmap_pages(const struct option *opt,
 unsigned long perf_event_mlock_kb_in_pages(void);
 
 int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
-			 bool overwrite, unsigned int auxtrace_pages,
+			 unsigned int auxtrace_pages,
 			 bool auxtrace_overwrite);
 int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages);
 void perf_evlist__munmap(struct perf_evlist *evlist);
-- 
2.10.1

  parent reply	other threads:[~2017-12-03  2:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-03  2:00 [PATCH v2 0/8] perf tools: perf tools: Clarify overwrite and backward, bugfix Wang Nan
2017-12-03  2:00 ` [PATCH v2 1/8] perf tools: Remove 'overwrite' parameter from perf_evlist__mmap Wang Nan
2017-12-06 16:41   ` [tip:perf/core] perf evlist: " tip-bot for Wang Nan
2017-12-03  2:00 ` Wang Nan [this message]
2017-12-06 16:41   ` [tip:perf/core] perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap_ex tip-bot for Wang Nan
2017-12-03  2:00 ` [PATCH v2 3/8] perf tools: Remove evlist->overwrite Wang Nan
2017-12-06 16:42   ` [tip:perf/core] perf evlist: " tip-bot for Wang Nan
2017-12-03  2:00 ` [PATCH v2 4/8] perf tools: Remove overwrite from arguments list of perf_mmap__push Wang Nan
2017-12-06 16:42   ` [tip:perf/core] perf mmap: " tip-bot for Wang Nan
2017-12-03  2:00 ` [PATCH v2 5/8] perf tools: Remove overwrite and check_messup from mmap read Wang Nan
2017-12-06 16:42   ` [tip:perf/core] perf mmap: " tip-bot for Wang Nan
2017-12-03  2:00 ` [PATCH v2 6/8] perf mmap: Fix perf backward recording Wang Nan
2017-12-04  5:37   ` Namhyung Kim
2017-12-04 15:44     ` Arnaldo Carvalho de Melo
2017-12-03  2:00 ` [PATCH v2 7/8] perf tools: Don't discard prev in backward mode Wang Nan
2017-12-03  2:00 ` [PATCH v2 8/8] perf tools: Replace 'backward' to 'overwrite' in evlist, mmap and record Wang Nan
2017-12-04  5:39 ` [PATCH v2 0/8] perf tools: perf tools: Clarify overwrite and backward, bugfix Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171203020044.81680-3-wangnan0@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.