Re: [PATCH 4/7] perf cs-etm: Don't use hard coded config bits when setting up ETMCR

Leo Yan
2025-12-02T11:43:12Z

On Mon, Dec 01, 2025 at 04:41:07PM +0000, Coresight ML wrote:

[...]

> @@ -746,7 +779,7 @@ static void cs_etm_get_metadata(struct perf_cpu cpu, u32 *offset,
> case CS_ETMV3:
> magic = __perf_cs_etmv3_magic;
> /* Get configuration register */
> - info->priv[*offset + CS_ETM_ETMCR] = cs_etm_get_config(itr);
> + info->priv[*offset + CS_ETM_ETMCR] = cs_etm_guess_etmcr(itr);

I still think cs_etm_get_config() is better than cs_etm_guess_etmcr().

For ETMv3, we directly pass CONFIG to the kernel, and after validation
in the dirver, then the value will be set to ETMCR. If we already know
the config value is consistent between user space and kernel, why
introduce a redundant "guess" operation here?

Thanks,
Leo