diff options
author | Jiri Olsa <jolsa@redhat.com> | 2013-07-17 13:49:47 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-07-17 16:04:00 -0400 |
commit | 2a08c3ec4f7d6058a450d2d4bc6e366955872707 (patch) | |
tree | ffcd2c8c95e67260993ab8b7f4e96419adc7bcf8 /tools/perf/util/header.c | |
parent | 8d541e974f4b3ed5db7e278b4d64481af34910a9 (diff) |
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.c | 2 |
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, | |||
2480 | /* check for legacy format */ | 2480 | /* check for legacy format */ |
2481 | ret = memcmp(&magic, __perf_magic1, sizeof(magic)); | 2481 | ret = memcmp(&magic, __perf_magic1, sizeof(magic)); |
2482 | if (ret == 0) { | 2482 | if (ret == 0) { |
2483 | ph->version = PERF_HEADER_VERSION_1; | ||
2483 | pr_debug("legacy perf.data format\n"); | 2484 | pr_debug("legacy perf.data format\n"); |
2484 | if (is_pipe) | 2485 | if (is_pipe) |
2485 | return try_all_pipe_abis(hdr_sz, ph); | 2486 | return try_all_pipe_abis(hdr_sz, ph); |
@@ -2501,6 +2502,7 @@ static int check_magic_endian(u64 magic, uint64_t hdr_sz, | |||
2501 | return -1; | 2502 | return -1; |
2502 | 2503 | ||
2503 | ph->needs_swap = true; | 2504 | ph->needs_swap = true; |
2505 | ph->version = PERF_HEADER_VERSION_2; | ||
2504 | 2506 | ||
2505 | return 0; | 2507 | return 0; |
2506 | } | 2508 | } |