From: Jiri Olsa <jolsa@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH 1/5] perf session: Get rid of file_size variable
Date: Thu, 27 Dec 2018 09:11:06 +0100 [thread overview]
Message-ID: <20181227081106.GA3033@krava> (raw)
In-Reply-To: <20181226194342.GA19471@kernel.org>
On Wed, Dec 26, 2018 at 04:43:42PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Dec 26, 2018 at 02:51:28PM +0100, Jiri Olsa escreveu:
> > It's not needed and removing it makes the code little
> > more simple for upcoming changes.
> >
> > It's safe to replace file_size with data_size, because
> > perf_data__size value is never smaller than data_offset
> > + data_size.
>
> This is not applying to my perf/core branch, can you check?
hum, I've got clean rebase, pushed in perf/fixes
jirka
>
> - Arnaldo
>
> > Link: http://lkml.kernel.org/n/tip-ocz7zwwkkx11v0mkxrtcddih@git.kernel.org
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> > tools/perf/util/session.c | 12 +++++-------
> > 1 file changed, 5 insertions(+), 7 deletions(-)
> >
> > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> > index 3972f081a8f4..d6c1d3853f27 100644
> > --- a/tools/perf/util/session.c
> > +++ b/tools/perf/util/session.c
> > @@ -1818,7 +1818,6 @@ static int __perf_session__process_events(struct perf_session *session)
> > struct ordered_events *oe = &session->ordered_events;
> > struct perf_tool *tool = session->tool;
> > int fd = perf_data__fd(session->data);
> > - u64 file_size = perf_data__size(session->data);
> > u64 data_offset = session->header.data_offset;
> > u64 data_size = session->header.data_size;
> > u64 head, page_offset, file_offset, file_pos, size;
> > @@ -1838,14 +1837,13 @@ static int __perf_session__process_events(struct perf_session *session)
> > if (data_size == 0)
> > goto out;
> >
> > - if (data_offset + data_size < file_size)
> > - file_size = data_offset + data_size;
> > + ui_progress__init_size(&prog, data_size, "Processing events...");
> >
> > - ui_progress__init_size(&prog, file_size, "Processing events...");
> > + data_size += data_offset;
> >
> > mmap_size = MMAP_SIZE;
> > - if (mmap_size > file_size) {
> > - mmap_size = file_size;
> > + if (mmap_size > data_size) {
> > + mmap_size = data_size;
> > session->one_mmap = true;
> > }
> >
> > @@ -1910,7 +1908,7 @@ static int __perf_session__process_events(struct perf_session *session)
> > if (session_done())
> > goto out;
> >
> > - if (file_pos < file_size)
> > + if (file_pos < data_size)
> > goto more;
> >
> > out:
> > --
> > 2.17.2
>
> --
>
> - Arnaldo
next prev parent reply other threads:[~2018-12-27 8:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-26 13:51 [PATCH 0/5] perf session: Add reader object Jiri Olsa
2018-12-26 13:51 ` [PATCH 1/5] perf session: Get rid of file_size variable Jiri Olsa
2018-12-26 19:43 ` Arnaldo Carvalho de Melo
2018-12-27 8:11 ` Jiri Olsa [this message]
2018-12-26 13:51 ` [PATCH 2/5] perf session: Add reader object Jiri Olsa
2018-12-26 13:51 ` [PATCH 3/5] perf session: Add data_size to " Jiri Olsa
2018-12-26 13:51 ` [PATCH 4/5] perf session: Add data_offset " Jiri Olsa
2018-12-26 13:51 ` [PATCH 5/5] perf session: Add reader__process_events function Jiri Olsa
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=20181227081106.GA3033@krava \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.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.