Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4511650pxj; Tue, 22 Jun 2021 01:47:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaDN2h0Qc79jmd246jfe8EEAHbEnrBIgcfc6UlvaPMdwA8Xp4clzILHNl0q2koUj1qH2TO X-Received: by 2002:a05:6402:1a:: with SMTP id d26mr3477405edu.105.1624351665297; Tue, 22 Jun 2021 01:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624351665; cv=none; d=google.com; s=arc-20160816; b=bSh2H8oyn/kvx5oj6tSHwxLlF49bNbtcTnGhn4mVGc0pUotsN5cRvsK+A6qZTcCX6F Agc1QNtLzdU6KrwjkRWU4/rgMKFHU0QiZdxvcHjz0Fh0zCRptmh/TZWFhvGcbPRdKhCY SVCWqtnJ5CI+JwnDhCeheWum7miqCVJvrlsWCT0naF9F+M1HZawxntn1cOdAgh4EkE0O u7Oh/NxR31jhEZG2vVlp1x56LUrDwT/YnZ3sIa8eiIYhDuAqcIezuyIMxP1S+9pVcRs5 4kKdSNjQp5SWKoAAy+fIwNf7ohV/1BaTDeCUY7G6IixCSotr44nVOY2/x4FAvv4EkT4z 15Tw== 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 :ironport-sdr:ironport-sdr; bh=yeOJcj6bFktXDzt4w5lD2YdGBNmZE9DL6RICClUKDlo=; b=YOAfI8VIgnxFdhwuwsvmyIg0r61oSJSY/skPUCTkQuj/j9bEm+Ava7NFvEI5E3za1O VXoLzdmR7lAGAvrsKCR2Ljc97IHMy97eRD6h0fO66TZfyT0J2opw3wYMzKR9JCp3SwGl CeuV/tWEUlzVRZKaW7egYPGl0obYoqfCZkTn8P7UQ8BizvdUYMueEaTKYE9V3YUredeK Q3gyvsDp19jcuijvhCfdasSGufPO8Lhp6a/DT8WvBybiNxcZYx0S5FBtBMOaf4hiFN7z c3hwzZRxItxKEsR2vcHcO4f626BPwICBHaTJX+OVYTi2vssh/s0Z+QbkQdVTX2PkQzhj 6uNw== 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 hz14si9472983ejc.533.2021.06.22.01.47.23; Tue, 22 Jun 2021 01:47:45 -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 S231305AbhFVIqC (ORCPT + 99 others); Tue, 22 Jun 2021 04:46:02 -0400 Received: from mga05.intel.com ([192.55.52.43]:57647 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbhFVIpv (ORCPT ); Tue, 22 Jun 2021 04:45:51 -0400 IronPort-SDR: 8IRSKsRU94bFIKFreWDikev0U7EHKHx6Ld0Xct6ThZWcG/LtESq6gVlAfQiBznf7caNxIPsF6B qkBLh8LP7V1A== X-IronPort-AV: E=McAfee;i="6200,9189,10022"; a="292641617" X-IronPort-AV: E=Sophos;i="5.83,291,1616482800"; d="scan'208";a="292641617" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 01:43:15 -0700 IronPort-SDR: fWKoOMJonN/8Uyg7c6iz+i6gk2R6FYJcuts4QG6R7KX9EvAmZwRBHOigc80lpd44nwwgC8v7wr 5GG7/dMB9r+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,291,1616482800"; d="scan'208";a="417332635" Received: from nntpat99-84.inn.intel.com ([10.125.99.84]) by fmsmga007.fm.intel.com with ESMTP; 22 Jun 2021 01:43:12 -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 v7 13/20] perf session: Move reader structure to the top Date: Tue, 22 Jun 2021 11:42:22 +0300 Message-Id: <1b6f5ffc73a9208db7b97c9a43581610175def97.1624350588.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 Moving reader structure to the top of the file. This is necessary for the further use of this structure in the decompressor. 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 09efd7c02400..6ba7da8c5daa 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, @@ -2143,34 +2171,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