• James Clark's avatar
    perf cs-etm: Improve version detection and error reporting · e3123079
    James Clark authored
    
    
    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.
    Reviewed-by: default avatarIan Rogers <irogers@google.com>
    Reviewed-by: default avatarLeo Yan <leo.yan@linux.dev>
    Signed-off-by: default avatarJames Clark <james.clark@arm.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: John Garry <john.g.garry@oracle.com>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Link: https://lore.kernel.org/r/20240501135753.508022-4-james.clark@arm.com
    
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    e3123079
cs-etm.c 27.2 KB