All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Petr Malat <oss@malat.biz>
Cc: linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Alexey Budankov <alexey.budankov@linux.intel.com>
Subject: Re: [PATCH v2 1/3] Revert "perf session: Fix decompression of PERF_RECORD_COMPRESSED records"
Date: Tue, 1 Dec 2020 20:09:28 +0100	[thread overview]
Message-ID: <20201201190928.GB3169083@krava> (raw)
In-Reply-To: <20201130114020.GA29476@ntb.petris.klfree.czf>

On Mon, Nov 30, 2020 at 12:40:20PM +0100, Petr Malat wrote:
> Hi Jiří,
> were you able to reproduce the issue? I may also upload perf-archive
> if that would help.

oh yea ;-) seems like those 2 commits you reverted broke 32 bits
perf for data files > 32MB

but the fix you did does not work for Alexey's test he mentioned
in the commit:

      $ perf record -z -- some_long_running_workload
      $ perf report --stdio -vv

it's failing for me with:

	# ./perf report
	Couldn't allocate memory for decompression
	0xfe6f3a [0x60]: failed to process type: 81 [Operation not permitted]
	Error:
	failed to process sample
	# To display the perf.data header info, please use --header/--header-only options.
	#

I think that's why here's special handling for compressed
events, but I'll need to check on that in more detail,
I was hoping for Alexey to answer ;-)

jirka

>   Petr
> 
> On Tue, Nov 24, 2020 at 07:15:19PM +0100, Petr Malat wrote:
> > Hi!
> > On Tue, Nov 24, 2020 at 03:36:45PM +0100, Jiri Olsa wrote:
> > > On Tue, Nov 24, 2020 at 11:29:15AM +0100, Petr Malat wrote:
> > > > Both mmapped and compressed events can be split by the buffer boundary,
> > > > it doesn't make sense to handle them differently.
> > > I'm going to need more than this, if there's a problem
> > > with current code please share more details, what's
> > > broken and how it shows
> > It's easy to trigger the problem - make a perf recording larger than
> > MMAP_SIZE (32MB on 32-bit platform) and run perf report on it. There
> > is a small chance recorded events will be aligned on the 32 MB
> > boundary and in that case just repeat the test.
> > 
> > The problem was introduced by "perf session: Avoid infinite loop when
> > seeing invalid header.size", which instead of aborting the execution
> > when there is a truncated event at the end of the file just terminated
> > execution whenever there is a split event. Later then the problem has
> > been noticed for compressed events and fixed by "perf session: Fix
> > decompression of PERF_RECORD_COMPRESSED records" by effectively
> > reverting "perf session: Avoid infinite loop when seeing invalid
> > header.size" for compressed events, which left uncompressed events
> > broken.
> > 
> > I think the best is to revert these 2 changes and fix the original
> > problem by aborting when there is no actual shift during remapping - as
> > long as we shift, it's clear we must approach the end of the file so
> > such an algorithm can't loop forever.
> > BR,
> >   Petr
> 


  reply	other threads:[~2020-12-01 19:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24  9:59 [PATCH 1/3] Revert "perf session: Fix decompression of PERF_RECORD_COMPRESSED records" Petr Malat
2020-11-24  9:59 ` [PATCH 2/3] Revert "perf session: Avoid infinite loop when seeing invalid header.size" Petr Malat
2020-11-24  9:59 ` [PATCH 3/3] perf session: Avoid infinite loop if an event is truncated Petr Malat
2020-11-24 10:21   ` Petr Malat
2020-11-24 10:29 ` [PATCH v2 1/3] Revert "perf session: Fix decompression of PERF_RECORD_COMPRESSED records" Petr Malat
2020-11-24 10:29   ` [PATCH v2 2/3] Revert "perf session: Avoid infinite loop when seeing invalid header.size" Petr Malat
2020-11-24 10:29   ` [PATCH v2 3/3] perf session: Avoid infinite loop if an event is truncated Petr Malat
2020-11-24 14:36   ` [PATCH v2 1/3] Revert "perf session: Fix decompression of PERF_RECORD_COMPRESSED records" Jiri Olsa
2020-11-24 18:15     ` Petr Malat
2020-11-30 11:40       ` Petr Malat
2020-12-01 19:09         ` Jiri Olsa [this message]
2020-12-01 21:04           ` Alexei Budankov
2020-12-01 21:28             ` Alexei Budankov
2020-12-02 14:04               ` Bayduraev, Alexey V
2020-12-02 14:18                 ` Alexei Budankov

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=20201201190928.GB3169083@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexey.budankov@linux.intel.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=oss@malat.biz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.