diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-02-21 10:41:30 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-02-22 16:52:07 -0300 |
commit | 2d4f27999b8877409f326682fd8cc40c52f47cea (patch) | |
tree | 33c3e619718d0c75bee39957f6ca4ed70ac59c0d /tools/perf/util/data.h | |
parent | 45112e89a8b2b4c9a004147cbfb448b1200cfbf7 (diff) |
perf data: Add global path holder
Add a 'path' member to 'struct perf_data'. It will keep the configured
path for the data (const char *). The path in struct perf_data_file is
now dynamically allocated (duped) from it.
This scheme is useful/used in following patches where struct
perf_data::path holds the 'configure' directory path and struct
perf_data_file::path holds the allocated path for specific files.
Also it actually makes the code little simpler.
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-3-jolsa@kernel.org
[ Fixup data-convert-bt.c missing conversion ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/data.h')
-rw-r--r-- | tools/perf/util/data.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/data.h b/tools/perf/util/data.h index 85f9c0dbf982..2bce28117ccf 100644 --- a/tools/perf/util/data.h +++ b/tools/perf/util/data.h @@ -10,12 +10,13 @@ enum perf_data_mode { }; struct perf_data_file { - const char *path; + char *path; int fd; unsigned long size; }; struct perf_data { + const char *path; struct perf_data_file file; bool is_pipe; bool force; |