All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: David Ahern <david.ahern@oracle.com>,
	linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH] perf tool: Fix cross-endian analysis
Date: Fri, 10 Apr 2015 09:49:29 -0300	[thread overview]
Message-ID: <20150410124929.GC4521@kernel.org> (raw)
In-Reply-To: <20150410082726.GA27593@krava>

Em Fri, Apr 10, 2015 at 10:27:26AM +0200, Jiri Olsa escreveu:
> On Thu, Apr 09, 2015 at 04:15:46PM -0400, David Ahern wrote:
> > Trying to analyze a big endian data file on little endian system
> > fails with the error:
> >   0xa9b40 [0x70]: failed to process type: 9
> > 
> > The problem is that header parsing is not done correctly because
> > the file attributes are not swapped. Make it so. With this patch
> > able to analyze a sparc64 data file on x86_64.
> > 
> > Signed-off-by: David Ahern <david.ahern@oracle.com>
> > Cc: Jiri Olsa <jolsa@kernel.org>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > ---
> >  tools/perf/util/header.c |    5 ++++-
> >  1 files changed, 4 insertions(+), 1 deletions(-)
> > 
> > diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> > index e38cf62..45b7e72 100644
> > --- a/tools/perf/util/header.c
> > +++ b/tools/perf/util/header.c
> > @@ -2586,8 +2586,11 @@ int perf_session__read_header(struct perf_session *session)
> >  		if (read_attr(fd, header, &f_attr) < 0)
> >  			goto out_errno;
> >  
> > -		if (header->needs_swap)
> > +		if (header->needs_swap) {
> > +			f_attr.ids.size   = bswap_64(f_attr.ids.size);
> > +			f_attr.ids.offset = bswap_64(f_attr.ids.offset);
> >  			perf_event__attr_swap(&f_attr.attr);
> > +		}
> 
> so people do actually use it ;-)
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>

Thanks, applied.

- Arnaldo

  reply	other threads:[~2015-04-10 12:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 20:15 [PATCH] perf tool: Fix cross-endian analysis David Ahern
2015-04-10  8:27 ` Jiri Olsa
2015-04-10 12:49   ` Arnaldo Carvalho de Melo [this message]
2015-04-10 13:52   ` David Ahern
2015-04-11  6:37 ` [tip:perf/core] perf tools: " tip-bot for David Ahern

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=20150410124929.GC4521@kernel.org \
    --to=acme@kernel.org \
    --cc=david.ahern@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.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.