mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Leo Yan <leo.yan@linaro.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	James Clark <james.clark@arm.com>,
	Mike Leach <mike.leach@linaro.org>
Cc: John Garry <john.g.garry@oracle.com>,
	Will Deacon <will@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 RESEND 1/2] perf cs-etm: Validate timestamp tracing in per-thread mode
Date: Mon, 16 Oct 2023 10:15:07 +0100	[thread overview]
Message-ID: <767745f1-4d79-17f1-6c5f-a4b352b8a40f@arm.com> (raw)
In-Reply-To: <20231014074159.1667880-2-leo.yan@linaro.org>

On 14/10/2023 08:41, Leo Yan wrote:
> So far, it's impossible to validate timestamp trace in Arm CoreSight when
> the perf is in the per-thread mode.  E.g. for the command:
> 
>    perf record -e cs_etm/timestamp/ --per-thread -- ls
> 
> The command enables config 'timestamp' for 'cs_etm' event in the
> per-thread mode.  In this case, the function cs_etm_validate_config()
> directly bails out and skips validation.
> 
> Given profiled process can be scheduled on any CPUs in the per-thread
> mode, this patch validates timestamp tracing for all CPUs when detect
> the CPU map is empty.
> 
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> Reviewed-by: James Clark <james.clark@arm.com>

> ---
>   tools/perf/arch/arm/util/cs-etm.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> index b8d6a953fd74..cf9ef9ba800b 100644
> --- a/tools/perf/arch/arm/util/cs-etm.c
> +++ b/tools/perf/arch/arm/util/cs-etm.c
> @@ -205,8 +205,17 @@ static int cs_etm_validate_config(struct auxtrace_record *itr,
>   	for (i = 0; i < cpu__max_cpu().cpu; i++) {
>   		struct perf_cpu cpu = { .cpu = i, };
>   
> -		if (!perf_cpu_map__has(event_cpus, cpu) ||
> -		    !perf_cpu_map__has(online_cpus, cpu))
> +		/*
> +		 * In per-cpu case, do the validation for CPUs to work with.
> +		 * In per-thread case, the CPU map is empty.  Since the traced
> +		 * program can run on any CPUs in this case, thus don't skip
> +		 * validation.
> +		 */
> +		if (!perf_cpu_map__empty(event_cpus) &&
> +		    !perf_cpu_map__has(event_cpus, cpu))
> +			continue;
> +
> +		if (!perf_cpu_map__has(online_cpus, cpu))
>   			continue;
>   

Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>


  reply	other threads:[~2023-10-16  9:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-14  7:41 [PATCH v1 RESEND 0/2] perf cs-etm: Improve timestamp tracing Leo Yan
2023-10-14  7:41 ` [PATCH v1 RESEND 1/2] perf cs-etm: Validate timestamp tracing in per-thread mode Leo Yan
2023-10-16  9:15   ` Suzuki K Poulose [this message]
2023-10-14  7:41 ` [PATCH v1 RESEND 2/2] perf cs-etm: Respect timestamp option Leo Yan
2023-10-16  8:42   ` Suzuki K Poulose
2023-10-17 19:55 ` [PATCH v1 RESEND 0/2] perf cs-etm: Improve timestamp tracing Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=767745f1-4d79-17f1-6c5f-a4b352b8a40f@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mike.leach@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®