# CONFIG_PERF_EVENTS is not set
# CONFIG_HW_PERF_EVENTS is not set
# CONFIG_PROFILING is not set
# CONFIG_EVENT_TRACING is not set
# CONFIG_EVENT_POWER_TRACING_DEPRECATED is not set
# CONFIG_CONTEXT_SWITCH_TRACER is not set
# CONFIG_GENERIC_TRACER is not set
# CONFIG_TRACING is not set
# CONFIG_FTRACE is not set
# CONFIG_TRACEPOINTS is not set
# CONFIG_PERF_EVENTS is not set
# CONFIG_HW_PERF_EVENTS is not set
2. 掛載debugfs文件,可以有兩種方式:
a、在system/core/init/init.c掛載debugfs
mount("debugfs", "/sys/kernel/debug", "debugfs", 0, NULL);
b、在init.rc裏面掛載debugfs
mount("debugfs", "/sys/kernel/debug", "debugfs", 0, NULL)
3、修改system/core/adb/adb.c:
在should_drop_privileges()函數中,修改爲如下:
#ifndef ALLOW_ADBD_ROOT
return 0; // 由1變成0,以便User有adb root權限
4. user load開啓traceview權限:
在build/core/main.mk 中設置,搜索"ro.debuggable",在出現第二處,將ro.debuggable=0改ro.debuggable=1。
編譯成User模式的image,燒寫手機,在Settings->About Phone->Build number,連續點擊7次後即可打開開發者選項,可以勾選相應的systrace選項,抓取systrace文件。