Received: by 10.223.176.46 with SMTP id f43csp36441wra; Thu, 18 Jan 2018 13:33:29 -0800 (PST) X-Google-Smtp-Source: ACJfBot1AhVOKIR0Y96DD4cFFgiaYQJr+yB2lkTHj6IUUgIs+0Z+weU1HWSFKrD2i3PXOd14escT X-Received: by 10.99.165.28 with SMTP id n28mr18043307pgf.103.1516311209345; Thu, 18 Jan 2018 13:33:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516311209; cv=none; d=google.com; s=arc-20160816; b=sr8J15GonrNuZ7hrYbk/renyW6yPu5bWTolyVaOco39lCOC3NvY6E8RShQzkZzUuWI yxDnWar+hMnqPvBfp9lrvPCNrxI6DsFjg9qKD5cKhBzD8BvjFTo3LdvEW3/rACBNLcXE oOTjV2sT2sKX1bfNMqPVYkQf9NtDk4g7fxiawvmW67P+3MZRjCgqaEnBcbSV3m8pZZbo g/UDj2L06/K/xrfgPn7QGz4tuhweJt6Ja1dlro/466lzdnwPtpclp8Gkl2k3kIMEmnAl 1hKWcjnkdxA/iePcLmcYK7cBNXb1Pukuu+3PnX9X26M6HveRyS+Pc20wXYSAeMXe/1FS H8BA== 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:arc-authentication-results; bh=L3X/EpvI5vzi1RsvyCBy/qyOcfskbO2m+ACuAncPCTM=; b=Np2vkGyHVuTjZVE45XY/yXfb0gdsUK4Dywzr31bqpWNqTdpWCidFVeIaBGd/lCIfyL PAEK1ZmiQ76t2eFW++SjogW5ckvah/hSr8Y3bx8K9g7vEN3UvZWHadpXz1+5gzJARLHA 8HrQRYgOAWgp0nMr386XnQlkyMWuTrRDhDww1brdBUcR3j6Fg4p5Ptc45Q/rRPL0Huj3 3qBaf3f604rPftJn/RjQpII1076EojZZuQzvdToCi2SCofAAwX7g61Dy/U1b7jjD3Maq 2wW5JAwjUz3R0tWR55sLmL241VgyZo7yvRwgi4dxlsOJuMRSdo9MaiezdgYsN15sNP6t G6Cg== 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 p78si7658190pfk.233.2018.01.18.13.33.15; Thu, 18 Jan 2018 13:33:29 -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 S1755230AbeARVbB (ORCPT + 99 others); Thu, 18 Jan 2018 16:31:01 -0500 Received: from mga04.intel.com ([192.55.52.120]:47423 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754236AbeARV1g (ORCPT ); Thu, 18 Jan 2018 16:27:36 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jan 2018 13:27:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,378,1511856000"; d="scan'208";a="11477260" Received: from otc-knm-01.jf.intel.com ([10.54.39.34]) by fmsmga008.fm.intel.com with ESMTP; 18 Jan 2018 13:27:34 -0800 From: kan.liang@intel.com To: acme@kernel.org, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: wangnan0@huawei.com, jolsa@kernel.org, namhyung@kernel.org, ak@linux.intel.com, yao.jin@linux.intel.com, Kan Liang Subject: [PATCH V5 09/17] perf test: update mmap read functions for backward-ring-buffer test Date: Thu, 18 Jan 2018 13:26:24 -0800 Message-Id: <1516310792-208685-10-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1516310792-208685-1-git-send-email-kan.liang@intel.com> References: <1516310792-208685-1-git-send-email-kan.liang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang Use the new perf_mmap__read_* interfaces for overwrite ringbuffer test. Signed-off-by: Kan Liang --- 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; } -- 2.5.5