perf cs-etm: Print error for new PERF_RECORD_AUX_OUTPUT_HW_ID versions
authorJames Clark <james.clark@arm.com>
Mon, 29 Apr 2024 15:21:46 +0000 (16:21 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 7 May 2024 15:44:02 +0000 (12:44 -0300)
The likely fix for this is to update perf so print a helpful message.

Signed-off-by: James Clark <james.clark@arm.com>
Tested-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
Acked-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steve Clevenger <scclevenger@os.amperecomputing.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20240429152207.479221-2-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/cs-etm.c

index d65d7485886cd512fca26134f6f34921b13753a1..32818bd7cd177fb6a8ba0d371cbda8149e4d0715 100644 (file)
@@ -335,8 +335,11 @@ static int cs_etm__process_aux_output_hw_id(struct perf_session *session,
        trace_chan_id = FIELD_GET(CS_AUX_HW_ID_TRACE_ID_MASK, hw_id);
 
        /* check that we can handle this version */
-       if (version > CS_AUX_HW_ID_CURR_VERSION)
+       if (version > CS_AUX_HW_ID_CURR_VERSION) {
+               pr_err("CS ETM Trace: PERF_RECORD_AUX_OUTPUT_HW_ID version %d not supported. Please update Perf.\n",
+                      version);
                return -EINVAL;
+       }
 
        /* get access to the etm metadata */
        etm = container_of(session->auxtrace, struct cs_etm_auxtrace, auxtrace);