aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/header.c10
-rw-r--r--tools/perf/util/header.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 514ed1bd41a2..195a47a8f052 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2341,6 +2341,16 @@ static int try_all_pipe_abis(uint64_t hdr_sz, struct perf_header *ph)
2341 return -1; 2341 return -1;
2342} 2342}
2343 2343
2344bool is_perf_magic(u64 magic)
2345{
2346 if (!memcmp(&magic, __perf_magic1, sizeof(magic))
2347 || magic == __perf_magic2
2348 || magic == __perf_magic2_sw)
2349 return true;
2350
2351 return false;
2352}
2353
2344static int check_magic_endian(u64 magic, uint64_t hdr_sz, 2354static int check_magic_endian(u64 magic, uint64_t hdr_sz,
2345 bool is_pipe, struct perf_header *ph) 2355 bool is_pipe, struct perf_header *ph)
2346{ 2356{
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 879d215cdac9..5f1cd6884f37 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -154,6 +154,7 @@ int perf_event__synthesize_build_id(struct perf_tool *tool,
154int perf_event__process_build_id(struct perf_tool *tool, 154int perf_event__process_build_id(struct perf_tool *tool,
155 union perf_event *event, 155 union perf_event *event,
156 struct perf_session *session); 156 struct perf_session *session);
157bool is_perf_magic(u64 magic);
157 158
158/* 159/*
159 * arch specific callback 160 * arch specific callback