From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762873AbbA3SdY (ORCPT ); Fri, 30 Jan 2015 13:33:24 -0500 Received: from terminus.zytor.com ([198.137.202.10]:35818 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759768AbbA3SdX (ORCPT ); Fri, 30 Jan 2015 13:33:23 -0500 Date: Fri, 30 Jan 2015 10:33:01 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: dsahern@gmail.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, a.p.zijlstra@chello.nl, acme@redhat.com, mingo@kernel.org, eranian@google.com, fweisbec@gmail.com, andi@firstfloor.org, adrian.hunter@intel.com, jolsa@redhat.com, hpa@zytor.com, tglx@linutronix.de Reply-To: acme@redhat.com, namhyung@kernel.org, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org, dsahern@gmail.com, hpa@zytor.com, tglx@linutronix.de, jolsa@redhat.com, adrian.hunter@intel.com, eranian@google.com, andi@firstfloor.org, fweisbec@gmail.com, mingo@kernel.org In-Reply-To: <1422518843-25818-5-git-send-email-namhyung@kernel.org> References: <1422518843-25818-5-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf header: Set header version correctly Git-Commit-ID: f7913971bdad1a72c6158074786babed477d61e2 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f7913971bdad1a72c6158074786babed477d61e2 Gitweb: http://git.kernel.org/tip/f7913971bdad1a72c6158074786babed477d61e2 Author: Namhyung Kim AuthorDate: Thu, 29 Jan 2015 17:06:45 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 29 Jan 2015 16:53:11 -0300 perf header: Set header version correctly When check_magic_endian() is called, it checks the magic number in the perf data file to determine version and endianness. But if it uses a same endian the verison number wasn't updated and makes confusion. Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1422518843-25818-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/header.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index b20e40c..1f407f7 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2237,6 +2237,7 @@ static int check_magic_endian(u64 magic, uint64_t hdr_sz, * - unique number to identify actual perf.data files * - encode endianness of file */ + ph->version = PERF_HEADER_VERSION_2; /* check magic number with one endianness */ if (magic == __perf_magic2) @@ -2247,7 +2248,6 @@ static int check_magic_endian(u64 magic, uint64_t hdr_sz, return -1; ph->needs_swap = true; - ph->version = PERF_HEADER_VERSION_2; return 0; }