Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1333770pxb; Thu, 7 Oct 2021 05:51:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysskUw1VUTY/NhETo7oSCwKmTb0856vIsPacuHQ+W9E2/PewvQHcjUE/eH9qkMy8ensBNi X-Received: by 2002:a17:906:3148:: with SMTP id e8mr5562939eje.240.1633611069049; Thu, 07 Oct 2021 05:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633611069; cv=none; d=google.com; s=arc-20160816; b=Vw6Cu2mxTX5JKjqfYcIhPaEmdOkLVAAq3ECfReg69Ju+1myfmJNRV316b9Pi0dSy1Y MliQ3EjIZIbf+dYR84Qi+dkNpmRfz/IHeUrO3hDMqbnkL6XUnH5GVgldDgGVIIqHElEw cSMfXECAUVm1z8YsRDF5UAu52Xe81stoJIfixlr+2UP+YLDLFtMpd6Fniv7e5QMwlXj2 E/flHkhJSzrZb9yjnxShpIVyWkJyAGiAj7DHJ0rH2w2TUMzUNlI9Zz445kW/RvCuiRKo zx89P9ZbTfrISXZzvMH0/dUgERhLCU9ofybeYPpRCtiXzUxo9xcO4EpoYR712hYXY8NK cXVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=85b1QpKhce51dir+gxhd4dtEeo4LJH2QKoGmE39frRs=; b=VSyGLXttRxnZMYDqYfYf4U9wtmGfW5TTEqkhxg3/iC+ng5CBKQuZwC+wySwLVeLihF nUgY9Ofd7ZgSXrah1tj2eDQF7Fr1WRzbbTghNlA8+hM9zQ1UJpPmWvyajDjY4KTFd3+m 7wTnlgPAa1F8um5e+ncPzEya2s3U63G6BXj6kZPToHF2A+BSLdfwHR9E6FqS/rJlwYLZ 7vWjoHhU0cGWU+F5LFIN8OI3Z/oo7nqpdDbcfCZsIuafNwf0xqDVBGbz7cnUW6loVglX ewpEyVeAT31e5m/K6+a+kYGMDdbmOnEz8ZnrTc58qjrl+ZYH/WpRqxCHwHjFQGTcMWnp rB6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk12si20322691ejc.56.2021.10.07.05.50.38; Thu, 07 Oct 2021 05:51:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240954AbhJGK2N (ORCPT + 99 others); Thu, 7 Oct 2021 06:28:13 -0400 Received: from mga01.intel.com ([192.55.52.88]:3747 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240919AbhJGK2G (ORCPT ); Thu, 7 Oct 2021 06:28:06 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10129"; a="249532681" X-IronPort-AV: E=Sophos;i="5.85,354,1624345200"; d="scan'208";a="249532681" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 03:26:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,354,1624345200"; d="scan'208";a="657335544" Received: from nntpat99-84.inn.intel.com ([10.125.99.84]) by orsmga005.jf.intel.com with ESMTP; 07 Oct 2021 03:26:10 -0700 From: Alexey Bayduraev To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , linux-kernel , Andi Kleen , Adrian Hunter , Alexander Antonov , Alexei Budankov , Riccardo Mancini Subject: [PATCH v3 8/8] perf session: Introduce reader EOF function Date: Thu, 7 Oct 2021 13:25:43 +0300 Message-Id: <80d22da1e90cb6da0d014087351d4cb95675fc4b.1633596227.git.alexey.v.bayduraev@linux.intel.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introducing a function to check end-of-file status. Signed-off-by: Alexey Bayduraev --- tools/perf/util/session.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 7d88c651ffd7..f74e153231fa 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -2311,6 +2311,12 @@ reader__read_event(struct reader *rd, struct perf_session *session, return err; } +static inline bool +reader__eof(struct reader *rd) +{ + return (rd->file_pos >= rd->data_size + rd->data_offset); +} + static int reader__process_events(struct reader *rd, struct perf_session *session, struct ui_progress *prog) @@ -2336,7 +2342,7 @@ reader__process_events(struct reader *rd, struct perf_session *session, if (session_done()) goto out; - if (rd->file_pos < rd->data_size + rd->data_offset) + if (!reader__eof(rd)) goto more; out: -- 2.19.0