perf tools: Rename struct perf_data_file to perf_data

Rename struct perf_data_file to perf_data, because we will add the
possibility to have multiple files under perf.data, so the 'perf_data'
name fits better.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Changbin Du <changbin.du@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-39wn4d77phel3dgkzo3lyan0@git.kernel.org
[ Fixup recent changes in 'perf script --per-event-dump' ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Jiri Olsa
2017-01-23 22:07:59 +01:00
committed by Arnaldo Carvalho de Melo
parent 642ee1c6df
commit 8ceb41d7e3
30 changed files with 238 additions and 238 deletions

View File

@@ -217,12 +217,12 @@ struct perf_evsel_script {
};
static struct perf_evsel_script *perf_evsel_script__new(struct perf_evsel *evsel,
struct perf_data_file *file)
struct perf_data *data)
{
struct perf_evsel_script *es = malloc(sizeof(*es));
if (es != NULL) {
if (asprintf(&es->filename, "%s.%s.dump", file->path, perf_evsel__name(evsel)) < 0)
if (asprintf(&es->filename, "%s.%s.dump", data->path, perf_evsel__name(evsel)) < 0)
goto out_free;
es->fp = fopen(es->filename, "w");
if (es->fp == NULL)
@@ -1954,7 +1954,7 @@ static int perf_script__fopen_per_event_dump(struct perf_script *script)
struct perf_evsel *evsel;
evlist__for_each_entry(script->session->evlist, evsel) {
evsel->priv = perf_evsel_script__new(evsel, script->session->file);
evsel->priv = perf_evsel_script__new(evsel, script->session->data);
if (evsel->priv == NULL)
goto out_err_fclose;
}
@@ -2590,14 +2590,14 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
char scripts_path[MAXPATHLEN], lang_path[MAXPATHLEN];
DIR *scripts_dir, *lang_dir;
struct perf_session *session;
struct perf_data_file file = {
struct perf_data data = {
.path = input_name,
.mode = PERF_DATA_MODE_READ,
};
char *temp;
int i = 0;
session = perf_session__new(&file, false, NULL);
session = perf_session__new(&data, false, NULL);
if (!session)
return -1;
@@ -2875,7 +2875,7 @@ int cmd_script(int argc, const char **argv)
.ordering_requires_timestamps = true,
},
};
struct perf_data_file file = {
struct perf_data data = {
.mode = PERF_DATA_MODE_READ,
};
const struct option options[] = {
@@ -2982,8 +2982,8 @@ int cmd_script(int argc, const char **argv)
argc = parse_options_subcommand(argc, argv, options, script_subcommands, script_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
file.path = input_name;
file.force = symbol_conf.force;
data.path = input_name;
data.force = symbol_conf.force;
if (argc > 1 && !strncmp(argv[0], "rec", strlen("rec"))) {
rec_script_path = get_script_path(argv[1], RECORD_SUFFIX);
@@ -3150,7 +3150,7 @@ int cmd_script(int argc, const char **argv)
if (!script_name)
setup_pager();
session = perf_session__new(&file, false, &script.tool);
session = perf_session__new(&data, false, &script.tool);
if (session == NULL)
return -1;
@@ -3206,7 +3206,7 @@ int cmd_script(int argc, const char **argv)
goto out_delete;
}
input = open(file.path, O_RDONLY); /* input_name */
input = open(data.path, O_RDONLY); /* input_name */
if (input < 0) {
err = -errno;
perror("failed to open file");