我一直在努力使用 systrace。
我的设备运行 4.1.2 (LT28i),我在 Mac 上。我正在用类似的问题弹跳 SO 问题,但没有一个人有明确的答案。
我想说跟踪views
和graphics
方法一,日食:
错误:
方法二、终端:
$ python systrace.py --cpu-load --time=10 -o mytracefile.html
error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/sched/sched_switch/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/power/cpu_frequency/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/power/cpu_idle/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/cpufreq_interactive/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/buffer_size_kb: No such file or directory (2)
error opening /sys/kernel/debug/tracing/trace_clock: No such file or directory (2)
error opening /sys/kernel/debug/tracing/tracing_on: No such file or directory (2)
error: unable to start trace
error opening /sys/kernel/debug/tracing/tracing_on: No such file or directory (2)
error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/sched/sched_switch/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/events/power/cpu_frequency/enable: No such file or directory (2)
error opening /sys/kernel/debug/tracing/trace_clock: No such file or directory (2)
unable to start tracing
error opening /sys/kernel/debug/tracing/buffer_size_kb: No such file or directory (2)
An error occured while capturing the trace. Output file was not written.
dionyses-lorentzoss-imac:systrace dionysis_lorentzos$ mount -o rw,remount -t debugfs none /sys/kernel/debug
mount: realpath /sys: No such file or directory
我也尝试下面的命令并得到一个错误,但根据谷歌文档,只有在某些跟踪中才需要 root。
$ adb root
adbd cannot run as root in production builds
如何为视图或图形生成简单的 systrace?
手机中的调试已启用,并且“启用跟踪”也是(通过命令行或通过手机本身)。