perf tools: Add file size check and factor dso__data_read_offset
authorJiri Olsa <jolsa@kernel.org>
Wed, 7 May 2014 16:51:41 +0000 (18:51 +0200)
committerJiri Olsa <jolsa@kernel.org>
Thu, 12 Jun 2014 14:53:21 +0000 (16:53 +0200)
commitc3fbd2a606c5f88de0079b027727a1fb0ae27b65
treef3704df2485b4250ac7df3027edf7a665ef68cb1
parentc658045197814b7d762662f9aa9f652379121a03
perf tools: Add file size check and factor dso__data_read_offset

Adding file size check, because the lseek will succeed for
any offset behind file size and thus succeed when it was
expected to fail.

Factoring the code to check the offset against file size
earlier in the flow.

Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
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/1401892622-30848-8-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
tools/perf/util/dso.c
tools/perf/util/dso.h