aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-07-17 19:49:47 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-07-17 17:04:00 -0300
commit2a08c3ec4f7d6058a450d2d4bc6e366955872707 (patch)
treeffcd2c8c95e67260993ab8b7f4e96419adc7bcf8 /tools/perf/util/header.c
parentperf header: Introduce feat_offset into perf_header (diff)
downloadwireguard-linux-2a08c3ec4f7d6058a450d2d4bc6e366955872707.tar.xz
wireguard-linux-2a08c3ec4f7d6058a450d2d4bc6e366955872707.zip
perf header: Recognize version number for perf data file
Keep the recognized data file version within 'struct perf_header'. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1374083403-14591-8-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index eefb052190f3..f558f83769af 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2480,6 +2480,7 @@ static int check_magic_endian(u64 magic, uint64_t hdr_sz,
/* check for legacy format */
ret = memcmp(&magic, __perf_magic1, sizeof(magic));
if (ret == 0) {
+ ph->version = PERF_HEADER_VERSION_1;
pr_debug("legacy perf.data format\n");
if (is_pipe)
return try_all_pipe_abis(hdr_sz, ph);
@@ -2501,6 +2502,7 @@ 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;
}