perf mem: Only initialize memory event for recording
authorLeo Yan <leo.yan@linaro.org>
Fri, 6 Nov 2020 09:48:49 +0000 (17:48 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 11 Nov 2020 15:24:10 +0000 (12:24 -0300)
commit436cce00710a3f234ab6b735b5980256e773d388
treea680812354945c5ac1027e481ea104c43818cf08
parent8b8173b45a7a9709cc2597548469708a8efbd0d9
perf mem: Only initialize memory event for recording

It's needless to initialize memory events for reporting, this patch
moves memory event initialization for only recording.  Furthermore,
the change allows to parse perf data on cross platforms, e.g. perf
tool can report result properly even the machine doesn't support
the memory events.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20201106094853.21082-6-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-mem.c