Received: by 10.223.164.202 with SMTP id h10csp329049wrb; Mon, 13 Nov 2017 07:09:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMay5vDDqLmEtU8ILU3IneXgJ01YjKgSVAok583rdH0iTQplF3fz49o2gEp0EjzqL8ASCJ7t X-Received: by 10.98.155.22 with SMTP id r22mr10043717pfd.96.1510585743041; Mon, 13 Nov 2017 07:09:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510585743; cv=none; d=google.com; s=arc-20160816; b=tuyAwPFkeg5lcacor0pJPcmuEAicuUi4ho1xaKsHJ2YvAUTGMD2EZTPjxVfFtXUHLq vA9CH13YGWalrdlzT2jfeOu/1SDZikHk2tZwYzMw81TSLnQXgZsmH8PsPS9puxUGMj9r gzjEY9RKTuzSR4dJQVKPnCTaKsiv7cK+hbA0HpzshzduZuRqXfVw2vV+TyBRRVaZatlO lP0qY7ervZLbr7aKSCL0N34IIIbPFmQ5Vw/p5uC8XWvapV1mz/6cjGDfEFeIID3ETQa7 RBU3tA3gg2uVvLwjp6hoxNXl/QVHDsdBWe0GoZ9QfrsS4bT4zUfBJNhnRfk1DfIJHm1H lQCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:to:from:arc-authentication-results; bh=41ROIWqWjbPeRCdAVDyX4frtcbkacC6qkPq15BA2aaA=; b=CUs2xGhuhVw5wYlaRDKfBfNEzsNtrByA6+RoRox09s+HUWEyy9aTrrg5Gfza0gEz6S 3GoMPoxxJOrg5x35wl82DTrkty06kcDH7ct7X+Mwu+qgCzaVKqVXPZxunvGoXLw262dX D8G56K6NNH+3ZbZFxf9wMlRVmu0pj3a+LF2wDyaB9YBUZH2Bu8d28axzjD9WgBnTHcUu kWaJofgvJOVn8lP7Xj7luDctQzbS8vh2RIvyw/IjVZkmFJXuz8HiOoIXKhHbQZTBu7/6 C0zgdvpXA4rhgfI2+sOrruvJtbcxSVs9Za8qeCvzQHzqEzgxZkF1tx9IGFBputfNGz7D dcCA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si14006916pgo.491.2017.11.13.07.08.48; Mon, 13 Nov 2017 07:09:02 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752791AbdKMPHY convert rfc822-to-8bit (ORCPT + 88 others); Mon, 13 Nov 2017 10:07:24 -0500 Received: from mga11.intel.com ([192.55.52.93]:28141 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752269AbdKMPHX (ORCPT ); Mon, 13 Nov 2017 10:07:23 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2017 07:07:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,389,1505804400"; d="scan'208";a="1008578" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 13 Nov 2017 07:07:21 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 13 Nov 2017 07:07:20 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 13 Nov 2017 07:07:20 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Mon, 13 Nov 2017 23:07:20 +0800 From: "Liang, Kan" To: Wang Nan , "linux-kernel@vger.kernel.org" , "acme@kernel.org" , "jolsa@redhat.com" , "namhyung@kernel.org" Subject: RE: [PATCH 6/7] perf tools: Remove 'overwrite' concept from code level Thread-Topic: [PATCH 6/7] perf tools: Remove 'overwrite' concept from code level Thread-Index: AQHTXCBD5FBbz73jhEqATqbqTigCb6MSZkqg Date: Mon, 13 Nov 2017 15:07:19 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077537E0F93@SHSMSX103.ccr.corp.intel.com> References: <20171113013809.212417-1-wangnan0@huawei.com> <20171113013809.212417-7-wangnan0@huawei.com> In-Reply-To: <20171113013809.212417-7-wangnan0@huawei.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzJlOTdlODUtZmYyYy00ZDM5LTkxNjQtMWEzYTUzMGM2NTE1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IktUejVBYm9FMjNoVjRyNTJGaUtzSVwvNVJRMDZKZnlnbWRVTmpQWGFwdTlFPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Since all 'overwrite' usage are cleaned and no one really use a readonly main > ringbuffer, remove 'overwrite' from function arguments and evlist. The > concept > of 'overwrite' and 'write_backward' are cleanner than before: > > 1. In code level, there's no 'overwrite' concept. Each evlist has two > ringbuffer groups. One is read-write/forward, another is > readonly/backward. > Don't support read-write/backward and readonly/forward. > > 2. In user interface, we keep '--overwrite' and translate it into > write_backward > in each event. > > Signed-off-by: Wang Nan > --- > tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +- > tools/perf/builtin-kvm.c | 2 +- > tools/perf/builtin-record.c | 4 ++-- > tools/perf/builtin-top.c | 2 +- > tools/perf/builtin-trace.c | 2 +- > tools/perf/tests/backward-ring-buffer.c | 2 +- > tools/perf/tests/bpf.c | 2 +- > tools/perf/tests/code-reading.c | 2 +- > tools/perf/tests/keep-tracking.c | 2 +- > tools/perf/tests/mmap-basic.c | 2 +- > tools/perf/tests/openat-syscall-tp-fields.c | 2 +- > tools/perf/tests/perf-record.c | 2 +- > tools/perf/tests/sw-clock.c | 2 +- > tools/perf/tests/switch-tracking.c | 2 +- > tools/perf/tests/task-exit.c | 2 +- > tools/perf/util/evlist.c | 14 ++++++-------- > tools/perf/util/evlist.h | 6 ++---- > tools/perf/util/mmap.c | 6 +++--- > tools/perf/util/mmap.h | 2 +- > tools/perf/util/python.c | 10 +++++----- > 20 files changed, 33 insertions(+), 37 deletions(-) > > diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c > b/tools/perf/arch/x86/tests/perf-time-to-tsc.c > index 5dd7efb..c7ea843 100644 > --- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c > +++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c > @@ -83,7 +83,7 @@ int test__perf_time_to_tsc(struct test *test > __maybe_unused, int subtest __maybe > > CHECK__(perf_evlist__open(evlist)); > > - CHECK__(perf_evlist__mmap(evlist, UINT_MAX, false)); > + CHECK__(perf_evlist__mmap(evlist, UINT_MAX)); > > pc = evlist->mmap[0].base; > ret = perf_read_tsc_conversion(pc, &tc); > diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c > index 0af4c09..e3e2a80 100644 > --- a/tools/perf/builtin-kvm.c > +++ b/tools/perf/builtin-kvm.c > @@ -1043,7 +1043,7 @@ static int kvm_live_open_events(struct > perf_kvm_stat *kvm) > goto out; > } > > - if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages, false) < 0) { > + if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages) < 0) { > ui__error("Failed to mmap the events: %s\n", > str_error_r(errno, sbuf, sizeof(sbuf))); > perf_evlist__close(evlist); > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index f4d9fc5..b3ef33f 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -300,7 +300,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) { > @@ -481,7 +481,7 @@ static int record__mmap_read_evlist(struct record > *rec, struct perf_evlist *evli > struct auxtrace_mmap *mm = &maps[i].auxtrace_mmap; > > if (maps[i].base) { > - if (perf_mmap__push(&maps[i], evlist->overwrite, > backward, rec, record__pushfn) != 0) { > + if (perf_mmap__push(&maps[i], backward, rec, > record__pushfn) != 0) { > rc = -1; > goto out; > } > diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c > index 477a869..83d2ae2 100644 > --- a/tools/perf/builtin-top.c > +++ b/tools/perf/builtin-top.c > @@ -902,7 +902,7 @@ static int perf_top__start_counters(struct perf_top > *top) > } > } > > - if (perf_evlist__mmap(evlist, opts->mmap_pages, false) < 0) { > + if (perf_evlist__mmap(evlist, opts->mmap_pages) < 0) { > ui__error("Failed to mmap with %d (%s)\n", > errno, str_error_r(errno, msg, sizeof(msg))); > goto out_err; > diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c > index c373f9a..c3f2f98 100644 > --- a/tools/perf/builtin-trace.c > +++ b/tools/perf/builtin-trace.c > @@ -2404,7 +2404,7 @@ static int trace__run(struct trace *trace, int argc, > const char **argv) > if (err < 0) > goto out_error_apply_filters; > > - err = perf_evlist__mmap(evlist, trace->opts.mmap_pages, false); > + err = perf_evlist__mmap(evlist, trace->opts.mmap_pages); > if (err < 0) > goto out_error_mmap; > > diff --git a/tools/perf/tests/backward-ring-buffer.c > b/tools/perf/tests/backward-ring-buffer.c > index 992c917..bdebcf9 100644 > --- a/tools/perf/tests/backward-ring-buffer.c > +++ b/tools/perf/tests/backward-ring-buffer.c > @@ -58,7 +58,7 @@ static int do_test(struct perf_evlist *evlist, int > mmap_pages, > int err; > char sbuf[STRERR_BUFSIZE]; > > - err = perf_evlist__mmap(evlist, mmap_pages, false); > + err = perf_evlist__mmap(evlist, mmap_pages); > if (err < 0) { > pr_debug("perf_evlist__mmap: %s\n", > str_error_r(errno, sbuf, sizeof(sbuf))); > diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c > index 34c22cd..c433dd3 100644 > --- a/tools/perf/tests/bpf.c > +++ b/tools/perf/tests/bpf.c > @@ -167,7 +167,7 @@ static int do_test(struct bpf_object *obj, int > (*func)(void), > goto out_delete_evlist; > } > > - err = perf_evlist__mmap(evlist, opts.mmap_pages, false); > + err = perf_evlist__mmap(evlist, opts.mmap_pages); > if (err < 0) { > pr_debug("perf_evlist__mmap: %s\n", > str_error_r(errno, sbuf, sizeof(sbuf))); > diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c > index 466a462..b6c813e 100644 > --- a/tools/perf/tests/code-reading.c > +++ b/tools/perf/tests/code-reading.c > @@ -638,7 +638,7 @@ static int do_test_code_reading(bool try_kcore) > break; > } > > - ret = perf_evlist__mmap(evlist, UINT_MAX, false); > + ret = perf_evlist__mmap(evlist, UINT_MAX); > if (ret < 0) { > pr_debug("perf_evlist__mmap failed\n"); > goto out_put; > diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c > index 7394286..b282916 100644 > --- a/tools/perf/tests/keep-tracking.c > +++ b/tools/perf/tests/keep-tracking.c > @@ -94,7 +94,7 @@ int test__keep_tracking(struct test *test > __maybe_unused, int subtest __maybe_un > goto out_err; > } > > - CHECK__(perf_evlist__mmap(evlist, UINT_MAX, false)); > + CHECK__(perf_evlist__mmap(evlist, UINT_MAX)); > > /* > * First, test that a 'comm' event can be found when the event is > diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c > index 667d696..f43d862 100644 > --- a/tools/perf/tests/mmap-basic.c > +++ b/tools/perf/tests/mmap-basic.c > @@ -93,7 +93,7 @@ int test__basic_mmap(struct test *test > __maybe_unused, int subtest __maybe_unuse > expected_nr_events[i] = 1 + rand() % 127; > } > > - if (perf_evlist__mmap(evlist, 128, false) < 0) { > + if (perf_evlist__mmap(evlist, 128) < 0) { > pr_debug("failed to mmap events: %d (%s)\n", errno, > str_error_r(errno, sbuf, sizeof(sbuf))); > goto out_delete_evlist; > diff --git a/tools/perf/tests/openat-syscall-tp-fields.c > b/tools/perf/tests/openat-syscall-tp-fields.c > index b6ee1c4..f68d818 100644 > --- a/tools/perf/tests/openat-syscall-tp-fields.c > +++ b/tools/perf/tests/openat-syscall-tp-fields.c > @@ -63,7 +63,7 @@ int test__syscall_openat_tp_fields(struct test *test > __maybe_unused, int subtest > goto out_delete_evlist; > } > > - err = perf_evlist__mmap(evlist, UINT_MAX, false); > + err = perf_evlist__mmap(evlist, UINT_MAX); > if (err < 0) { > pr_debug("perf_evlist__mmap: %s\n", > str_error_r(errno, sbuf, sizeof(sbuf))); > diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c > index 19b6500..f9fbd8b 100644 > --- a/tools/perf/tests/perf-record.c > +++ b/tools/perf/tests/perf-record.c > @@ -140,7 +140,7 @@ int test__PERF_RECORD(struct test *test > __maybe_unused, int subtest __maybe_unus > * fds in the same CPU to be injected in the same mmap ring buffer > * (using ioctl(PERF_EVENT_IOC_SET_OUTPUT)). > */ > - err = perf_evlist__mmap(evlist, opts.mmap_pages, false); > + err = perf_evlist__mmap(evlist, opts.mmap_pages); > if (err < 0) { > pr_debug("perf_evlist__mmap: %s\n", > str_error_r(errno, sbuf, sizeof(sbuf))); > diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c > index c468e6c..fd01b24 100644 > --- a/tools/perf/tests/sw-clock.c > +++ b/tools/perf/tests/sw-clock.c > @@ -77,7 +77,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids > clock_id) > goto out_delete_evlist; > } > > - err = perf_evlist__mmap(evlist, 128, false); > + err = perf_evlist__mmap(evlist, 128); > if (err < 0) { > pr_debug("failed to mmap event: %d (%s)\n", errno, > str_error_r(errno, sbuf, sizeof(sbuf))); > diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch- > tracking.c > index 2acd785..9fee2a0 100644 > --- a/tools/perf/tests/switch-tracking.c > +++ b/tools/perf/tests/switch-tracking.c > @@ -448,7 +448,7 @@ int test__switch_tracking(struct test *test > __maybe_unused, int subtest __maybe_ > goto out; > } > > - err = perf_evlist__mmap(evlist, UINT_MAX, false); > + err = perf_evlist__mmap(evlist, UINT_MAX); > if (err) { > pr_debug("perf_evlist__mmap failed!\n"); > goto out_err; > diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c > index 4fb6609..4ba5a27 100644 > --- a/tools/perf/tests/task-exit.c > +++ b/tools/perf/tests/task-exit.c > @@ -96,7 +96,7 @@ int test__task_exit(struct test *test __maybe_unused, > int subtest __maybe_unused > goto out_delete_evlist; > } > > - if (perf_evlist__mmap(evlist, 128, false) < 0) { > + if (perf_evlist__mmap(evlist, 128) < 0) { > pr_debug("failed to mmap events: %d (%s)\n", errno, > str_error_r(errno, sbuf, sizeof(sbuf))); > goto out_delete_evlist; > diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c > index 4c5daba..4948d3d 100644 > --- a/tools/perf/util/evlist.c > +++ b/tools/perf/util/evlist.c > @@ -711,7 +711,7 @@ union perf_event > *perf_evlist__mmap_read_forward(struct perf_evlist *evlist, int > * No need for read-write ring buffer: kernel stop outputting when > * it hit md->prev (perf_mmap__consume()). > */ > - return perf_mmap__read_forward(md, evlist->overwrite); > + return perf_mmap__read_forward(md, false); If we remove the 'overwrite' in forward, I think 'check_messup' is useless. It's better to remove it as well. > } > > union perf_event *perf_evlist__mmap_read_backward(struct perf_evlist > *evlist, int idx) > @@ -738,7 +738,7 @@ void perf_evlist__mmap_read_catchup(struct > perf_evlist *evlist, int idx) > > void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx) > { > - perf_mmap__consume(&evlist->mmap[idx], evlist->overwrite); > + perf_mmap__consume(&evlist->mmap[idx], false); I think we still need to remove 'overwrite' in the implementation of perf_mmap__consume. There are too many generic functions are changed in this patch. I think it's better to split into several patches. It's better to have one generic function changed in one patch. Thanks, Kan > } > > static void perf_evlist__munmap_nofree(struct perf_evlist *evlist) > @@ -1058,14 +1058,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) > @@ -1076,7 +1076,6 @@ 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->mmap_len = perf_evlist__mmap_size(pages); > pr_debug("mmap size %zuB\n", evlist->mmap_len); > mp.mask = evlist->mmap_len - page_size - 1; > @@ -1097,10 +1096,9 @@ int perf_evlist__mmap_ex(struct perf_evlist > *evlist, unsigned int pages, > return perf_evlist__mmap_per_cpu(evlist, &mp); > } > > -int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, > - bool overwrite) > +int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages) > { > - return perf_evlist__mmap_ex(evlist, pages, overwrite, 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 8c433e9..1dd3291 100644 > --- a/tools/perf/util/evlist.h > +++ b/tools/perf/util/evlist.h > @@ -30,7 +30,6 @@ struct perf_evlist { > int nr_entries; > int nr_groups; > int nr_mmaps; > - bool overwrite; > bool enabled; > bool has_user_cpus; > size_t mmap_len; > @@ -168,10 +167,9 @@ 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, > - bool overwrite); > +int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages); > void perf_evlist__munmap(struct perf_evlist *evlist); > > size_t perf_evlist__mmap_size(unsigned long pages); > diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c > index 9fe5f9c..703ed41 100644 > --- a/tools/perf/util/mmap.c > +++ b/tools/perf/util/mmap.c > @@ -299,7 +299,7 @@ static int rb_find_range(void *data, int mask, u64 > head, u64 old, > return backward_rb_find_range(data, mask, head, start, end); > } > > -int perf_mmap__push(struct perf_mmap *md, bool overwrite, bool > backward, > +int perf_mmap__push(struct perf_mmap *md, bool backward, > void *to, int push(void *to, void *buf, size_t size)) > { > u64 head = perf_mmap__read_head(md); > @@ -321,7 +321,7 @@ int perf_mmap__push(struct perf_mmap *md, bool > overwrite, bool backward, > WARN_ONCE(1, "failed to keep up with mmap data. (warn > only once)\n"); > > md->prev = head; > - perf_mmap__consume(md, overwrite || backward); > + perf_mmap__consume(md, backward); > return 0; > } > > @@ -346,7 +346,7 @@ int perf_mmap__push(struct perf_mmap *md, bool > overwrite, bool backward, > } > > md->prev = head; > - perf_mmap__consume(md, overwrite || backward); > + perf_mmap__consume(md, backward); > out: > return rc; > } > diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h > index efd78b8..2c3d291 100644 > --- a/tools/perf/util/mmap.h > +++ b/tools/perf/util/mmap.h > @@ -89,7 +89,7 @@ static inline void perf_mmap__write_tail(struct > perf_mmap *md, u64 tail) > union perf_event *perf_mmap__read_forward(struct perf_mmap *map, > bool check_messup); > union perf_event *perf_mmap__read_backward(struct perf_mmap *map); > > -int perf_mmap__push(struct perf_mmap *md, bool overwrite, bool > backward, > +int perf_mmap__push(struct perf_mmap *md, bool backward, > void *to, int push(void *to, void *buf, size_t size)); > > size_t perf_mmap__mmap_len(struct perf_mmap *map); > diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c > index c129e99..ece33b4 100644 > --- a/tools/perf/util/python.c > +++ b/tools/perf/util/python.c > @@ -856,14 +856,14 @@ static PyObject *pyrf_evlist__mmap(struct > pyrf_evlist *pevlist, > PyObject *args, PyObject *kwargs) > { > struct perf_evlist *evlist = &pevlist->evlist; > - static char *kwlist[] = { "pages", "overwrite", NULL }; > - int pages = 128, overwrite = false; > + static char *kwlist[] = { "pages", NULL }; > + int pages = 128; > > - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ii", kwlist, > - &pages, &overwrite)) > + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i", kwlist, > + &pages)) > return NULL; > > - if (perf_evlist__mmap(evlist, pages, overwrite) < 0) { > + if (perf_evlist__mmap(evlist, pages) < 0) { > PyErr_SetFromErrno(PyExc_OSError); > return NULL; > } > -- > 2.10.1 From 1583951661071106150@xxx Mon Nov 13 11:53:37 +0000 2017 X-GM-THRID: 1583913084914639708 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread