diff options
author | Jiri Olsa <jolsa@kernel.org> | 2014-05-07 18:51:41 +0200 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-06-12 16:53:21 +0200 |
commit | c3fbd2a606c5f88de0079b027727a1fb0ae27b65 (patch) | |
tree | f3704df2485b4250ac7df3027edf7a665ef68cb1 /tools/perf/util/dso.h | |
parent | perf tools: Cache dso data file descriptor (diff) | |
download | linux-c3fbd2a606c5f88de0079b027727a1fb0ae27b65.tar.xz linux-c3fbd2a606c5f88de0079b027727a1fb0ae27b65.zip |
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>
Diffstat (limited to 'tools/perf/util/dso.h')
-rw-r--r-- | tools/perf/util/dso.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index 90988bf06641..da47b13595f3 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h @@ -103,6 +103,7 @@ struct dso { struct { struct rb_root cache; int fd; + size_t file_size; struct list_head open_entry; } data; |