Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755219AbbDJI1i (ORCPT ); Fri, 10 Apr 2015 04:27:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49227 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754937AbbDJI1c (ORCPT ); Fri, 10 Apr 2015 04:27:32 -0400 Date: Fri, 10 Apr 2015 10:27:26 +0200 From: Jiri Olsa To: David Ahern Cc: acme@kernel.org, linux-kernel@vger.kernel.org, Jiri Olsa , Namhyung Kim Subject: Re: [PATCH] perf tool: Fix cross-endian analysis Message-ID: <20150410082726.GA27593@krava> References: <1428610546-178789-1-git-send-email-david.ahern@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428610546-178789-1-git-send-email-david.ahern@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1492 Lines: 42 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 > Cc: Jiri Olsa > Cc: Namhyung Kim > --- > 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 thanks, jirka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/