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.
I will let the experts Mike and Mathieu comment more on the overhead of the ETM.
Sebastian