aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Clark <[email protected]>2021-08-06 14:41:09 +0100
committerArnaldo Carvalho de Melo <[email protected]>2021-09-03 08:18:24 -0300
commita80aea64aa07361a57f2245a0695878f2ae67ee7 (patch)
tree0722787782fad82ba34f267b8e6ab3a28ad8b833
parent56c62f52b6f25802a2154243b6dacdc6ff4f75bd (diff)
perf cs-etm: Show a warning for an unknown magic number
Currently perf reports "Cannot allocate memory" which isn't very helpful for a potentially user facing issue. If we add a new magic number in the future, perf will be able to report unrecognised magic numbers. Reviewed-by: Leo Yan <[email protected]> Signed-off-by: James Clark <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Poirier <[email protected]> Cc: Mike Leach <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Suzuki Poulouse <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Cc: [email protected] Link: https //lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/cs-etm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 5b19b381688b..f323adb1af85 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -2981,6 +2981,11 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
/* ETE shares first part of metadata with ETMv4 */
trcidr_idx = CS_ETMV4_TRCTRACEIDR;
+ } else {
+ ui__error("CS ETM Trace: Unrecognised magic number %#"PRIx64". File could be from a newer version of perf.\n",
+ ptr[i]);
+ err = -EINVAL;
+ goto err_free_metadata;
}
if (!metadata[j]) {