Re: [PATCH] perf stat: Fix L2 Topdown metrics disappear for raw events

From: Arnaldo Carvalho de Melo
Date: Fri Sep 02 2022 - 12:53:56 EST


Em Fri, Aug 26, 2022 at 10:00:57PM +0800, zhengjun.xing@xxxxxxxxxxxxxxx escreveu:
> From: Zhengjun Xing <zhengjun.xing@xxxxxxxxxxxxxxx>
>
> In perf/Documentation/perf-stat.txt, for "--td-level" the default "0" means
> the max level that the current hardware support. So we need initialize the
> stat_config.topdown_level to TOPDOWN_MAX_LEVEL when “--td-level=0” or no
> “--td-level” option. Otherwise, for the hardware with a max level is 2, the
> 2nd level metrics disappear for raw events in this case. The issue cannot
> be observed for the perf stat default or "--topdown" options. This commit
> fixes the raw events issue and removes the duplicated code for the perf
> stat default.

Thanks, applied, sorry for the delay.

- Arnaldo