On 28 January 2016 at 02:18, Eric Long eric.long@linaro.org wrote:
On 28 January 2016 at 00:02, Mathieu Poirier mathieu.poirier@linaro.org wrote:
Before going down a CPU will receive notifications, at which point ETM configuration registers are saved and tracing interrupted. After a CPU went back up the opposite process takes place, i.e registers are restored and tracing can resume. The problem with the CPUidle approach is that code that bring up and take down CPUs isn't traced.
When dealing with GPDs, the code that switches off a core is always the last thing to be executed. The same thing in the opposite direction - code that switch on a core is executed first. As such the whole path is traced. That is why I favoured that solution but again, it is a long way before it can be implemented properly in the kernel. At least some people are working on it and I may very well end up taking part of that effort but for now, I simply don't have the time.
Whether CPUidle or GPD gets implemented, both will have to deal with the intragation of coresight with the perf framework - something that will be delicate.
Hi Mathieu,
Thank you for your detailed explanation. Now I probably understand your plan. I am very much looking forward to fix the ETM retention issue.
Go ahead, it is a very interesting problem to tackle. From hereon let's call the feature "ETM save/restore" - that way people understand what you are referring to.
Normally conversations such as this one would be held in a (semi) public forum - the team at Linaro uses "coresight@lists.linaro.org". That way people are aware of what is going on and can provide input. Simply subscribe to the list [1] and we will grant you access.
My original plan was to add retention action into secure code, because the switch actions of the core power status was be done in secure mode. The kernel uses psci to comminicate with secure sys.
Right, but from a non-secure point of view PSCI is simply an API. All the processing leading to that call happens in the non-secure world. Adding save/restore capabilities in the secure world means that you'd have to synchronise with the CS driver in the non-secure world, and that would be a lot of spaghetti code.
About the PM runtime and GPD, may be there are some details I need to understand, and I will spend time to read the PM runtime and GPD code. If there are any questions I will let you know. And also if there is anything I can do, please let me know. Thank you.
Well, I advise to start with cpu notifiers... The ETMv3 already has support for hotplug notification but that code needs revision. ETMv4 doesn't register any notifier.
Mathieu
Best regards, Eric