[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2a7f6d40-6502-d389-f691-488e3d9b9005@arm.com>
Date: Mon, 4 Sep 2023 16:25:38 +0100
From: James Clark <james.clark@....com>
To: Leo Yan <leo.yan@...aro.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Suzuki K Poulose <suzuki.poulose@....com>,
Mike Leach <mike.leach@...aro.org>,
John Garry <john.g.garry@...cle.com>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/2] perf cs-etm: Respect timestamp option
On 27/08/2023 14:35, Leo Yan wrote:
> When users pass the option '--timestamp' or '-T' in the record command,
> all events will set the PERF_SAMPLE_TIME bit in the attribution. In
> this case, the AUX event will record the kernel timestamp, but it
> doesn't mean Arm CoreSight enables timestamp packets in its hardware
> tracing.
>
> If the option '--timestamp' or '-T' is set, this patch always enables
> Arm CoreSight timestamp, as a result, the bit 28 in event's config is to
> be set.
>
> Before:
>
> # perf record -e cs_etm// --per-thread --timestamp -- ls
> # perf script --header-only
> ...
> # event : name = cs_etm//, , id = { 69 }, type = 12, size = 136,
> config = 0, { sample_period, sample_freq } = 1,
> sample_type = IP|TID|TIME|CPU|IDENTIFIER, read_format = ID|LOST,
> disabled = 1, enable_on_exec = 1, sample_id_all = 1, exclude_guest = 1
> ...
>
> After:
>
> # perf record -e cs_etm// --per-thread --timestamp -- ls
> # perf script --header-only
> ...
> # event : name = cs_etm//, , id = { 49 }, type = 12, size = 136,
> config = 0x10000000, { sample_period, sample_freq } = 1,
> sample_type = IP|TID|TIME|CPU|IDENTIFIER, read_format = ID|LOST,
> disabled = 1, enable_on_exec = 1, sample_id_all = 1, exclude_guest = 1
> ...
>
> Signed-off-by: Leo Yan <leo.yan@...aro.org>
Reviewed-by: James Clark <james.clark@....com>
> ---
> tools/perf/arch/arm/util/cs-etm.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> index cf9ef9ba800b..58c506e9788d 100644
> --- a/tools/perf/arch/arm/util/cs-etm.c
> +++ b/tools/perf/arch/arm/util/cs-etm.c
> @@ -442,6 +442,15 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
> "contextid", 1);
> }
>
> + /*
> + * 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.
> + */
> + if (opts->sample_time_set)
> + evsel__set_config_if_unset(cs_etm_pmu, cs_etm_evsel,
> + "timestamp", 1);
> +
> /* Add dummy event to keep tracking */
> err = parse_event(evlist, "dummy:u");
> if (err)
Powered by blists - more mailing lists