diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-02-21 10:41:29 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-02-22 20:52:07 +0100 |
commit | 45112e89a8b2b4c9a004147cbfb448b1200cfbf7 (patch) | |
tree | 83d9692d8c35b5bfb79857affb49b0e428d285fa /tools/perf/util | |
parent | perf, pt, coresight: Fix address filters for vmas with non-zero offset (diff) | |
download | linux-45112e89a8b2b4c9a004147cbfb448b1200cfbf7.tar.xz linux-45112e89a8b2b4c9a004147cbfb448b1200cfbf7.zip |
perf data: Move size to struct perf_data_file
We are about to add support for multiple files, so we need each file to
keep its size.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20190221094145.9151-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/data.c | 2 | ||||
-rw-r--r-- | tools/perf/util/data.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index d8cfc19ddb10..09eceda17fc2 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c @@ -82,7 +82,7 @@ static int open_file_read(struct perf_data *data) goto out_close; } - data->size = st.st_size; + data->file.size = st.st_size; return fd; out_close: diff --git a/tools/perf/util/data.h b/tools/perf/util/data.h index 4828f7feea89..85f9c0dbf982 100644 --- a/tools/perf/util/data.h +++ b/tools/perf/util/data.h @@ -12,13 +12,13 @@ enum perf_data_mode { struct perf_data_file { const char *path; int fd; + unsigned long size; }; struct perf_data { struct perf_data_file file; bool is_pipe; bool force; - unsigned long size; enum perf_data_mode mode; }; @@ -44,7 +44,7 @@ static inline int perf_data__fd(struct perf_data *data) static inline unsigned long perf_data__size(struct perf_data *data) { - return data->size; + return data->file.size; } int perf_data__open(struct perf_data *data); |