Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp603874pxx; Mon, 26 Oct 2020 16:35:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfhpf+23ku40wTa+9F7FVFRxU5lawdSS28CcDIufBMhNd9aSecratLc4aEJdeS38j4ND+K X-Received: by 2002:a50:d2d3:: with SMTP id q19mr18737226edg.22.1603755330642; Mon, 26 Oct 2020 16:35:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603755330; cv=none; d=google.com; s=arc-20160816; b=fQgSPrhwx7SWEBepP/INqbfGpuvBb+dqj4jQnV1rLbMgOMsrXW3kScOlZ0AdIq8Hk5 oLJdPK67VqyjXsDOWSemhqn2bCfUpVIRGanLIZquy1MJTMuxla+7eAyJGyxLAfG8xnpi v+SvvSogD5lTVFpgTMmSzIrWbT62aSjFqJhNJ5M2OSUAusokl+nAubo0IYFr59oxT77U /VjoE+7fYrQ9brGR+OxIeb+Spp2WA2KsIG44GIXZQZLgDERI4PtzTgna6V3MiXU3wk5S VDl3Uy1v7zJLBFrcGcJIMKU3qVObmfn9sZq/7ic9dU4M31WfJTFV9ux9ZKAXdVx4foAq EetQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=X+Y1JwnIYoxl1hBYKrhGuKk49Y15d5IA8+F/f+xfH3c=; b=UJFaBaV7rXsu/JPpJxnwnzGwE6txmFOf84JXrvpKIR2VfBBW1Fr7+aq82Yf/ELaHZi V22Ua7cHipU0snKEnG9b3QSw+pX47Q6P1w5mqyYJllay52gvz4v3a2u1ugu6NkbHZXki BX+lOsDyALaQr79RIfz0Z1ra7Cs/11BLCABxKtXOK/GpUeQDLg5zG/hPnI1Srep+PeYL m+o7x7sfgFCp2tOk/qiFSWwpXkqghWFVocr9pIsJANJ0/nmas8bmn960Z3r9tfQSSZ5/ v25WmT1/pHbYbbfcN8Nr7pyMkqOXvuKDo57tb11zEhdCBqHqvSyNhW9x5unVbarfLRTU Ru7Q== 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 cy8si7961965edb.527.2020.10.26.16.35.08; Mon, 26 Oct 2020 16:35:30 -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 S1788515AbgJZRuw (ORCPT + 99 others); Mon, 26 Oct 2020 13:50:52 -0400 Received: from mga09.intel.com ([134.134.136.24]:53190 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788510AbgJZRuw (ORCPT ); Mon, 26 Oct 2020 13:50:52 -0400 IronPort-SDR: SjydEuHEnF4i4WC5d15XMN//ZCz1hNZgVZ1EgtvJLqBmdVbS6eZfKIG+UTmNXW1sTX+ImzLLVy GBHMN/8zysbg== X-IronPort-AV: E=McAfee;i="6000,8403,9786"; a="168087670" X-IronPort-AV: E=Sophos;i="5.77,420,1596524400"; d="scan'208";a="168087670" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 10:50:51 -0700 IronPort-SDR: x+1d3ogF+kdLIrWccz/Z91OFRbfQxgN6zBdB5T+zyvuQviQbaMCUX8vVblUCUcA0HdSywi3QD2 FxpxjaoouOtQ== X-IronPort-AV: E=Sophos;i="5.77,420,1596524400"; d="scan'208";a="535450069" Received: from abudanko-mobl.ccr.corp.intel.com (HELO [10.249.226.224]) ([10.249.226.224]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 10:50:49 -0700 Subject: Re: [PATCH v2 04/15] perf session: move reader object definition to header file To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Adrian Hunter , Andi Kleen , Peter Zijlstra , Ingo Molnar , linux-kernel References: <1ec29ed6-0047-d22f-630b-a7f5ccee96b4@linux.intel.com> <635d39aa-5ce8-2c0b-9b12-952b95ed22da@linux.intel.com> <20201024154447.GJ2589351@krava> From: Alexey Budankov Organization: Intel Corp. Message-ID: Date: Mon, 26 Oct 2020 20:50:47 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201024154447.GJ2589351@krava> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.10.2020 18:44, Jiri Olsa wrote: > On Wed, Oct 21, 2020 at 06:59:48PM +0300, Alexey Budankov wrote: >> >> Move definition of reader to session header file to be shared >> among different source files. Introduce reference to active >> reader object from session object. >> >> Signed-off-by: Alexey Budankov >> --- >> tools/perf/util/session.c | 27 --------------------------- >> tools/perf/util/session.h | 25 +++++++++++++++++++++++++ >> 2 files changed, 25 insertions(+), 27 deletions(-) >> >> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c >> index 6f09d506b2f6..911b2dbcd0ac 100644 >> --- a/tools/perf/util/session.c >> +++ b/tools/perf/util/session.c >> @@ -2110,33 +2110,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) >> diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h >> index 378ffc3e2809..abdb8518a81f 100644 >> --- a/tools/perf/util/session.h >> +++ b/tools/perf/util/session.h >> @@ -20,6 +20,30 @@ struct thread; >> struct auxtrace; >> struct itrace_synth_opts; >> >> +/* >> + * 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 >> + >> +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; >> +}; > > I wasn't able to find where is this used ouf of session.c ? I will double check and adjust appropriately. > > >> + >> struct perf_session { >> struct perf_header header; >> struct machines machines; >> @@ -41,6 +65,7 @@ struct perf_session { >> struct zstd_data zstd_data; >> struct decomp *decomp; >> struct decomp *decomp_last; >> + struct reader *reader; > > please define it in the patch where it's actualy used Corrected in v3. Alexei > > thanks, > jirka >