Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5141599pxj; Wed, 26 May 2021 03:58:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8p6YcYzavgMGThpkArOW8RGOzRoyPpsajSA27bdtinw6fg+TtCpVsfTLhs0OHcY3fnWat X-Received: by 2002:a17:906:3042:: with SMTP id d2mr33739443ejd.234.1622026727911; Wed, 26 May 2021 03:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622026727; cv=none; d=google.com; s=arc-20160816; b=O4/xPRs4EZSPoxTmEQ2uyxKPLy3131e86u/JtxGwgerPYx9In9JaCE/8kvpELz28Dg M18QaIZLtojGn1OpYIA5GzUaYsHYvEzMKotMYk3l3kdUv5CrsF8Po+T3K1QN9eq1/qyX VJiBdAGZVNSpuT4lNYdCIieg90ZQUYBjgoJb07UKFO+jlFfy0+G8q7KzM2GmOaf6nXFS PAZsJ6aIMic//4jlreIhDufTvPom+aTkuSnZjrmoCkg49Guy1fAHRwkR3Fr2rF0LZH2L vYvsMXRlSdoTVaKhyI82PxoAhEjveWObsO4fNfe6+kIdB60ZJ1gtOGSA5r/03Y0ubRYH DxUw== 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=B7uX9AAg+bW8gWR5RbKpI+Oevps8+zsiqynLD5Q/615z+0lKKjPz/R9IUSeqXtMjxw 07ZC4X0PrGMwMGhTDkYp/SmzrVsxhp39pN1ZPQwLuI9yy/BdcslViiCarWLoojalH0cs qM9fQ70mHWdXHQ/dB4A9ZXj0QMFed3NlS7sGQvKJOwsl5uRcWZJa4JmqNb5lG2ReFQmd TSTMXeoPbRFCCzdrpADlk7zmeSmTWcmUE2jXw7BhNKtTzDTUnBUgkPkgoAYOgWeMSjut /BsRwZ4pGKQuw5xfp244Ig6LCPYnjYYODO+eUy0n9m9ejz1RDy8xI0fYmm+t6s5MkZun +X7g== 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 n1si18060622eja.710.2021.05.26.03.58.24; Wed, 26 May 2021 03:58:47 -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 S234423AbhEZKz4 (ORCPT + 99 others); Wed, 26 May 2021 06:55:56 -0400 Received: from mga02.intel.com ([134.134.136.20]:1593 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234276AbhEZKzb (ORCPT ); Wed, 26 May 2021 06:55:31 -0400 IronPort-SDR: r16bszrY6cJD4mCsth4rpu6lrnoTU3DDXbpd4eRAiF0taK8mgRH2gldxA3R1PAP7jFaPM+BRN6 47btJ6gtLrcQ== X-IronPort-AV: E=McAfee;i="6200,9189,9995"; a="189556477" X-IronPort-AV: E=Sophos;i="5.82,331,1613462400"; d="scan'208";a="189556477" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2021 03:53:58 -0700 IronPort-SDR: 56d1KKqtAS8YCoEgMk4+sja0w1L4RLUKZl7sUzkJWcePi/kF/hL6U14PtLcLogtMPmDIJMYSNu MiNp08Krpxzw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,331,1613462400"; d="scan'208";a="436079342" Received: from nntpat99-84.inn.intel.com ([10.125.99.84]) by orsmga007.jf.intel.com with ESMTP; 26 May 2021 03:53:55 -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 Subject: [PATCH v6 13/20] perf session: Move reader structure to the top Date: Wed, 26 May 2021 13:53:06 +0300 Message-Id: <9686f087319de7d9f19505404ec26b804c91ee02.1622025774.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