[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <924f076a-190f-330f-50e0-f06f35e2ee75@linux.intel.com>
Date: Mon, 18 Nov 2019 17:20:31 +0300
From: Alexey Budankov <alexey.budankov@...ux.intel.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Andi Kleen <ak@...ux.intel.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] perf session: fix decompression of
PERF_RECORD_COMPRESSED records
On 18.11.2019 15:22, Jiri Olsa wrote:
> On Mon, Nov 18, 2019 at 02:30:04PM +0300, Alexey Budankov wrote:
<SNIP>
>>
>> @@ -1971,20 +1971,32 @@ fetch_mmaped_event(struct perf_session *session,
>> return NULL;
>>
>> event = (union perf_event *)(buf + head);
>> + if (needs_swap)
>> + perf_event_header__bswap(&event->header);
>>
>> - if (session->header.needs_swap)
>> + if (head + event->header.size <= mmap_size)
>> + return event;
>> +
>> + /* We're not fetching the event so swap back again */
>> + if (needs_swap)
>> perf_event_header__bswap(&event->header);
>>
>> - if (head + event->header.size > mmap_size) {
>> - /* We're not fetching the event so swap back again */
>> - if (session->header.needs_swap)
>> - perf_event_header__bswap(&event->header);
>> - pr_debug("%s: head=%#" PRIx64 " event->header_size=%#x, mmap_size=%#zx: fuzzed perf.data?\n",
>> - __func__, head, event->header.size, mmap_size);
>> - return ERR_PTR(-EINVAL);
>> - }
>> + pr_debug("%s: head=%#" PRIx64 " event->header_size=%#x, mmap_size=%#zx\n",
>> + __func__, head, event->header.size, mmap_size);
>
> you're missign the 'fuzzed perf.data?' in here
>
> I think we should keep it just change to: 'fuzzed or compressed perf.data?'
Fixed in v3.
>
> thanks,
> jirka
~Alexey
Powered by blists - more mailing lists