Re: [PATCH V4 03/17] perf record: Clear HEADER_CPU_PMU_CAPS for non LBR call stack mode
From: Arnaldo Carvalho de Melo
Date: Fri Apr 17 2020 - 10:42:22 EST
Em Thu, Mar 19, 2020 at 01:25:03PM -0700, kan.liang@xxxxxxxxxxxxxxx escreveu:
> From: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
>
> The CPU PMU capabilities information is only useful for LBR call stack.
> Clear the feature for other perf record mode.
Humm, I think it is useful to have this extra piece of info in the
header in general, i.e. some user may want to know about these
capabilities when investigating some perf.data file on another machine,
etc, so I'l skip this patch for now.
- Arnaldo
> Reviewed-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> Signed-off-by: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
> ---
> tools/perf/builtin-record.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 4c301466101b..428f7f5b8e48 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -1120,6 +1120,9 @@ static void record__init_features(struct record *rec)
> if (!record__comp_enabled(rec))
> perf_header__clear_feat(&session->header, HEADER_COMPRESSED);
>
> + if (!callchain_param.enabled || (callchain_param.record_mode != CALLCHAIN_LBR))
> + perf_header__clear_feat(&session->header, HEADER_CPU_PMU_CAPS);
> +
> perf_header__clear_feat(&session->header, HEADER_STAT);
> }
>
> --
> 2.17.1
>
--
- Arnaldo