[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <351d6f3a-7c2a-85d7-4b07-4b0468e6c887@linux.intel.com>
Date: Wed, 21 Oct 2020 13:25:08 +0300
From: Alexey Budankov <alexey.budankov@...ux.intel.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Andi Kleen <ak@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 06/15] perf session: load data directory into tool
process memory
On 21.10.2020 9:54, Namhyung Kim wrote:
> Hi,
>
> On Tue, Oct 13, 2020 at 8:30 PM Alexey Budankov
> <alexey.budankov@...ux.intel.com> 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
Powered by blists - more mailing lists