Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2831944pxv; Mon, 12 Jul 2021 03:03:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbKn42/hlXoTFTG8rF9VTk6Fyu+ohMx43076A/uw0bVXOre/6DIoAEsiAajqbKbzK8iWaQ X-Received: by 2002:a05:6402:28a1:: with SMTP id eg33mr64019602edb.249.1626084186936; Mon, 12 Jul 2021 03:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626084186; cv=none; d=google.com; s=arc-20160816; b=YX0cVlD+aoxNuSQDSG1VCatVD21KMggIVCFx1E+aKB2IBbxejDfnMV72apO0jeUcBk u3HzAnLppjRticdwEIxbI0bq3yXr8mbX88HdFWXFuUvOpeUteay3tLsyA7L14/5Cmqho vAx5BobJ5eAAJfbJR9Fi5a+4F4rLlYeG+dp9kz/xLhZuRr3AQgiNeGjRsbb5LRJPlLdG mgnZaCrrfGAtVQbAtGCWp6Nzv26864Sgv0kOfqK5uLnsGtX8w97YScBvZ8uC+MkMIRJb N4HhGk7gdAiDm/U/KmCGjZ5moi4IoxANFYcfls2p9EyL97EIgU/wyz4LUcZBRmBtAGIg DcPw== 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=t4qjmkeJaaK2jTTQBBcmduWVtgQLFY0oM660/CwL3sORnw+abWB7KJZuAHU0NADH+/ ctf/sJb3RxpMH6m8cUAIw0juYMx3PJPpKgIbOvA9x/V7XEh84YAqi8yXKhlcKXMUyC1G XRpVz/uEosIT4uLx3C6broSevQgCE1HP+ANERJXpb8n63QGC6o7XFtC0BFGZrnwQ3N8K uSZSFAmChx5Z+ANHGgyuskc/T5KJ9EadekxMqRY4b6tJnndvNdsjAzongIogjkIPsx/6 D2La6ROeVC9trrHrE5KK2Lm6AyxLMxErpGy9ue/qjdoso3tmCyNkxI42qQaLX3vmjl1v xiow== 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 gb26si19777515ejc.727.2021.07.12.03.02.43; Mon, 12 Jul 2021 03:03:06 -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 S242827AbhGLHMK (ORCPT + 99 others); Mon, 12 Jul 2021 03:12:10 -0400 Received: from mga03.intel.com ([134.134.136.65]:25899 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240001AbhGLGub (ORCPT ); Mon, 12 Jul 2021 02:50:31 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10042"; a="209973417" X-IronPort-AV: E=Sophos;i="5.84,232,1620716400"; d="scan'208";a="209973417" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2021 23:47:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,232,1620716400"; d="scan'208";a="491916323" Received: from nntpat99-84.inn.intel.com ([10.125.99.84]) by FMSMGA003.fm.intel.com with ESMTP; 11 Jul 2021 23:47:29 -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 v10 17/24] perf session: Move reader structure to the top Date: Mon, 12 Jul 2021 09:46:17 +0300 Message-Id: <94889db340cf23dcc898e6e497b3f4ec976fce11.1626072009.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