Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Jiri Olsa <jolsa@kernel.org>
Tested-by: Stephane 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: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
a2015516 66790bc8

+11 -7
+11 -7
tools/perf/builtin-record.c
··· 754 754 return 0; 755 755 756 756 if (data->is_pipe) { 757 - err = perf_event__synthesize_features( 758 - tool, session, rec->evlist, process_synthesized_event); 759 - if (err < 0) { 760 - pr_err("Couldn't synthesize features.\n"); 761 - return err; 762 - } 763 - 757 + /* 758 + * We need to synthesize events first, because some 759 + * features works on top of them (on report side). 760 + */ 764 761 err = perf_event__synthesize_attrs(tool, session, 765 762 process_synthesized_event); 766 763 if (err < 0) { 767 764 pr_err("Couldn't synthesize attrs.\n"); 768 765 goto out; 766 + } 767 + 768 + err = perf_event__synthesize_features(tool, session, rec->evlist, 769 + process_synthesized_event); 770 + if (err < 0) { 771 + pr_err("Couldn't synthesize features.\n"); 772 + return err; 769 773 } 770 774 771 775 if (have_tracepoints(&rec->evlist->entries)) {