[MTK] Android Q userdebug 版本进入Launcher界面后保持UART Log输出

文摘 Android MediaTek 2020-04-9 阅读:7788

[DESCRIPTION]

为了防止Log过多导致系统 Performance 下降。MTK在手机完成bootup之后关闭了Uart Log的输出。本FAQ介绍两种方案,如何在开机完成后打开Uart Log。

[SOLUTION]

方案1. 全程打开Uart Log

/kernel-4.14/drivers/misc/mediatek/mtprof/bootprof.c

168 static void bootup_finish(void)
169 {
170 initcall_debug = 0;
171 #ifdef CONFIG_MTK_PRINTK_UART_CONSOLE
172 mt_disable_uart(); // bootup完成后有显示关闭Uart导致的
173 #endif
174 #ifdef CONFIG_MTK_SCHED_MON_DEFAULT_ENABLE
175 mt_sched_monitor_switch(1);
176 #endif
177 set_logtoomuch_enable(1);
178 }

解法: 上述mt_disable_uart(); 注释即可.

方案2. 动态开关Uart Log (bootup后一段时间内的Log可能会丢失)

命令: adb shell echo 1 > /proc/mtprintk

mtprintk 配置说明:
k62v1_64_bsp:/ # cat /proc/mtprintk
=== mt printk controller ===
0: printk uart disable
1: printk uart enable
2: printk too much disable
3: printk too much enable
xxx: printk too much detect count(xxx represents for a integer > 100)
=== mt printk controller ===

0条评论

© 2024 芯缘异码. Powered by Typecho