Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

perf session: Separating data file properties from session



Removing 'fd, fd_pipe, filename, size' from struct perf_session and
replacing them with struct perf_data_file object.

Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1381847254-28809-4-git-send-email-jolsa@redhat.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 6a4d98d7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -259,7 +259,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
	}

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

+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ static int perf_session__list_build_ids(bool force, bool with_hits)
	 * in pipe-mode, the only way to get the buildids is to parse
	 * the record stream. Buildids are stored as RECORD_HEADER_BUILD_ID
	 */
	if (with_hits || session->fd_pipe)
	if (with_hits || perf_data_file__is_pipe(&file))
		perf_session__process_events(session, &build_id__mark_dso_hit_ops);

	perf_session__fprintf_dsos_buildid(session, stdout, dso__skip_buildid, with_hits);
+0 −1
Original line number Diff line number Diff line
@@ -257,7 +257,6 @@ static int process_buildids(struct perf_record *rec)
	if (size == 0)
		return 0;

	session->fd = file->fd;
	return __perf_session__process_events(session, rec->post_processing_offset,
					      size - rec->post_processing_offset,
					      size, &build_id__mark_dso_hit_ops);
+5 −3
Original line number Diff line number Diff line
@@ -368,8 +368,9 @@ static int perf_report__setup_sample_type(struct perf_report *rep)
{
	struct perf_session *self = rep->session;
	u64 sample_type = perf_evlist__combined_sample_type(self->evlist);
	bool is_pipe = perf_data_file__is_pipe(self->file);

	if (!self->fd_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) {
	if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) {
		if (sort__has_parent) {
			ui__error("Selected --sort parent, but no "
				    "callchain data. Did you call "
@@ -392,7 +393,7 @@ static int perf_report__setup_sample_type(struct perf_report *rep)
	}

	if (sort__mode == SORT_MODE__BRANCH) {
		if (!self->fd_pipe &&
		if (!is_pipe &&
		    !(sample_type & PERF_SAMPLE_BRANCH_STACK)) {
			ui__error("Selected -b but no branch data. "
				  "Did you call perf record without -b?\n");
@@ -488,6 +489,7 @@ static int __cmd_report(struct perf_report *rep)
	struct map *kernel_map;
	struct kmap *kernel_kmap;
	const char *help = "For a higher level overview, try: perf report --sort comm,dso";
	struct perf_data_file *file = session->file;

	signal(SIGINT, sig_handler);

@@ -572,7 +574,7 @@ static int __cmd_report(struct perf_report *rep)
		return 0;

	if (nr_samples == 0) {
		ui__error("The %s file has no samples!\n", session->filename);
		ui__error("The %s file has no samples!\n", file->path);
		return 0;
	}

+1 −1
Original line number Diff line number Diff line
@@ -1525,7 +1525,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
			return -1;
		}

		input = open(session->filename, O_RDONLY);	/* input_name */
		input = open(file.path, O_RDONLY);	/* input_name */
		if (input < 0) {
			perror("failed to open file");
			return -1;
Loading