From 92973b018403016f022dbe6d50b35b9ef5be90af Mon Sep 17 00:00:00 2001 From: Feng Tang Date: Tue, 30 Oct 2012 11:56:07 +0800 Subject: [PATCH] --- yaml --- r: 338924 b: refs/heads/master c: e84ba4e26833991d1c1c15a592b1474ee2b6dfdb h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/util/header.c | 10 ++++++++++ trunk/tools/perf/util/header.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0982029abb86..999d5d0096ea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cdbab7c201ab38f7b8d248ebf289025381166526 +refs/heads/master: e84ba4e26833991d1c1c15a592b1474ee2b6dfdb diff --git a/trunk/tools/perf/util/header.c b/trunk/tools/perf/util/header.c index 514ed1bd41a2..195a47a8f052 100644 --- a/trunk/tools/perf/util/header.c +++ b/trunk/tools/perf/util/header.c @@ -2341,6 +2341,16 @@ static int try_all_pipe_abis(uint64_t hdr_sz, struct perf_header *ph) return -1; } +bool is_perf_magic(u64 magic) +{ + if (!memcmp(&magic, __perf_magic1, sizeof(magic)) + || magic == __perf_magic2 + || magic == __perf_magic2_sw) + return true; + + return false; +} + static int check_magic_endian(u64 magic, uint64_t hdr_sz, bool is_pipe, struct perf_header *ph) { diff --git a/trunk/tools/perf/util/header.h b/trunk/tools/perf/util/header.h index 879d215cdac9..5f1cd6884f37 100644 --- a/trunk/tools/perf/util/header.h +++ b/trunk/tools/perf/util/header.h @@ -154,6 +154,7 @@ int perf_event__synthesize_build_id(struct perf_tool *tool, int perf_event__process_build_id(struct perf_tool *tool, union perf_event *event, struct perf_session *session); +bool is_perf_magic(u64 magic); /* * arch specific callback