Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1013743pxb; Tue, 17 Aug 2021 01:27:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvaE4uec70XDG54XvkjVzwwMlVO2dWxCGXq1WnUbR24WUgyDRUtX7bN9m05qm8UDjRrQ9i X-Received: by 2002:a17:906:9b87:: with SMTP id dd7mr2566622ejc.99.1629188874701; Tue, 17 Aug 2021 01:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629188874; cv=none; d=google.com; s=arc-20160816; b=rT3quRhONFfDn++ONSFvciG+jIL6NidBaZNhr73ih01wOCHT2feiEWQFSCmGw6xyZb NNQ/84z/id/VsSH5uwcLwfPhD178troMlXIPF0hTA3EdkL9GqWVAW4LUXXZUpNl684r4 +kzuEo+26vfT/h9sjOa8LelgPHQCwtkhSG/LRcpq7ZEJK//tS217K4C7YJ4qQw8Ty+Ol N+XS5WFQUg7aS0UJPnPq/tTbaOq+ciuQmwir/pR88nla//4orD6cJukaeeNH+kJkRUoS iIit9WpNxlimUbCs3HL9xaG5U4VasG1ZYWjmvdS9XjJicKV0AYrh6HygvOIcPSj6m48p aW+w== 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=10iQKYVo2K3BmlpICllSdSw37i8h/yABnfYT37Kill0=; b=gySK2nyc5AmLtJAYON5fpNWAb8nGoI6mXtHr387iqp5mvUuNx/1V5QXgMjvxeWqG4M +V8HHto8MawIfAEtw9j6wvA/AFSKYMgY3XAsyTI+dKGJPoHdGSicTeaFDhNpcT65LJaF 5mVnYI2ZTIEWo5GdJmbd8V6CLUm3XODToPHU99pP2g2QQKkeaGbSytWvttaILYwKgmq2 ADpWeWfZ+AKGymkGPfMuBujTaGGx1DY9CWjrgyoUjuJI1mLUmpRsaZdAws6Olwo01S1K Sn7hoo7gM/NS1t/sLwc7COhd7CdMDCcECjCt35+NItMeuL3tQ9a3spfVMDym7la+YfmJ Uotg== 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 ga2si1633510ejc.213.2021.08.17.01.27.31; Tue, 17 Aug 2021 01:27:54 -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 S239366AbhHQIZs (ORCPT + 99 others); Tue, 17 Aug 2021 04:25:48 -0400 Received: from mga04.intel.com ([192.55.52.120]:18130 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239322AbhHQIY6 (ORCPT ); Tue, 17 Aug 2021 04:24:58 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10078"; a="214171934" X-IronPort-AV: E=Sophos;i="5.84,328,1620716400"; d="scan'208";a="214171934" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2021 01:24:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,328,1620716400"; d="scan'208";a="471080407" Received: from nntpat99-84.inn.intel.com ([10.125.99.84]) by orsmga008.jf.intel.com with ESMTP; 17 Aug 2021 01:24:22 -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 v11 17/24] perf session: Move reader structure to the top Date: Tue, 17 Aug 2021 11:23:20 +0300 Message-Id: <2bfd2c70361f581923457f430a65967e873c2a45.1629186429.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 Reviewed-by: Riccardo Mancini Tested-by: Riccardo Mancini 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 207edce176c4..fe7d986cb094 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, @@ -2148,34 +2176,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