Re: [PATCH] perf cs-etm: Improve version detection and error reporting

From: Leo Yan
Date: Tue Apr 30 2024 - 15:55:03 EST


On Tue, Apr 30, 2024 at 02:32:21PM +0100, James Clark wrote:
> When the config validation functions are warning about ETMv3, they do it
> based on "not ETMv4". If the drivers aren't all loaded or the hardware
> doesn't support Coresight it will appear as "not ETMv4" and then Perf
> will print the error message "... not supported in ETMv3 ..." which is
> wrong and confusing.
>
> cs_etm_is_etmv4() is also misnamed because it also returns true for
> ETE because ETE has a superset of the ETMv4 metadata files. Although
> this was always done in the correct order so it wasn't a bug.
>
> Improve all this by making a single get version function which also
> handles not present as a separate case. Change the ETMv3 error message
> to only print when ETMv3 is detected, and add a new error message for
> the not present case.
>
> Signed-off-by: James Clark <james.clark@xxxxxxx>

Reviewed-by: Leo Yan <leo.yan@xxxxxxxxx>