I did a quick check and found OpenCSD's header has defined a field to indicate the exception level; so just curious if we can simply check the exception level in OpenCSD's element, if the exception level is EL2, then perf tool uses VMID rather than CID for the process ID.
If this is feasible, then here don't depend on TRCCONFIGR anymore. Does this make sense? Sorry might introduce noise.
It would be nice if it worked, but the exception level shows what state the CPU was in when generating trace. So if we're tracing EL0, the elements we get from OpenCSD will say EL0. We might not have permissions to see beyond EL0 but we still want to see thread switches. We need to distinguish between EL0 contexts where the thread id was placed in VMID (because the kernel is at EL2+VHE) from EL0 contexts where the thread id is in CID.
Al
Thanks, Leo
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.