Does Traceview Android 5 supports "Method/ trace based profiling" or is it just sampling-based profiler now?

169 views Asked by At

In Android version <= 4.4, Traceview show all the functions executed by the app in it's execution order. It is implemented using the APIs provided by Profile.cc. Basic idea is that whenever dvm enters/exits a function profiler logs the function. This is called trace (/method) based profiling.

However, in Android version >= 5 code base, I am not able to find implementation of trace/method-based profiler (Profile.cc). But there is a Profiler.cc inside ART which is basically a sampling-based profiler.

Google documentation says:

"While Traceview gives useful information, its results on Dalvik have been skewed by the per-method-call overhead, and use of the tool noticeably affects run time performance.

ART adds support for a dedicated sampling profiler that does not have these limitations. This gives a more accurate view of app execution without significant slowdown. Sampling support was added to Traceview for Dalvik in the KitKat release. "

So my questions are:

  1. Does Android version 5 supports Trace (/method) based profiling? If yes, where is the implementation code?

  2. If ART uses only sampling-based profiling, how is it possible to log every method that gets executed by an Android app? Sampling based profiler may miss a method execution, right?

Thanks in advance,

0

There are 0 answers