Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp438669pxv; Wed, 30 Jun 2021 09:00:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC43YRqv5S5oo9E1jG+fw2SyRmjzSm3MOdIl6FPlADA9TmzhcidyiRqLG0noJL3ln91jxE X-Received: by 2002:a05:6638:4120:: with SMTP id ay32mr1204700jab.120.1625068812129; Wed, 30 Jun 2021 09:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625068812; cv=none; d=google.com; s=arc-20160816; b=UZaPL1eKRoZF+4uapZNCoo/WRJDNvbd2gyMJJbVa/dpsXSqDIPlAl2Bx+xSjNRWV9T n1byqX4AJ7gk6B3GI+LYaKcDnijt+VZ+f5s/uUwW31LEOTLGdTxnHmF5ag92zvg/B9ur QmHUqNkRn73mvMb6YI9+yM62xIHDXApqurDulP8WxsW3ymTAJYo+DLhRfn7v9LfZlZ79 IXiFbU6GofwJSmaMF8Wd5XGMw9ZI1bil3ksG0alxOGzXp8xiKjPsDMMsiE5E9Gn/dkFM JhCtx+ZosLzcKiD9cPJl5mmQn1YGndGZgrqPRsM38JXYLc9n7WppeVhinjYeGlF3qwuG ROvA== 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=9DQnM+WCpqXoyUqgW/qPGim92CdoV+C1OVdCQPad+2s=; b=WjxRBbd0PUNKvx9SfJ6rTDaGU4enSGUK1ZnguOA2Ogzpj/VfKLDw4lDSz6qpRsqIQO a6vdqaKMROQoqxyj0ViMbvtBHP1kQzqpfZf1D0/Ce16u+D3TNHYq5r8lQVJ/QG2k9a5A Rv+Bu761l19EtMhQDCzULt1URKuLOuuC4sd8EFGYsP4c7qAJAeFeY+IeKgNWNXX+flFh Gr03CoKwbwLPNFiZAS4IPNbY6dQfNfBWvNi8MPje4W8e9BTIQ4QV/L2HHvIU8/DRjrjQ Jgn9xM/bU1TS+PrDS1F/ftF+CG7DTuK7OP2xzh6fOC0n2uHghHltINisQvCPZAKkbmTE I1WA== 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 p19si24916293jas.9.2021.06.30.08.59.55; Wed, 30 Jun 2021 09:00:12 -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 S235893AbhF3QAX (ORCPT + 99 others); Wed, 30 Jun 2021 12:00:23 -0400 Received: from mga01.intel.com ([192.55.52.88]:4053 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235822AbhF3QAD (ORCPT ); Wed, 30 Jun 2021 12:00:03 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10031"; a="230015936" X-IronPort-AV: E=Sophos;i="5.83,312,1616482800"; d="scan'208";a="230015936" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2021 08:55:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,312,1616482800"; d="scan'208";a="559099759" Received: from nntpat99-84.inn.intel.com ([10.125.99.84]) by fmsmga001.fm.intel.com with ESMTP; 30 Jun 2021 08:55:46 -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 v8 13/22] perf session: Move reader structure to the top Date: Wed, 30 Jun 2021 18:54:52 +0300 Message-Id: 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 Moving reader structure to the top of the file. This is necessary for the further use of this structure in the decompressor. Acked-by: Namhyung Kim Signed-off-by: Alexey Bayduraev --- tools/perf/util/session.c | 56 +++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 762de808bc03..7b8e19350095 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -36,6 +36,34 @@ #include "units.h" #include +/* + * On 64bit we can mmap the data file in one go. No need for tiny mmap + * slices. On 32bit we use 32MB. + */ +#if BITS_PER_LONG == 64 +#define MMAP_SIZE ULLONG_MAX +#define NUM_MMAPS 1 +#else +#define MMAP_SIZE (32 * 1024 * 1024ULL) +#define NUM_MMAPS 128 +#endif + +struct reader; + +typedef s64 (*reader_cb_t)(struct perf_session *session, + union perf_event *event, + u64 file_offset, + const char *file_path); + +struct reader { + int fd; + const char *path; + u64 data_size; + u64 data_offset; + reader_cb_t process; + bool in_place_update; +}; + #ifdef HAVE_ZSTD_SUPPORT static int perf_session__process_compressed_event(struct perf_session *session, union perf_event *event, u64 file_offset, @@ -2144,34 +2172,6 @@ static int __perf_session__process_decomp_events(struct perf_session *session) return 0; } -/* - * On 64bit we can mmap the data file in one go. No need for tiny mmap - * slices. On 32bit we use 32MB. - */ -#if BITS_PER_LONG == 64 -#define MMAP_SIZE ULLONG_MAX -#define NUM_MMAPS 1 -#else -#define MMAP_SIZE (32 * 1024 * 1024ULL) -#define NUM_MMAPS 128 -#endif - -struct reader; - -typedef s64 (*reader_cb_t)(struct perf_session *session, - union perf_event *event, - u64 file_offset, - const char *file_path); - -struct reader { - int fd; - const char *path; - u64 data_size; - u64 data_offset; - reader_cb_t process; - bool in_place_update; -}; - static int reader__process_events(struct reader *rd, struct perf_session *session, struct ui_progress *prog) -- 2.19.0