Skip to content

Commit ab6bd55

Browse files
James-A-Clarkacmel
authored andcommitted
perf cs-etm: Print unknown header version as an error
This is an error rather than just for the raw trace dump so always print it as an error. Also remove the duplicate header version check. Signed-off-by: James Clark <[email protected]> Cc: Al Grant <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Poirier <[email protected]> Cc: Mike Leach <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[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]>
1 parent 22ddcb6 commit ab6bd55

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tools/perf/util/cs-etm.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2623,14 +2623,7 @@ static void cs_etm__print_auxtrace_info(__u64 *val, int num)
26232623
{
26242624
int i, cpu = 0, version, err;
26252625

2626-
/* bail out early on bad header version */
26272626
version = val[0];
2628-
if (version > CS_HEADER_CURRENT_VERSION) {
2629-
/* failure.. return */
2630-
fprintf(stdout, " Unknown Header Version = %x, ", version);
2631-
fprintf(stdout, "Version supported <= %x\n", CS_HEADER_CURRENT_VERSION);
2632-
return;
2633-
}
26342627

26352628
for (i = 0; i < CS_HEADER_VERSION_MAX; i++)
26362629
fprintf(stdout, cs_etm_global_header_fmts[i], val[i]);
@@ -2916,9 +2909,8 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
29162909
/* Look for version of the header */
29172910
hdr_version = ptr[0];
29182911
if (hdr_version > CS_HEADER_CURRENT_VERSION) {
2919-
/* print routine will print an error on bad version */
2920-
if (dump_trace)
2921-
cs_etm__print_auxtrace_info(auxtrace_info->priv, 0);
2912+
pr_err("\nCS ETM Trace: Unknown Header Version = %#" PRIx64, hdr_version);
2913+
pr_err(", version supported <= %x\n", CS_HEADER_CURRENT_VERSION);
29222914
return -EINVAL;
29232915
}
29242916

0 commit comments

Comments
 (0)