Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp410050pxb; Wed, 29 Sep 2021 01:44:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTgiJ/N0NVJEODi5u/se2akWUhOz7MPM2JWXITA/gY0onkSAbef/iZnMzcZssyxWKDE9CK X-Received: by 2002:a17:906:fcc4:: with SMTP id qx4mr11969641ejb.364.1632905046109; Wed, 29 Sep 2021 01:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632905046; cv=none; d=google.com; s=arc-20160816; b=ACrLVDINLafCLp42xESvClvSoHTWARw9iKrhtZKPLyZsuomiQHIOzRwHwPqVPInD3B etfv4dDbS273J9nuksYMn5d+J1D6u2eOjM0Lpc/02kOtG4/U3bHQr7zylAOdvf8nBUHG 4m06b4oQvb2AU+stopz2V1he+2BAXsxkw3ZmgDWA6IvpfKBaYJooNr83i+nz752g3CbM snuC0XN6kOd9fx8kIXTBSgM0F1EzR8vv+dnslJYxl+dgmGZe0FWvPehDnPVfkmzewcBf M5fUTF/9Kn3g0qov5H82uoJKpsSK5m2RS3TUg8hnQsnl0RHRVPMks1MkasjiUs5Mb85y C8aQ== 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=SFkTaDKew0kqc/5leQBK3do7Q78RoOvolp1N5s1t+2k=; b=JrXcZ/RvkyKssokx3ztdDaqwJukkp9sfrRQjylyPTKDv06i4MLIgMo84Y5WVI1akt9 mWaoIKZ7hkA3kaBMgBDm0Wd1JAEBvxXX71p383OfYcxKHXUYoGBKqepFz5FBVak4Ofy9 5nU2uLnDd5RqCy7TNVgzgoj6PV74dOonUBEU6ihBDsqddJBWEeSW1g6lsl5igWLSDEpn icGTtyf2nWluZiZaRPN/eduN2aPpRM4Som7WxH5N8NrBWsUgExXNttvQ3JcMwdqxAYg6 dWF5Ahl72UADKQXRA56P9vb9Z0BURi0RBrvzjnFto++gM68Fbb6LKrdbJTJt9XAm9mwe n2sQ== 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 k9si2325840edv.52.2021.09.29.01.43.38; Wed, 29 Sep 2021 01:44: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 S244838AbhI2Inn (ORCPT + 99 others); Wed, 29 Sep 2021 04:43:43 -0400 Received: from mga07.intel.com ([134.134.136.100]:13702 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244829AbhI2Inm (ORCPT ); Wed, 29 Sep 2021 04:43:42 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10121"; a="288550367" X-IronPort-AV: E=Sophos;i="5.85,331,1624345200"; d="scan'208";a="288550367" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2021 01:42:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,331,1624345200"; d="scan'208";a="520757307" Received: from nntpat99-84.inn.intel.com ([10.125.99.84]) by orsmga001.jf.intel.com with ESMTP; 29 Sep 2021 01:41:58 -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 1/6] perf session: Move reader structure to the top Date: Wed, 29 Sep 2021 11:41:49 +0300 Message-Id: <5e4a1ae25571f54f4d1ed62c4053cc7c62bbb719.1632900802.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 | 52 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 069c2cfdd3be..43bc58d465f2 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -36,6 +36,32 @@ #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); + +struct reader { + int fd; + 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) @@ -2147,32 +2173,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); - -struct reader { - int fd; - 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