diff options
author | Tamas Zsoldos <tamas.zsoldos@arm.com> | 2024-04-17 14:22:03 +0200 |
---|---|---|
committer | Tamas Zsoldos <tamas.zsoldos@arm.com> | 2024-04-17 16:13:02 +0200 |
commit | 08466993b70e29d853b12f266de07054b9add4f2 (patch) | |
tree | 45a01fb6b5fbb49bc5219971b2b37aff2bcb462d /simpleperf | |
parent | 8da16c26aeb461787c4f9ea9c14c1c01f90a1be1 (diff) | |
download | extras-08466993b70e29d853b12f266de07054b9add4f2.tar.gz |
simpleperf: Mark cycle counting in ETM config register.
When recording ETM traces with cycle counting, mark the bit that
indicates this in the config register. Without this other software
might discard cycle count information.
Change-Id: I74182a1f48cd25c4b05ac67913c46f88fc0f3b26
Diffstat (limited to 'simpleperf')
-rw-r--r-- | simpleperf/ETMConstants.h | 1 | ||||
-rw-r--r-- | simpleperf/ETMRecorder.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/simpleperf/ETMConstants.h b/simpleperf/ETMConstants.h index 78e9cc26..003d88ab 100644 --- a/simpleperf/ETMConstants.h +++ b/simpleperf/ETMConstants.h @@ -24,6 +24,7 @@ static constexpr int ETM_OPT_CTXTID = 14; static constexpr int ETM_OPT_CTXTID2 = 15; static constexpr int ETM_OPT_TS = 28; // For etm_config_reg: +static constexpr int ETM4_CFG_BIT_CCI = 4; static constexpr int ETM4_CFG_BIT_CTXTID = 6; static constexpr int ETM4_CFG_BIT_VMID = 7; static constexpr int ETM4_CFG_BIT_TS = 11; diff --git a/simpleperf/ETMRecorder.cpp b/simpleperf/ETMRecorder.cpp index cde1eb2b..a722df5c 100644 --- a/simpleperf/ETMRecorder.cpp +++ b/simpleperf/ETMRecorder.cpp @@ -229,6 +229,7 @@ void ETMRecorder::BuildEtmConfig() { } if (cycles_supported) { etm_event_config_ |= 1ULL << ETM_OPT_CYCACC; + etm_config_reg_ |= 1U << ETM4_CFG_BIT_CCI; if (cycle_threshold_) { cc_threshold_config_ |= cycle_threshold_; |