perf header: Add is_perf_magic() func
authorFeng Tang <feng.tang@intel.com>
Tue, 30 Oct 2012 03:56:07 +0000 (11:56 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 29 Oct 2012 13:56:59 +0000 (11:56 -0200)
commite84ba4e26833991d1c1c15a592b1474ee2b6dfdb
treea73d2b23c722ac3c1bbf08c075d124ccbe510ec7
parentcdbab7c201ab38f7b8d248ebf289025381166526
perf header: Add is_perf_magic() func

With this function, other modules can basically check whether a file is
a legal perf data file by checking its first 8 bytes against all
possible perf magic numbers.

Change the function name from check_perf_magic to more meaningful
is_perf_magic as suggested by acme.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1351569369-26732-7-git-send-email-feng.tang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/header.c
tools/perf/util/header.h