linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Budankov <alexey.budankov@linux.intel.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Andi Kleen <ak@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] perf session: fix decompression of PERF_RECORD_COMPRESSED records
Date: Mon, 18 Nov 2019 17:20:31 +0300	[thread overview]
Message-ID: <924f076a-190f-330f-50e0-f06f35e2ee75@linux.intel.com> (raw)
In-Reply-To: <20191118122214.GB14046@krava>

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

      reply	other threads:[~2019-11-18 14:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 11:30 [PATCH v2] perf session: fix decompression of PERF_RECORD_COMPRESSED records Alexey Budankov
2019-11-18 12:22 ` Jiri Olsa
2019-11-18 14:20   ` Alexey Budankov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=924f076a-190f-330f-50e0-f06f35e2ee75@linux.intel.com \
    --to=alexey.budankov@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).