From: Jiri Olsa Date: Wed, 14 Mar 2018 09:22:04 +0000 (+0100) Subject: perf record: Synthesize features before events in pipe mode X-Git-Tag: Ubuntu-5.10.0-12.13~8188^2~9^2~11 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a2015516c5c0be932a69e1d3405c2fb03b4eacf1;p=mirror_ubuntu-hirsute-kernel.git 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 Tested-by: Stephane Eranian Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180314092205.23291-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index d33103291b02..22ebeb92ac51 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -754,13 +754,10 @@ static int record__synthesize(struct record *rec, bool tail) return 0; if (data->is_pipe) { - err = perf_event__synthesize_features( - tool, session, rec->evlist, process_synthesized_event); - if (err < 0) { - pr_err("Couldn't synthesize features.\n"); - return err; - } - + /* + * We need to synthesize events first, because some + * features works on top of them (on report side). + */ err = perf_event__synthesize_attrs(tool, session, process_synthesized_event); if (err < 0) { @@ -768,6 +765,13 @@ static int record__synthesize(struct record *rec, bool tail) 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)) { /* * FIXME err <= 0 here actually means that