diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-02-21 04:41:30 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-02-22 14:52:07 -0500 |
commit | 2d4f27999b8877409f326682fd8cc40c52f47cea (patch) | |
tree | 33c3e619718d0c75bee39957f6ca4ed70ac59c0d /tools/perf/builtin-sched.c | |
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/builtin-sched.c')
-rw-r--r-- | tools/perf/builtin-sched.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 640558e9352e..275f2d92a7bf 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1785,11 +1785,9 @@ static int perf_sched__read_events(struct perf_sched *sched) | |||
1785 | }; | 1785 | }; |
1786 | struct perf_session *session; | 1786 | struct perf_session *session; |
1787 | struct perf_data data = { | 1787 | struct perf_data data = { |
1788 | .file = { | 1788 | .path = input_name, |
1789 | .path = input_name, | 1789 | .mode = PERF_DATA_MODE_READ, |
1790 | }, | 1790 | .force = sched->force, |
1791 | .mode = PERF_DATA_MODE_READ, | ||
1792 | .force = sched->force, | ||
1793 | }; | 1791 | }; |
1794 | int rc = -1; | 1792 | int rc = -1; |
1795 | 1793 | ||
@@ -2958,11 +2956,9 @@ static int perf_sched__timehist(struct perf_sched *sched) | |||
2958 | { "sched:sched_migrate_task", timehist_migrate_task_event, }, | 2956 | { "sched:sched_migrate_task", timehist_migrate_task_event, }, |
2959 | }; | 2957 | }; |
2960 | struct perf_data data = { | 2958 | struct perf_data data = { |
2961 | .file = { | 2959 | .path = input_name, |
2962 | .path = input_name, | 2960 | .mode = PERF_DATA_MODE_READ, |
2963 | }, | 2961 | .force = sched->force, |
2964 | .mode = PERF_DATA_MODE_READ, | ||
2965 | .force = sched->force, | ||
2966 | }; | 2962 | }; |
2967 | 2963 | ||
2968 | struct perf_session *session; | 2964 | struct perf_session *session; |