Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf auxtrace: Add 'T' itrace option for timestamp trace

An AUX trace can contain timestamp, but in some situations, the hardware
trace module (e.g. Arm CoreSight) cannot decide the traced timestamp is
the same source with CPU's time, thus the decoder can not use the
timestamp trace for samples.

This patch introduces 'T' itrace option. If users know the platforms
they are working on have the same time counter with CPUs, users can
use this new option to tell a decoder for using timestamp trace as
kernel time.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20231014074513.1668000-2-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Leo Yan and committed by
Arnaldo Carvalho de Melo
26218331 2dbba30f

+7
+1
tools/perf/Documentation/itrace.txt
··· 25 25 q quicker (less detailed) decoding 26 26 A approximate IPC 27 27 Z prefer to ignore timestamps (so-called "timeless" decoding) 28 + T use the timestamp trace as kernel time 28 29 29 30 The default is all events i.e. the same as --itrace=iybxwpe, 30 31 except for perf script where it is --itrace=ce
+3
tools/perf/util/auxtrace.c
··· 1638 1638 case 'Z': 1639 1639 synth_opts->timeless_decoding = true; 1640 1640 break; 1641 + case 'T': 1642 + synth_opts->use_timestamp = true; 1643 + break; 1641 1644 case ' ': 1642 1645 case ',': 1643 1646 break;
+3
tools/perf/util/auxtrace.h
··· 99 99 * @remote_access: whether to synthesize remote access events 100 100 * @mem: whether to synthesize memory events 101 101 * @timeless_decoding: prefer "timeless" decoding i.e. ignore timestamps 102 + * @use_timestamp: use the timestamp trace as kernel time 102 103 * @vm_time_correlation: perform VM Time Correlation 103 104 * @vm_tm_corr_dry_run: VM Time Correlation dry-run 104 105 * @vm_tm_corr_args: VM Time Correlation implementation-specific arguments ··· 147 146 bool remote_access; 148 147 bool mem; 149 148 bool timeless_decoding; 149 + bool use_timestamp; 150 150 bool vm_time_correlation; 151 151 bool vm_tm_corr_dry_run; 152 152 char *vm_tm_corr_args; ··· 680 678 " q: quicker (less detailed) decoding\n" \ 681 679 " A: approximate IPC\n" \ 682 680 " Z: prefer to ignore timestamps (so-called \"timeless\" decoding)\n" \ 681 + " T: use the timestamp trace as kernel time\n" \ 683 682 " PERIOD[ns|us|ms|i|t]: specify period to sample stream\n" \ 684 683 " concatenate multiple options. Default is iybxwpe or cewp\n" 685 684