public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: linux-arm-kernel@lists.infradead.org, Mike Leach <mike.leach@linaro.org>
Cc: al.grant@arm.com, mathieu.poirier@linaro.org,
	anshuman.khandual@arm.com, coresight@lists.linaro.org,
	leo.yan@linaro.org, mike.leach@linaro.org
Subject: Re: [PATCH 3/3] rfc: perf: cs_etm: Detect pid in VMID for kernel running at EL2
Date: Tue, 10 Nov 2020 22:57:05 +0000	[thread overview]
Message-ID: <a3e237a0-a22f-4379-b48a-6b53420017d7@arm.com> (raw)
In-Reply-To: <20201110183313.1823760-4-suzuki.poulose@arm.com>

Mike,


Related to this patch, I have a question about the print decoder
in OpenCSD. Withe TRCCONFIGR.VMIDOPT, we have CONTEXTIDR_EL2 in
VMID instead of the real VMID. Does it make sense to change the
print decoder to reflect this in the o/p ?

i.e, instead of :

Idx:530; ID:14; I_ADDR_CTXT_L_64IS0 .. Ctxt: AArch64,EL0, NS; VMID=0xAA;

Could this be

Idx:530; ID:14; I_ADDR_CTXT_L_64IS0 .. Ctxt: AArch64,EL0, NS; CID2=0xAA;

with VMIDOPT ?

I understand it is a bit naive, and there are widespread users of
OpenCSD and it could potentially break any existing users. But worth
checking.

Cheers
Suzuki

On 11/10/20 6:33 PM, Suzuki K Poulose wrote:
> The pid of the task could be traced as VMID when the kernel is
> running at EL2. Teach the decoder to look for vmid when the
> context_id is invalid but we have a valid VMID.
> 
> Cc: Mike Leach <mike.leach@linaro.org>
> Cc: Leo Yan <leo.yan@linaro.org>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
> 
> Ideally, we should also confirm that the VMID_OPT is also set
> in the trcconfigr for choosing the VMID. Hence the RFC. May be
> that is something we could cache in the "decoder" instance ?
> ---
>   .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 28 +++++++++++--------
>   1 file changed, 17 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> index cd007cc9c283..31ba7ff57914 100644
> --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> @@ -502,19 +502,25 @@ cs_etm_decoder__set_tid(struct cs_etm_queue *etmq,
>   {
>   	pid_t tid;
>   
> -	/* Ignore PE_CONTEXT packets that don't have a valid contextID */
> -	if (!elem->context.ctxt_id_valid)
> -		return OCSD_RESP_CONT;
> -
> -	tid =  elem->context.context_id;
> -	if (cs_etm__etmq_set_tid(etmq, tid, trace_chan_id))
> -		return OCSD_RESP_FATAL_SYS_ERR;
> -
>   	/*
> -	 * A timestamp is generated after a PE_CONTEXT element so make sure
> -	 * to rely on that coming one.
> +	 * Process the PE_CONTEXT packets if we have a valid
> +	 *  contextID or VMID.
> +	 * If the kernel is running at EL2, the PID is traced
> +	 * in contextidr_el2 as VMID.
>   	 */
> -	cs_etm_decoder__reset_timestamp(packet_queue);
> +	if (elem->context.ctxt_id_valid || elem->context.vmid_valid) {
> +		if (elem->context.ctxt_id_valid)
> +			tid =  elem->context.context_id;
> +		else
> +			tid = elem->context.vmid;
> +		if (cs_etm__etmq_set_tid(etmq, tid, trace_chan_id))
> +			return OCSD_RESP_FATAL_SYS_ERR;
> +		/*
> +		 * A timestamp is generated after a PE_CONTEXT element so make sure
> +		 * to rely on that coming one.
> +		 */
> +		cs_etm_decoder__reset_timestamp(packet_queue);
> +	}
>   
>   	return OCSD_RESP_CONT;
>   }
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-10 22:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10 18:33 [PATCH 0/3] coresight: etm-perf: Fix pid tracing with VHE Suzuki K Poulose
2020-11-10 18:33 ` [PATCH 1/3] coresight: etm-perf: Add support for PID tracing for kernel at EL2 Suzuki K Poulose
2020-11-12 10:27   ` Leo Yan
2020-11-12 12:41     ` Suzuki K Poulose
2020-11-10 18:33 ` [PATCH 2/3] perf: cs_etm: Use pid tracing explicitly instead of contextid Suzuki K Poulose
2020-11-12 10:00   ` Leo Yan
2020-11-12 10:54     ` Suzuki K Poulose
2020-11-12 12:24       ` Leo Yan
2020-11-10 18:33 ` [PATCH 3/3] rfc: perf: cs_etm: Detect pid in VMID for kernel running at EL2 Suzuki K Poulose
2020-11-10 22:57   ` Suzuki K Poulose [this message]
2020-11-11 11:03   ` Al Grant
2020-11-11 11:40     ` Suzuki K Poulose
2020-11-13  0:11       ` Leo Yan
2020-11-13  9:47         ` Suzuki K Poulose
2020-11-13 10:42           ` Leo Yan
2020-11-16  9:46           ` Leo Yan
2020-12-18 10:46             ` Daniel Kiss
     [not found]               ` <CADDJ8CVqz8Gdkx42H+TjdBOS-Vjk4MAVV7PhAaeBNq9Ejh=usA@mail.gmail.com>
2020-12-23  8:05                 ` Leo Yan
2021-01-04 17:33                   ` Suzuki K Poulose
2021-01-04 18:06                     ` Mathieu Poirier

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=a3e237a0-a22f-4379-b48a-6b53420017d7@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=al.grant@arm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=coresight@lists.linaro.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.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