[PATCH 14/34] perf cs-etm: Always enable Perf event timestamps
From: James Clark
Date: Wed Nov 18 2026 - 11:31:33 EST
We still need MMAP timestamps in per-thread mode for overlapping mmaps,
so always enable them. Also update the comment above to reflect the fact
that Coresight timestamps are on by default, -T just gives more frequent
ones.
Signed-off-by: James Clark <james.clark@xxxxxxxxxx>
---
tools/perf/arch/arm/util/cs-etm.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 5a64c17cf254..28aaaabf36bc 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -456,6 +456,9 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
*/
evsel__set_sample_bit(cs_etm_evsel, CPU);
+ /* Need the time of AUX events */
+ evsel__set_sample_bit(cs_etm_evsel, TIME);
+
if (!perf_cpu_map__is_any_cpu_or_is_empty(cpus)) {
/*
* Timestamps are required to interleave samples from different
@@ -479,9 +482,9 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
}
/*
- * When the option '--timestamp' or '-T' is enabled, the PERF_SAMPLE_TIME
- * bit is set for all events. In this case, always enable Arm CoreSight
- * timestamp tracing.
+ * When the Perf option '--timestamp' or '-T' is enabled, expect that
+ * the user also wants more frequent Coresight timestamps than only
+ * context packet ones.
*/
if (opts->sample_time_set)
evsel__set_config_if_unset(cs_etm_evsel, "timestamp", DEFAULT_TS);
@@ -495,9 +498,8 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
evsel->core.attr.freq = 0;
evsel->core.attr.sample_period = 1;
- /* In per-cpu case, always need the time of mmap events etc */
- if (!perf_cpu_map__is_any_cpu_or_is_empty(cpus))
- evsel__set_sample_bit(evsel, TIME);
+ /* Need the time of mmap and sched events etc */
+ evsel__set_sample_bit(evsel, TIME);
err = cs_etm_validate_config(cs_etm_pmu, cs_etm_evsel);
out:
--
2.43.0