Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3398180pxy; Tue, 4 May 2021 00:53:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDVffm/yqSWsAFzQWjr1vnmQUGx8VnAC5uNvRNOqBKYsAK0XJBOn+ZMqEK2dOnJaF3sMXn X-Received: by 2002:a17:906:4d07:: with SMTP id r7mr20627724eju.224.1620114836673; Tue, 04 May 2021 00:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620114836; cv=none; d=google.com; s=arc-20160816; b=zHrE4vqsRSlpXe9fj/vOiRJF4cpm9dQ18xgGwrLNlls4C0QkXzxVsZkTdhNLCkzAPO 5XNz15x9C5qRqmXFkr8sK7jwj3EGGPIGL1oXTRXcQiYFhQemzYa3GDmTuChmqVAY1GaD tfGuk2FwYmz9W846WaqhisHk2TQq2xfYt5pcinWVKWoQhWs5m0akp8RkgRKYU71cR48U abeFhie9YRbiM6jbbrdnWuTW91aMrUgNB8IOQE1VtgChiXhPlxUm/2GePm1vTpmUozwo jL6RM9NZcIzkaVxZ/lJXXRG1G7zB01a+yiTMR6ZgRI2EdtZgsJrvNoShJPDKqMOXhv+g Tsgw== 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=Zm/Maf9AFHfi5GFwPY2WMZcb8l/Fz6l2kRWdNF4GzGc=; b=hPOQCLI1HrlEmWUXQkX6LDqlsSRa+GRnzgwsIRYzG/0ILIEVAd18OIYA0uzuozJh/C y4qkycXEc3nN8b2Jr1qGwm6m4NGIfXmOAH793cgcJm2gT9gurbkHksV/pkpBt+s+kV6J 5UEP1EBnBD01ZQfel1fz753OXS96Zwe5mBLzN8lb8KkYTavYQA5keVceIu8GzlAhSFUS QPhogD6AyFXSk7IYH4OUpoEfvsaw0ard0NZ7M8dMOn911j7CcWuGDsnZCYjD106El1FB M+cpL6qgvfLV669aEVvytlmcPYxdIiiguEK5F5nWtNGTWQ3+E4Ntqml4AEjQp6ji2Psv PcHw== 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 cw1si1858205ejb.544.2021.05.04.00.53.32; Tue, 04 May 2021 00:53:56 -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 S230109AbhEDHHf (ORCPT + 99 others); Tue, 4 May 2021 03:07:35 -0400 Received: from mga03.intel.com ([134.134.136.65]:37661 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbhEDHHS (ORCPT ); Tue, 4 May 2021 03:07:18 -0400 IronPort-SDR: uBMqWYgR5kYLOujq30jmGXxUcvY8+EhZd33Jk5YV3XO1c/Mv0NDeBuOFu5EeirdItjICrlz+h7 sASECSwKx2eg== X-IronPort-AV: E=McAfee;i="6200,9189,9973"; a="197971031" X-IronPort-AV: E=Sophos;i="5.82,271,1613462400"; d="scan'208";a="197971031" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 00:06:16 -0700 IronPort-SDR: /twEElXSPwR6Hrr6PY+Em64rgrnV+USAP/cDA+YEUWo/0j/RzKAuARQbmltxJR7zzj5DKj56d+ OCROL7xYDBGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,271,1613462400"; d="scan'208";a="450895642" Received: from nntpat99-84.inn.intel.com ([10.125.99.84]) by fmsmga004.fm.intel.com with ESMTP; 04 May 2021 00:05:59 -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 v5 13/20] perf session: move reader structure to the top Date: Tue, 4 May 2021 10:04:48 +0300 Message-Id: <0b89a40e0200b1180e6dbfdb56694e3f8436e8fa.1619781188.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 | 54 +++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 573bdb2f446b..a4d225e0569c 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -36,6 +36,33 @@ #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; +}; + #ifdef HAVE_ZSTD_SUPPORT static int perf_session__process_compressed_event(struct perf_session *session, union perf_event *event, u64 file_offset, @@ -2143,33 +2170,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; -}; - static int reader__process_events(struct reader *rd, struct perf_session *session, struct ui_progress *prog) -- 2.19.0