From patchwork Sun Dec 3 02:00:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 120437 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2903470qgn; Sat, 2 Dec 2017 18:03:02 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ32o/lT4D/wuVcDwNM/G4HNzcP7Z9nraGQTKuxNugzaIOKQ4yFu5oTl+75nv/sIuGQxS3G X-Received: by 10.84.232.202 with SMTP id x10mr2265992plm.389.1512266582191; Sat, 02 Dec 2017 18:03:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512266582; cv=none; d=google.com; s=arc-20160816; b=0bgVJOpd001cOKw7XTK8uviqAmHEnvucgj3ur7WYgMwSIT6BLsWPpimMif3in9xES4 FroIZQdGuRmmC2iQRi+1EXfMO1yCxUVtKWv4AzbRXRLbt4P7CC+JmBB1DCbsE3avFUvI U15Y1CF9i/gGuoDvnzKijZ2VwtjfMPAwqiCMm6OXQrxCEFUfv6WcUcp6vqOhKhvqRu4t 1zCtoOUdnAsvxjnxhQAuK/O0cMaV2P6YbC8GmIArmkJLnDS8LPa7/foNBje0MUYbuRQO 7ssfi4YGgFVwY040WaoViinSCoB9o6JjdNHyiHZBnuZO2A1ufAKn2pglyq2MIGUnzDnO BzFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=1eybp4f7Vf4hHoIzRDkg+CpbVb4X1ziJr4L/qyVUIIc=; b=sZ6b9rMAlqr31DVjD6Tu3gaf+rTyukbKShJb/qXg/TFUlC+HquIGafEB9kIy0aPr5c 0qPAU230DwnKCv2N52n2rCPsAvrnU5RW3IeL8I6GHuk3hNIZ5yn0tp3Pi5dv938ECsnx K3eT/apH4OVN57WIUcycZsgK7xoRpc57LcJgQEdtjwwAUJBIwQZJ57cybWF/yQmQef+N jHjhqa4AUasHCMlGYkuSWnzpOOev3ikZilJevqAwogkvbvM8Ri+pz/Mgk042ZkFNpYhq 2kEaVingPzmbMOm2bE1Z0wPTuS8a/0JR4xmRdCI0o0sjfbo2krHRXGKbt8DUrzMCMWkl Gcag== 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 o123si7139944pga.154.2017.12.02.18.03.01; Sat, 02 Dec 2017 18:03: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 S1752557AbdLCCCv (ORCPT + 28 others); Sat, 2 Dec 2017 21:02:51 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:51612 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751851AbdLCCCu (ORCPT ); Sat, 2 Dec 2017 21:02:50 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1B8BEB065E834; Sun, 3 Dec 2017 10:02:46 +0800 (CST) Received: from linux-4hy3.site (10.107.193.248) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Sun, 3 Dec 2017 10:02:41 +0800 From: Wang Nan To: , , , , CC: Wang Nan Subject: [PATCH v2 3/8] perf tools: Remove evlist->overwrite Date: Sun, 3 Dec 2017 02:00:39 +0000 Message-ID: <20171203020044.81680-4-wangnan0@huawei.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20171203020044.81680-1-wangnan0@huawei.com> References: <20171203020044.81680-1-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.193.248] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org evlist->overwrite is set to false in all users. It can be removed. Signed-off-by: Wang Nan --- tools/perf/builtin-record.c | 2 +- tools/perf/util/evlist.c | 5 ++--- tools/perf/util/evlist.h | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) -- 2.10.1 diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 08070f8..3bc6cee 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -500,7 +500,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], false, backward, rec, record__pushfn) != 0) { rc = -1; goto out; } diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 93272d9..a59134f 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); } 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); } static void perf_evlist__munmap_nofree(struct perf_evlist *evlist) @@ -1070,7 +1070,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 = 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; diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 424a3d6..eec3377 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -31,7 +31,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;