The first CS_HEADER_VERSION_0_MAX words of an ETM trace are reserved for the header. To check the ETM version, one needs to skip over the header bytes and check the next word against __perf_cs_etmv{3,4}_magic.
Signed-off-by: Sebastian Pop s.pop@samsung.com --- tools/perf/util/cs-etm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 6b56c95..1a345c28 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -1310,7 +1310,7 @@ static void cs_etm__print_auxtrace_info(u64 *val, size_t num) { unsigned i,j,cpu;
- for (i = 0, cpu = 0; cpu < num; ++cpu) { + for (i = CS_HEADER_VERSION_0_MAX, cpu = 0; cpu < num; ++cpu) {
if (val[i] == __perf_cs_etmv3_magic) { for (j = 0; j < CS_ETM_PRIV_MAX; ++j, ++i) {