http://developer.android.com/tools/debugging/debugging-tracing.html

There are two ways to generate trace logs:

第一种
Include the Debug class in your code and call its methods such as startMethodTracing() and stopMethodTracing(), to start and stop logging of trace information to disk. This option is very precise because you can specify exactly where to start and stop logging trace data in your code.

第二种
Use the method profiling feature of DDMS to generate trace logs. This option is less precise because you do not modify code, but rather specify when to start and stop logging with DDMS. Although you have less control on exactly where logging starts and stops, this option is useful if you don't have access to the application's code, or if you do not need precise log timing.

我好奇的是第二种方法, 他底层的原理是什么, 大家有了解的吗?
是通过往 ADB 或者 JDB 发送什么指令吗?


↙↙↙阅读原文可查看相关链接,并与作者交流