diff options
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 4d198f73b29a..8f8fa952b506 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -217,12 +217,12 @@ struct perf_evsel_script { | |||
217 | }; | 217 | }; |
218 | 218 | ||
219 | static struct perf_evsel_script *perf_evsel_script__new(struct perf_evsel *evsel, | 219 | static struct perf_evsel_script *perf_evsel_script__new(struct perf_evsel *evsel, |
220 | struct perf_data_file *file) | 220 | struct perf_data *data) |
221 | { | 221 | { |
222 | struct perf_evsel_script *es = malloc(sizeof(*es)); | 222 | struct perf_evsel_script *es = malloc(sizeof(*es)); |
223 | 223 | ||
224 | if (es != NULL) { | 224 | if (es != NULL) { |
225 | if (asprintf(&es->filename, "%s.%s.dump", file->path, perf_evsel__name(evsel)) < 0) | 225 | if (asprintf(&es->filename, "%s.%s.dump", data->path, perf_evsel__name(evsel)) < 0) |
226 | goto out_free; | 226 | goto out_free; |
227 | es->fp = fopen(es->filename, "w"); | 227 | es->fp = fopen(es->filename, "w"); |
228 | if (es->fp == NULL) | 228 | if (es->fp == NULL) |
@@ -1954,7 +1954,7 @@ static int perf_script__fopen_per_event_dump(struct perf_script *script) | |||
1954 | struct perf_evsel *evsel; | 1954 | struct perf_evsel *evsel; |
1955 | 1955 | ||
1956 | evlist__for_each_entry(script->session->evlist, evsel) { | 1956 | evlist__for_each_entry(script->session->evlist, evsel) { |
1957 | evsel->priv = perf_evsel_script__new(evsel, script->session->file); | 1957 | evsel->priv = perf_evsel_script__new(evsel, script->session->data); |
1958 | if (evsel->priv == NULL) | 1958 | if (evsel->priv == NULL) |
1959 | goto out_err_fclose; | 1959 | goto out_err_fclose; |
1960 | } | 1960 | } |
@@ -2590,14 +2590,14 @@ int find_scripts(char **scripts_array, char **scripts_path_array) | |||
2590 | char scripts_path[MAXPATHLEN], lang_path[MAXPATHLEN]; | 2590 | char scripts_path[MAXPATHLEN], lang_path[MAXPATHLEN]; |
2591 | DIR *scripts_dir, *lang_dir; | 2591 | DIR *scripts_dir, *lang_dir; |
2592 | struct perf_session *session; | 2592 | struct perf_session *session; |
2593 | struct perf_data_file file = { | 2593 | struct perf_data data = { |
2594 | .path = input_name, | 2594 | .path = input_name, |
2595 | .mode = PERF_DATA_MODE_READ, | 2595 | .mode = PERF_DATA_MODE_READ, |
2596 | }; | 2596 | }; |
2597 | char *temp; | 2597 | char *temp; |
2598 | int i = 0; | 2598 | int i = 0; |
2599 | 2599 | ||
2600 | session = perf_session__new(&file, false, NULL); | 2600 | session = perf_session__new(&data, false, NULL); |
2601 | if (!session) | 2601 | if (!session) |
2602 | return -1; | 2602 | return -1; |
2603 | 2603 | ||
@@ -2875,7 +2875,7 @@ int cmd_script(int argc, const char **argv) | |||
2875 | .ordering_requires_timestamps = true, | 2875 | .ordering_requires_timestamps = true, |
2876 | }, | 2876 | }, |
2877 | }; | 2877 | }; |
2878 | struct perf_data_file file = { | 2878 | struct perf_data data = { |
2879 | .mode = PERF_DATA_MODE_READ, | 2879 | .mode = PERF_DATA_MODE_READ, |
2880 | }; | 2880 | }; |
2881 | const struct option options[] = { | 2881 | const struct option options[] = { |
@@ -2982,8 +2982,8 @@ int cmd_script(int argc, const char **argv) | |||
2982 | argc = parse_options_subcommand(argc, argv, options, script_subcommands, script_usage, | 2982 | argc = parse_options_subcommand(argc, argv, options, script_subcommands, script_usage, |
2983 | PARSE_OPT_STOP_AT_NON_OPTION); | 2983 | PARSE_OPT_STOP_AT_NON_OPTION); |
2984 | 2984 | ||
2985 | file.path = input_name; | 2985 | data.path = input_name; |
2986 | file.force = symbol_conf.force; | 2986 | data.force = symbol_conf.force; |
2987 | 2987 | ||
2988 | if (argc > 1 && !strncmp(argv[0], "rec", strlen("rec"))) { | 2988 | if (argc > 1 && !strncmp(argv[0], "rec", strlen("rec"))) { |
2989 | rec_script_path = get_script_path(argv[1], RECORD_SUFFIX); | 2989 | rec_script_path = get_script_path(argv[1], RECORD_SUFFIX); |
@@ -3150,7 +3150,7 @@ int cmd_script(int argc, const char **argv) | |||
3150 | if (!script_name) | 3150 | if (!script_name) |
3151 | setup_pager(); | 3151 | setup_pager(); |
3152 | 3152 | ||
3153 | session = perf_session__new(&file, false, &script.tool); | 3153 | session = perf_session__new(&data, false, &script.tool); |
3154 | if (session == NULL) | 3154 | if (session == NULL) |
3155 | return -1; | 3155 | return -1; |
3156 | 3156 | ||
@@ -3206,7 +3206,7 @@ int cmd_script(int argc, const char **argv) | |||
3206 | goto out_delete; | 3206 | goto out_delete; |
3207 | } | 3207 | } |
3208 | 3208 | ||
3209 | input = open(file.path, O_RDONLY); /* input_name */ | 3209 | input = open(data.path, O_RDONLY); /* input_name */ |
3210 | if (input < 0) { | 3210 | if (input < 0) { |
3211 | err = -errno; | 3211 | err = -errno; |
3212 | perror("failed to open file"); | 3212 | perror("failed to open file"); |