From patchwork Sun Dec 3 02:00:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 120441 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2903736qgn; Sat, 2 Dec 2017 18:03:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ6sQ79HxQi+xqqO6PrQrfuYON5b+Zlv/2Z7/xRvn9rwadFy02ymbw8QAK/IFKFMEnMc9AW X-Received: by 10.84.242.76 with SMTP id c12mr10651950pll.445.1512266608767; Sat, 02 Dec 2017 18:03:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512266608; cv=none; d=google.com; s=arc-20160816; b=Lc5qszXeRGLuWZDWw1UbixTGOcZaDiGMJ8QtrNJl5bFiSmpz7435b8hZUete7jDDeH K3mEAHK38EO5uiQxReR5YO9DX5hm1eRRahUyhJB3tOiXV8qiGGlvTTst2FUFd1++qReU FTHDiisGO4sLLCSNtRwdSWiW6kiJ/JmdlMOHfc+fYBbybC6g5hFNaidioo0Jujm8aiR5 iZELnAcXlc4n6j/kVrlOeAi/ZNGJr+7NhcT8fc7ySYd9uEtuSk6X/wi4nr0a9pQO/CiR StgMjyipv7q+p+H5R0d8QJiclg6GsAZan5GysCDS1fAH1ozb72AXOX67fjv/HuzVFCvd 99Lw== 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=btEqdg0ldXOUoJ0/xIh/5sGS80H+BzBDLIeiCXJ5MJg=; b=Tc8/U/wRa+J6nIbRgpUzF2aLsVg1X2rExzza6UOfeFesEBXZUZD4iSv8myin4R8U+g LYhOdyf7K1G3zNMpo6KE/my9qdYl4KMJ1Fj4y7p7+aX4CgiecBgLU/WpgHOO4LOaz8A+ Lky2O+wtnruBd434W8S7xL3oyeC98Ol53aIXgjXvrwLTk2UvOToQAhWSWri2bxbnTVDb GoudSFjlnF3LnOcaVWKnSGxRNmAWMsr2i/2ehleGndeYNMwstxKceFw565DYCAKGMnV9 Q2WnrIlaZ/pkTSQD4094O58WHjiWmUaj8krBhD98VX419p0f/Vk1e7fu4I2i10eVojgP cIdg== 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 85si7678517pfz.335.2017.12.02.18.03.28; Sat, 02 Dec 2017 18:03:28 -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 S1752713AbdLCCDM (ORCPT + 28 others); Sat, 2 Dec 2017 21:03:12 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2198 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752646AbdLCCDI (ORCPT ); Sat, 2 Dec 2017 21:03:08 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 143D2D7EE02A0; Sun, 3 Dec 2017 10:02:51 +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:42 +0800 From: Wang Nan To: , , , , CC: Wang Nan Subject: [PATCH v2 4/8] perf tools: Remove overwrite from arguments list of perf_mmap__push Date: Sun, 3 Dec 2017 02:00:40 +0000 Message-ID: <20171203020044.81680-5-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 'overwrite' argument is always 'false'. Revmove it from arguments list of perf_mmap__push. Signed-off-by: Wang Nan --- tools/perf/builtin-record.c | 2 +- tools/perf/util/mmap.c | 6 +++--- tools/perf/util/mmap.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) -- 2.10.1 diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 3bc6cee..26b8571 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], false, 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/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);