Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4829129pxu; Wed, 21 Oct 2020 06:28:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw778KISvqlmd34u597QFC+R+Zopcz/SnGFt+hLRYPDL9F2W0ELud850EL7THkeVLOmFNyp X-Received: by 2002:a17:906:3290:: with SMTP id 16mr3448194ejw.308.1603286892293; Wed, 21 Oct 2020 06:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603286892; cv=none; d=google.com; s=arc-20160816; b=XsAXjAYBy6HywJ718mgiZ+jcai5vH+XrmphW6BDAqlDXMKFG1mKLtcpq71ZgQSVgLk jGMskPxeGbrGFa3okp6JssWIPXaqnJJet7uTd+WdZdWDB+eGc6g/gzGR+VrAemPHF3Oo tlDAj5d3kzTge2IHhemAZN9lBxmOEKlLedhJAdXt3PiPXIv1xzZVq/Vf30UgDuRmBCZj 9QHvaMwsdeGZol3mI9FW1/f3iWHs/e/Q3gF8MD/y+WxmY88caTxUYxeaykAXaFgy2L9G Ww4otsVSqTVWvw31uXnHumws4vhM29eqW91wtb6zZSLe+JK9+mOos/syw4+Pde3gW929 FY2Q== 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=mQJP95S454Ja63JQeJJZddDjmGgzblM/HWZLaYKCbag=; b=M7kBMEMY2hEttAPdrRuhEtz3nzwG+q7nzf1jwEq3ODXz1MFOC+n9hTKpbeC7cS/e38 W87hLupvwwp5wj7IRhuXQ8xslvHNrwgO8D7P4H10PPJqW5RKonEWMBgqXBvdtSiudBCN DKrx7p5NCn+59BwFeUz6GbuR7zqFT6xITSERKqSJ6cdWYjvldHLavx+jithvkPCuNRPL +CxqyF9VOhws8DYiMrITNCETKuYvlx9OMcBA/0ZZxN91dNbaPz0CVHY3sgsp7Y1Ypt6t Q2uYLAHbrerlqmAFXoSAevwnNKNwAA9zptE0IbnEje9wmu/CkLLpFVE45DCXpk1AC+XB C78A== 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 dd24si1272874ejb.523.2020.10.21.06.27.49; Wed, 21 Oct 2020 06:28:12 -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 S2441693AbgJUKZO (ORCPT + 99 others); Wed, 21 Oct 2020 06:25:14 -0400 Received: from mga03.intel.com ([134.134.136.65]:55077 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441689AbgJUKZN (ORCPT ); Wed, 21 Oct 2020 06:25:13 -0400 IronPort-SDR: 2KChMacfzRI3uu4hdmtTFDQbmqcU8jadCMTrB3O/V9Ur8C6wLUDYI9vEbughnlumyivvnSJVhq sEkHgRuN05LA== X-IronPort-AV: E=McAfee;i="6000,8403,9780"; a="167435187" X-IronPort-AV: E=Sophos;i="5.77,401,1596524400"; d="scan'208";a="167435187" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2020 03:25:12 -0700 IronPort-SDR: Bg4FumSZkt8UV0vchNybvzf1+oornW9L+O2A9LIOpSuyxl+35/EIpgWnB9CJfyw05qRaSzJARb E2BtcM1H5M7w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,401,1596524400"; d="scan'208";a="422774675" Received: from linux.intel.com ([10.54.29.200]) by fmsmga001.fm.intel.com with ESMTP; 21 Oct 2020 03:25:12 -0700 Received: from [10.249.225.226] (abudanko-mobl.ccr.corp.intel.com [10.249.225.226]) by linux.intel.com (Postfix) with ESMTP id B6111580720; Wed, 21 Oct 2020 03:25:09 -0700 (PDT) Subject: Re: [PATCH v1 06/15] perf session: load data directory into tool process memory To: Namhyung Kim Cc: Andi Kleen , Arnaldo Carvalho de Melo , Jiri Olsa , Alexander Shishkin , Adrian Hunter , Peter Zijlstra , Ingo Molnar , linux-kernel References: <810f3a69-0004-9dff-a911-b7ff97220ae0@linux.intel.com> <39cf6164-f3be-ae34-292a-94faef32fdb9@linux.intel.com> <20201012160921.GD466880@tassilo.jf.intel.com> <8f90c785-8bdc-e7cd-a6d9-7eed0fb2c6b3@linux.intel.com> <7216a411-a635-4fcc-b10d-afe1f75509d3@linux.intel.com> From: Alexey Budankov Organization: Intel Corp. Message-ID: <351d6f3a-7c2a-85d7-4b07-4b0468e6c887@linux.intel.com> Date: Wed, 21 Oct 2020 13:25:08 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: 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 21.10.2020 9:54, Namhyung Kim wrote: > Hi, > > On Tue, Oct 13, 2020 at 8:30 PM Alexey Budankov > wrote: >> On 12.10.2020 19:49, Alexey Budankov wrote: >>> On 12.10.2020 19:09, Andi Kleen wrote: >>>> On Mon, Oct 12, 2020 at 11:58:58AM +0300, Alexey Budankov wrote: >>>>> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c >>>>> index 6afc670fdf0c..0752eec19813 100644 >>>>> --- a/tools/perf/util/session.c >>>>> +++ b/tools/perf/util/session.c >>>>> @@ -2212,6 +2212,17 @@ reader__process_events(struct reader *rd, struct perf_session *session, >>>>> goto more; >>>>> >>>>> out: >>>>> + if (rd->unmap_file) { >>>>> + int i; >>>>> + >>>>> + for (i = 0; i < NUM_MMAPS; i++) { >>>>> + if (mmaps[i]) { >>>>> + munmap(mmaps[i], mmap_size); >>>>> + mmaps[i] = NULL; >>>> >>>> Okay so where is the mmap? Would make more sense to put that >>>> into the same patch as who adds the mmap. Or is the mmap >>>> code already in the perf source? In that case it should >>>> probably be some common helper with the existing users. >>> >>> That mmap is already in the code. Agree, this part of the patch >>> can be applied prior the whole patch set. >> >> I take it back. Single trace file can't be unmapped yet since it also >> contains not only compressed records but also other records backing >> the data for aggregated analysis. > > Are you talking about the auxtrace? > > I thought everything will be compressed when it's enabled. > But if it's only for the auxtrace, maybe we can unmap them > with checking it as it's not the common case? I am about primary trace file. Together with PERF_RECORD_COMPRESSED records it contains the other records with uncompressed data (MMAP, FORk, COMM etc.) so it is still unsafe to unmap the trace file after loading. Alexei