Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1506132pxv; Fri, 2 Jul 2021 05:35:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyioM8RK4mT2UgS/ngv8Xyn9SSCOZc7WI0BJ/Q3L0KzPDe/eycvVamf1wSdU+X/+KjNziT0 X-Received: by 2002:a17:906:36cc:: with SMTP id b12mr4984247ejc.534.1625229351982; Fri, 02 Jul 2021 05:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625229351; cv=none; d=google.com; s=arc-20160816; b=e5KHl0gRpIOLevYM6+vBpGjQ0YhmY97eXjyUKeEhtEbQ+1tIOckis4oxVvxOB4Axmc Lpf6geV+gYewDlqED4JQFKv3SplIjoZz1i4d8F72/qTzqd51U2ye0X6MNwUrg7nFqcYb cY4d9nXp47/QahYS2tYkG/eZg9NRt94UdqnU/EEWzaZGM8OJCjhf3k9p+S7N+IDUekxZ 0Sg5YnZbSXUzlrX6YHM3jzmKtbe8H3nQelaf1bM4hHHAzJmC0oAo4gaC2D26HxhcxnhR bAtigx5FgPneCqVsVWIkSC8ocX3Sjhu2HaKOsbpnduwkqC3an0QEkKv5WMKS7pc+ADT2 hckQ== 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=IKJQDnC7c7uq+qWD7WxyKgvjG8rDtmyKHwmYsVgsiTg=; b=s0FRicRcqs4PRUK09v+B1IDqbDxV0CUOjQqJpj4wMIMFXgCWCynUtz7ArUBa+Ik0Vx SJe4rvipOa++PPaE8Ihm7jJwbF6J+/9ey/UI7vjNl3SLYOWZ9vVaD8QjmKJ2/df0jMp3 BemXyNVWxeNGwpukol08lvPa9Ur6zOohOn/v2/PbiHTeIeLcyRirKWsxbEX8VlhbBFAW PaKO6YiRJuxQ+ZaH/A4qMtjCPJHv+Ek4YbaRyYrg2PIEI06zukqt9BAUVkedtEzbERiR gTRG3TJqbonTDBr0uwnPxV3FgfHUQOD13VtzgyZBwB2XEJ6mdrT+lX1SK7y9+8/txSj2 4adg== 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 v9si2798644ejc.307.2021.07.02.05.35.27; Fri, 02 Jul 2021 05:35:51 -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 S232460AbhGBMgB (ORCPT + 99 others); Fri, 2 Jul 2021 08:36:01 -0400 Received: from mga17.intel.com ([192.55.52.151]:32637 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232476AbhGBMgA (ORCPT ); Fri, 2 Jul 2021 08:36:00 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10032"; a="189107318" X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="189107318" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2021 05:33:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="642660312" Received: from nntpat99-84.inn.intel.com ([10.125.99.84]) by fmsmga006.fm.intel.com with ESMTP; 02 Jul 2021 05:33:25 -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 v9 17/24] perf session: Move reader structure to the top Date: Fri, 2 Jul 2021 15:32:25 +0300 Message-Id: <4f00f937e6a60b9fb59f5d6ef78efc8525bcc873.1625227739.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. 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 7b4678ffde5c..1cfb5655e092 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, @@ -2146,34 +2174,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