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

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

perf record: Synthesize features before events in pipe mode



We need to synthesize events first, because some features works on top
of them (on report side).

Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Tested-by: default avatarStephane Eranian <eranian@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180314092205.23291-1-jolsa@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 66790bc8
Loading
Loading
Loading
Loading
+11 −7
Original line number Original line Diff line number Diff line
@@ -754,13 +754,10 @@ static int record__synthesize(struct record *rec, bool tail)
		return 0;
		return 0;


	if (data->is_pipe) {
	if (data->is_pipe) {
		err = perf_event__synthesize_features(
		/*
			tool, session, rec->evlist, process_synthesized_event);
		 * We need to synthesize events first, because some
		if (err < 0) {
		 * features works on top of them (on report side).
			pr_err("Couldn't synthesize features.\n");
		 */
			return err;
		}

		err = perf_event__synthesize_attrs(tool, session,
		err = perf_event__synthesize_attrs(tool, session,
						   process_synthesized_event);
						   process_synthesized_event);
		if (err < 0) {
		if (err < 0) {
@@ -768,6 +765,13 @@ static int record__synthesize(struct record *rec, bool tail)
			goto out;
			goto out;
		}
		}


		err = perf_event__synthesize_features(tool, session, rec->evlist,
						      process_synthesized_event);
		if (err < 0) {
			pr_err("Couldn't synthesize features.\n");
			return err;
		}

		if (have_tracepoints(&rec->evlist->entries)) {
		if (have_tracepoints(&rec->evlist->entries)) {
			/*
			/*
			 * FIXME err <= 0 here actually means that
			 * FIXME err <= 0 here actually means that