The original purpose of timestamps in per-CPU mode was to roughly emit samples in the order they occurred across multiple CPUs, rather than emit all the trace from CPU 1 followed by all from CPU 2 etc. Previously there was no way to change the interval from the minimum of 1 cycle, but custom intervals are now supported by the driver.
Drastically reduce the number of timestamps emitted by increasing the interval, which is more than enough to interleave sample generation. This reduces the size of the trace generated.
Signed-off-by: James Clark james.clark@linaro.org --- tools/perf/arch/arm/util/cs-etm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index d0486a164a70..d36b7e41399b 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -70,6 +70,9 @@ static const char * const metadata_ete_ro[] = {
enum cs_etm_version { CS_NOT_PRESENT, CS_ETMV3, CS_ETMV4, CS_ETE };
+/* Default timestamp period of 256 cycles (2 ^ (9 - 1) = 256). */ +#define DEFAULT_TS 9 + static bool cs_etm_is_ete(struct perf_pmu *cs_etm_pmu, struct perf_cpu cpu); static int cs_etm_get_ro(struct perf_pmu *pmu, struct perf_cpu cpu, const char *path, __u64 *val); static bool cs_etm_pmu_path_exists(struct perf_pmu *pmu, struct perf_cpu cpu, const char *path); @@ -458,7 +461,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr, * Timestamps are required to interleave samples from different * CPUs. */ - evsel__set_config_if_unset(cs_etm_evsel, "timestamp", 1); + evsel__set_config_if_unset(cs_etm_evsel, "timestamp", DEFAULT_TS); /* Context IDs are required to associate trace to a process */ evsel__set_config_if_unset(cs_etm_evsel, "contextid", 1); } else { @@ -477,7 +480,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr, * timestamp tracing. */ if (opts->sample_time_set) - evsel__set_config_if_unset(cs_etm_evsel, "timestamp", 1); + evsel__set_config_if_unset(cs_etm_evsel, "timestamp", DEFAULT_TS);
/* Add dummy event to keep tracking */ err = parse_event(evlist, "dummy:u");