Received: by 10.223.185.116 with SMTP id b49csp1018733wrg; Fri, 16 Feb 2018 10:55:24 -0800 (PST) X-Google-Smtp-Source: AH8x225qMFcCfaR1bwipt05DLHxGpln8g6aSWlIxbWGFJLsPTfUVMFNtxUHT59y4O5WO8S0M/Fjf X-Received: by 10.98.53.7 with SMTP id c7mr7021220pfa.180.1518807324407; Fri, 16 Feb 2018 10:55:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518807324; cv=none; d=google.com; s=arc-20160816; b=uEteN6aGM43U3EM+rDZCd5SANSVN8jzaNIGYar22QovtldedixPmL5FvNFdHjcUhwO DYQCAHWSsRN2PMtpgCZsfsHUT+/yd+WOGiyHV3AGEYah3TZ5m9xWGHx3UTs27Wa4rTAc q30/69luQBi1ommyKjsIofyjOSh6bCl/D+VUQM31t3MquGolHhEqY8+mvyk+MTYi9DkT GoN1/0kUp305qhlTeyD0SMu6eRhs39ZE/C2lEidlfrv8F/fwUnotuSLkENrvUGLM/KtH YBmJAfqkZ+UDIvkPjBqpmztjoMmJgxiDeqXq/5Vsi/qEFmUoYv9zkx10Q/qTm635/u6d XGJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=ZwKgyhw61Hle/X5kmDleIsVJPUPpMSZCp5hCdZOR8QQ=; b=skPnQhdvaSHYGDVs1RkqtWpHpuQhbmOQWedbkpLjm3KDfWDNJeCdP3rqF22TwgrsWV UQ3gLqz/LfmrGNQDoMTh/l67MVkXyBGsrY2xni9wUB4XZlBRzvYYadKyRK0u5NzCGS+i e1E+Ax8/oJcx7l/0pDC6bfWc/2GRjQApb3eGJhUZPq+V+aeJ4g7AfSCit6KToHANzpxS LKsAG2K/5lxiONfi3yNK/+ldlE3j1GlESDItYOKMBF9AM4yihKScZWhqltLMTNTcxLNx FKmZs4Ptzj4s4Jr6TPQfxE+hUr4JAKJ7WqdyM1yU8bCxW0DS7+If+6icu3r83OJanyYg j+4w== 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 f9-v6si4403260pli.445.2018.02.16.10.55.10; Fri, 16 Feb 2018 10:55:24 -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 S932533AbeBPJtj (ORCPT + 99 others); Fri, 16 Feb 2018 04:49:39 -0500 Received: from terminus.zytor.com ([198.137.202.136]:35519 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932517AbeBPJti (ORCPT ); Fri, 16 Feb 2018 04:49:38 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1G9cFOw021929; Fri, 16 Feb 2018 01:38:16 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1G9cFo9021924; Fri, 16 Feb 2018 01:38:15 -0800 Date: Fri, 16 Feb 2018 01:38:15 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Kan Liang Message-ID: Cc: namhyung@kernel.org, mingo@kernel.org, acme@redhat.com, ak@linux.intel.com, hpa@zytor.com, peterz@infradead.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, yao.jin@linux.intel.com, kan.liang@intel.com, wangnan0@huawei.com Reply-To: tglx@linutronix.de, yao.jin@linux.intel.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, wangnan0@huawei.com, kan.liang@intel.com, mingo@kernel.org, namhyung@kernel.org, acme@redhat.com, ak@linux.intel.com, peterz@infradead.org, hpa@zytor.com In-Reply-To: <1516310792-208685-10-git-send-email-kan.liang@intel.com> References: <1516310792-208685-10-git-send-email-kan.liang@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf test: Update mmap read functions for backward-ring-buffer test Git-Commit-ID: 600a7cfe88de2c6e44e23d61dd721b996b790eb2 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 600a7cfe88de2c6e44e23d61dd721b996b790eb2 Gitweb: https://git.kernel.org/tip/600a7cfe88de2c6e44e23d61dd721b996b790eb2 Author: Kan Liang AuthorDate: Thu, 18 Jan 2018 13:26:24 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 15 Feb 2018 09:54:08 -0300 perf test: Update mmap read functions for backward-ring-buffer test Use the new perf_mmap__read_* interfaces for overwrite ringbuffer test. Commiter notes: Testing: [root@seventh ~]# perf test -v backward 48: Read backward ring buffer : --- start --- test child forked, pid 8309 Using CPUID GenuineIntel-6-9E mmap size 1052672B mmap size 8192B Finished reading overwrite ring buffer: rewind test child finished with 0 ---- end ---- Read backward ring buffer: Ok [root@seventh ~]# Signed-off-by: Kan Liang Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Jin Yao Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1516310792-208685-10-git-send-email-kan.liang@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/backward-ring-buffer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c index 4035d43..e0b1b41 100644 --- a/tools/perf/tests/backward-ring-buffer.c +++ b/tools/perf/tests/backward-ring-buffer.c @@ -31,10 +31,12 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count, int i; for (i = 0; i < evlist->nr_mmaps; i++) { + struct perf_mmap *map = &evlist->overwrite_mmap[i]; union perf_event *event; + u64 start, end; - perf_mmap__read_catchup(&evlist->overwrite_mmap[i]); - while ((event = perf_mmap__read_backward(&evlist->overwrite_mmap[i])) != NULL) { + perf_mmap__read_init(map, true, &start, &end); + while ((event = perf_mmap__read_event(map, true, &start, end)) != NULL) { const u32 type = event->header.type; switch (type) { @@ -49,6 +51,7 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count, return TEST_FAIL; } } + perf_mmap__read_done(map); } return TEST_OK; }