From patchwork Wed Dec 6 14:41:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 120855 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp7140449qgn; Wed, 6 Dec 2017 06:43:27 -0800 (PST) X-Google-Smtp-Source: AGs4zMaHCnRia32pXW5Pb3wCCT3IJ7mySBvSUc1ES1AvEvz6XwfRoHI1IYTdLjjtr6SaDlLR/yIr X-Received: by 10.84.150.164 with SMTP id h33mr22672386plh.200.1512571407266; Wed, 06 Dec 2017 06:43:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512571407; cv=none; d=google.com; s=arc-20160816; b=GQ5OnwUiO9vpIEhcnAg/CiEp2BSiVEvqFSKU35bVr4GIbPjiBSpH2V0awGI/7UcmIE NL7/5vpOoULMdKRaqFLW0IZuZV7FFuRzBityTwB70vYGlOIsgOLxScr6pcxtFmCBKzBC 7r4tOhtWmq5Inn6s4iB/qgaf7N7fp9AH4tIH10/eD9/h/IkzeghvfCtSaVUma2R2rVnq 93HsXpN0kjGcF3yr6gEsP7W45HepYn/wjaPEQYYR5IHUy4wOWmEcyOEmipLLJa0wEaPM dcpFmJKhShNkvVK3mJUhPU+nXGqK7pHS5PLYkG8B4wl5plnXWD7f7UuXXxv7Gvw2oegk G4kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:arc-authentication-results; bh=GY4VPDcsLYg7LZcLurEyBYA2Q+xJzlqcM1eI6RMXIng=; b=wV3axXOxqYE+BP6PeKwOdreyX7sj3HJpspE+5Qiq9P8vQkdEtEYAMPslqGtdNVXbns VXld2MxtUbk2SDU/KiJ1DUmnB/QpJZVzE2X1hR+3DcyT8eCbbiVU7Ptd0wzyxUN+v1bo QZ7TTWGDoVZ9Fun7LSrasZMCGCIro50KATu0arfVxi7+uRUuo3PEcBe3qL+d8+CKcbSF 7lha9oJuRAqWonYUEwc4cmnYiJsagTvIPDcQZ8pL9X/nNts/u74DWDS9DrsV1ABN5Ane O+A7r2FoRyx7JRuNQRrpocPvOwDaTKe1OMBxlgks4K3aunF1Ay/0I/3OqM6Ne6iZ2Qzq H5Tg== 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 c9si1979346pgq.337.2017.12.06.06.43.27; Wed, 06 Dec 2017 06:43:27 -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 S1752903AbdLFOnZ (ORCPT + 28 others); Wed, 6 Dec 2017 09:43:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:58410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752713AbdLFOnV (ORCPT ); Wed, 6 Dec 2017 09:43:21 -0500 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0621D2199D; Wed, 6 Dec 2017 14:43:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0621D2199D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Wang Nan , Jiri Olsa , Kan Liang , Arnaldo Carvalho de Melo Subject: [PATCH 28/36] perf mmap: Remove overwrite from arguments list of perf_mmap__push Date: Wed, 6 Dec 2017 11:41:07 -0300 Message-Id: <20171206144115.15097-29-acme@kernel.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171206144115.15097-1-acme@kernel.org> References: <20171206144115.15097-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Nan 'overwrite' argument is always 'false'. Remove it from arguments list of perf_mmap__push(). Signed-off-by: Wang Nan Acked-by: Namhyung Kim Cc: Jiri Olsa Cc: Kan Liang Link: http://lkml.kernel.org/r/20171203020044.81680-5-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- 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.13.6 diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 3bc6ceeae1f9..26b8571d0fdb 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 9fe5f9c7d577..703ed41a9269 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 efd78b827b05..2c3d291785de 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);