On 18 May 2017 at 08:57, Sebastian Pop s.pop@samsung.com wrote:
On 05/18/2017 09:27 AM, Dehao Chen wrote:
Just curious: what's the profiling overhead for this?
To my understanding ETM has no overhead on the execution: ETM is a hardware device that was designed for debug purposes to have no overhead. The normal use of the ETM is to be able to inspect an execution trace leading to an error (like a kernel panic.) At the moment of the crash, one can stop the execution and inspect the trace recorded by the ETM.
In the use of the ETM with "perf record", there is an overhead when "perf record" wakes up to record the trace. Copying the content of the trace buffer (ETB) to perf.data has an overhead, that can be mitigated by making perf to wake up less often to record a trace, and by using a small ETB. I have tried an ETB of 1MB and 3MB, and I do not know whether one can configure the ETB to be smaller than 1MB.
Sebastian has properly summarised the situation. ETMs don't introduce overhead since they are HW devices. Depending on the sink being used there may be more or less overhead. Due to their inherent nature ETB and ETF sinks come along with extra processing related to copying traces from the internal memory to the perf ring buffer. That can be mitigated by using an ETR sink in scatter-gather mode. There is currently an implementation on github with another one to be posted to the kernel mailing list soon.
Mathieu
I will let the experts Mike and Mathieu comment more on the overhead of the ETM.
Sebastian _______________________________________________ CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight