From: Ingo Molnar <mingo@elte.hu>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] perf tools: Provide backward compatibility with previous perf.data version
Date: Mon, 12 Oct 2009 11:10:28 +0200 [thread overview]
Message-ID: <20091012091028.GB24031@elte.hu> (raw)
In-Reply-To: <20091008202226.GE5073@nowhere>
* Frederic Weisbecker <fweisbec@gmail.com> wrote:
> On Thu, Oct 08, 2009 at 10:07:29PM +0200, Frederic Weisbecker wrote:
> > We have merged the trace.info file into perf.data by adding one section
> > in the perf headers. This makes it incompatible with previous version:
> > the new perf tools can't read the older perf.data.
> >
> > To support the previous format, we check the headers size. If they
> > have the same size than in the previous format, then ignore the trace
> > info section that doesn't exist.
> >
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> > Cc: Mike Galbraith <efault@gmx.de>
> > Cc: Paul Mackerras <paulus@samba.org>
> > ---
> > tools/perf/util/header.c | 8 +++++++-
> > 1 files changed, 7 insertions(+), 1 deletions(-)
> >
> > diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> > index 212fade..9aae360 100644
> > --- a/tools/perf/util/header.c
> > +++ b/tools/perf/util/header.c
> > @@ -287,10 +287,16 @@ struct perf_header *perf_header__read(int fd)
> > do_read(fd, &f_header, sizeof(f_header));
> >
> > if (f_header.magic != PERF_MAGIC ||
> > - f_header.size != sizeof(f_header) ||
>
>
>
> Few notes about this.
> I can send a separate fix for .32 that would just consist in the above line,
> or more likely I can replace it by:
>
> f_header.size < sizeof(f_header) ||
>
> and then we'll get a minimal forward compatibility from the older
> tools (can be Cc'ed to stable for .31).
Yep, would be nice.
> Another thing. We may feel the need to add yet another sections in the
> future.
>
> So just a suggestion: we could turn this trace_info section into a
> more generic one in which we could add as much subsections as we want
> in the future while always ensuring backward compatibility. That could
> be managed through a versioning of this generic section.
Definitely! (Since it's not upstream yet we can do it without supporting
the interim version.)
Ingo
prev parent reply other threads:[~2009-10-12 9:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-08 20:07 Frederic Weisbecker
2009-10-08 20:12 ` Ingo Molnar
2009-10-08 20:28 ` Frederic Weisbecker
2009-10-08 20:31 ` Ingo Molnar
2009-10-08 20:16 ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-10-08 20:22 ` [PATCH] " Frederic Weisbecker
2009-10-12 9:10 ` Ingo Molnar [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=20091012091028.GB24031@elte.hu \
--to=mingo@elte.hu \
--cc=acme@redhat.com \
--cc=efault@gmx.de \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.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
all inboxes | Powered by JetHome®