Commit eae8ad80 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo
Browse files

perf tools: Add struct perf_data_file



Add struct perf_data_file to represent a single file within a perf_data
struct.

Signed-off-by: default avatarJiri 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-c3f9p4xzykr845ktqcek6p4t@git.kernel.org


[ Fixup recent changes in 'perf script --per-event-dump' ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 8ceb41d7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -356,7 +356,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
	}

	if (total_nr_samples == 0) {
		ui__error("The %s file has no samples!\n", session->data->path);
		ui__error("The %s file has no samples!\n", session->data->file.path);
		goto out;
	}

@@ -482,7 +482,7 @@ int cmd_annotate(int argc, const char **argv)
	if (quiet)
		perf_quiet_option();

	data.path  = input_name;
	data.file.path = input_name;

	annotate.session = perf_session__new(&data, false, &annotate.tool);
	if (annotate.session == NULL)
+2 −2
Original line number Diff line number Diff line
@@ -352,7 +352,7 @@ int cmd_buildid_cache(int argc, const char **argv)
		nsi = nsinfo__new(ns_id);

	if (missing_filename) {
		data.path = missing_filename;
		data.file.path = missing_filename;
		data.force     = force;

		session = perf_session__new(&data, false, NULL);
+5 −3
Original line number Diff line number Diff line
@@ -51,7 +51,9 @@ static int perf_session__list_build_ids(bool force, bool with_hits)
{
	struct perf_session *session;
	struct perf_data data = {
		.file      = {
			.path = input_name,
		},
		.mode      = PERF_DATA_MODE_READ,
		.force     = force,
	};
+2 −2
Original line number Diff line number Diff line
@@ -2572,7 +2572,7 @@ static int perf_c2c__report(int argc, const char **argv)
	if (!input_name || !strlen(input_name))
		input_name = "perf.data";

	data.path  = input_name;
	data.file.path = input_name;
	data.force     = symbol_conf.force;

	err = setup_display(display);
+6 −6
Original line number Diff line number Diff line
@@ -707,7 +707,7 @@ static void data__fprintf(void)

	data__for_each_file(i, d)
		fprintf(stdout, "#  [%d] %s %s\n",
			d->idx, d->data.path,
			d->idx, d->data.file.path,
			!d->idx ? "(Baseline)" : "");

	fprintf(stdout, "#\n");
@@ -778,14 +778,14 @@ static int __cmd_diff(void)
	data__for_each_file(i, d) {
		d->session = perf_session__new(&d->data, false, &tool);
		if (!d->session) {
			pr_err("Failed to open %s\n", d->data.path);
			pr_err("Failed to open %s\n", d->data.file.path);
			ret = -1;
			goto out_delete;
		}

		ret = perf_session__process_events(d->session);
		if (ret) {
			pr_err("Failed to process %s\n", d->data.path);
			pr_err("Failed to process %s\n", d->data.file.path);
			goto out_delete;
		}

@@ -1288,7 +1288,7 @@ static int data_init(int argc, const char **argv)
	data__for_each_file(i, d) {
		struct perf_data *data = &d->data;

		data->path  = use_default ? defaults[i] : argv[i];
		data->file.path = use_default ? defaults[i] : argv[i];
		data->mode      = PERF_DATA_MODE_READ,
		data->force     = force,

Loading