安卓日志分析FAQ

日志关键字分析

Posted by LXG on April 7, 2025

移动网络数据开关问题

日志关键字:onDataEnabledChanged


10-26 13:49:41.184  2560  2560 D DCT-C   : onDataEnabledChanged: enable=true, enabledChangedReason=0
10-26 13:49:41.184  2560  2560 D DCT-C   : setupDataOnAllConnectableApns: dataEnabled default:[state=IDLE,enabled=false]
10-26 13:49:41.185  2560  2560 D DCT-C   : onDataEnabledOverrideRulesChanged
10-26 13:49:41.188  2560  2560 D DCT-C   : isEmergency: result=false
10-26 13:49:41.192  2560  2560 D SubscriptionController: [getActiveSubscriptionInfo]- subId=-1 subList=[] subInfo=null
10-26 13:49:41.194  2560  2560 D DCT-C   : onRadioAvailable
10-26 13:49:41.194  2560  2560 D DCT-C   : onDataConnectionDetached: stop polling and notify detached
10-26 13:49:41.194  2560  2560 D DCT-C   : stopNetStatPoll
10-26 13:49:41.195  2560  2560 D DCT-C   : get all active apn types
10-26 13:49:41.196  2560  2560 D DCT-C   : onDataRoamingOff
10-26 13:49:41.199  2560  2560 D DCT-C   : setDataProfilesAsNeeded
10-26 13:49:41.199  2560  2560 D DCT-C   : setInitialApn: E mPreferredApn=null
10-26 13:49:41.199  2560  2560 D DCT-C   : setInitialAttachApn: X There in no available apn
10-26 13:49:41.199  2560  2560 D DCT-C   : setupDataOnAllConnectableApns: roamingOff default:[state=IDLE,enabled=false]

客户问题:无法打开移动网络数据开关

日志分析:缺少有效的APN或者没有识别到SIM卡

BY 主板开机过程中启动scrcpy导致adb卡顿问题

内核日志


[   22.654086] configfs-gadget gadget: high-speed config #1: b
[   22.689081] ERR: Operation not supported
[   22.796453] read descriptors
[   22.799733] read strings
[   23.373274] android_work: did not send uevent (0 0           (null))
[   24.190051] configfs-gadget gadget: high-speed config #1: b
[   24.225047] ERR: Operation not supported
[   25.139619] axp803_usb_power: current limit setted: usb pc type
[   25.139619] 
[   25.161344] android_work: sent uevent USB_STATE=CONNECTED
[   25.172468] android_work: sent uevent USB_STATE=CONFIGURED

adb异常日志


2011-01-01 20:00:07.429  2188-2188  adbd                    adbd                                 I  adbd listening on port 5555
2011-01-01 20:00:07.429  2188-2209  adbd                    adbd                                 I  opening control endpoint /dev/usb-ffs/adb/ep0
2011-01-01 20:00:07.622  2188-2209  adbd                    adbd                                 I  UsbFfsConnection constructed
2011-01-01 20:00:08.479  2188-2228  adbd                    adbd                                 I  USB event: FUNCTIONFS_BIND
2011-01-01 20:00:08.878  2188-2228  adbd                    adbd                                 I  USB event: FUNCTIONFS_ENABLE
2011-01-01 20:00:08.916  2188-2188  adbd                    adbd                                 I  UsbFfs: already offline
--------- beginning of crash
2025-04-27 10:39:00.848  2188-2318  adbd                    adbd                                 I  UsbFfs: connection terminated: read 1884 failed with error Cannot send after transport endpoint shutdown
2025-04-27 10:39:00.849  2188-2228  adbd                    adbd                                 E  failed to send interruption signal to worker: No such process
2025-04-27 10:39:00.855  2188-2188  adbd                    adbd                                 I  UsbFfs: offline
2025-04-27 10:39:01.314  2188-2188  adbd                    adbd                                 I  destroying transport UsbFfs
2025-04-27 10:39:01.315  2188-2188  adbd                    adbd                                 I  UsbFfsConnection being destroyed
2025-04-27 10:39:01.448  2188-2209  adbd                    adbd                                 I  opening control endpoint /dev/usb-ffs/adb/ep0
2025-04-27 10:39:02.042  2188-2209  adbd                    adbd                                 I  UsbFfsConnection constructed
2025-04-27 10:39:02.206  2188-3395  adbd                    adbd                                 I  USB event: FUNCTIONFS_BIND
2025-04-27 10:39:02.315  2188-2188  adbd                    adbd                                 W  timeout expired while flushing socket, closing
2025-04-27 10:39:02.849  2188-3395  adbd                    adbd                                 I  USB event: FUNCTIONFS_ENABLE
2025-04-27 10:39:03.833  2188-2188  adbd                    adbd                                 I  UsbFfs: already offline
2025-04-27 10:39:25.098  2188-2188  adbd                    adbd                                 W  timeout expired while flushing socket, closing
2025-04-27 10:39:44.247  2188-2188  adbd                    adbd                                 W  timeout expired while flushing socket, closing
2025-04-27 10:39:46.355  2188-2188  adbd                    adbd                                 W  timeout expired while flushing socket, closing

BE主板正常日志


1970-01-01 08:00:10.787  1836-1871  adbd                    adbd                                 I  opening control endpoint /dev/usb-ffs/adb/ep0
1970-01-01 08:00:11.328  1836-1871  adbd                    adbd                                 I  UsbFfsConnection constructed
1970-01-01 08:00:11.833  1836-1879  adbd                    adbd                                 I  USB event: FUNCTIONFS_BIND
1970-01-01 08:00:12.408  1836-1879  adbd                    adbd                                 I  USB event: FUNCTIONFS_ENABLE
1970-01-01 08:00:12.447  1836-1836  adbd                    adbd                                 I  UsbFfs: already offline
2025-04-27 11:50:54.679  1836-1879  adbd                    adbd                                 I  USB event: FUNCTIONFS_DISABLE
2025-04-27 11:50:54.697  1836-2039  adbd                    adbd                                 I  UsbFfs: connection terminated: read 684 failed with error Cannot send after transport endpoint shutdown
2025-04-27 11:50:54.698  1836-1836  adbd                    adbd                                 I  UsbFfs: offline
2025-04-27 11:50:55.160  1836-1836  adbd                    adbd                                 I  destroying transport UsbFfs
2025-04-27 11:50:55.165  1836-1836  adbd                    adbd                                 I  UsbFfsConnection being destroyed
2025-04-27 11:50:55.205  1836-1871  adbd                    adbd                                 I  opening control endpoint /dev/usb-ffs/adb/ep0
2025-04-27 11:50:57.611  1836-1871  adbd                    adbd                                 I  UsbFfsConnection constructed
2025-04-27 11:50:57.973  1836-3108  adbd                    adbd                                 I  USB event: FUNCTIONFS_BIND
2025-04-27 11:50:58.489  1836-3108  adbd                    adbd                                 I  USB event: FUNCTIONFS_ENABLE
2025-04-27 11:50:58.605  1836-1836  adbd                    adbd                                 I  UsbFfs: already offline

AI 分析结论

USB Gadget配置失败导致adbd异常,连接状态不稳定,导致adb服务后续卡顿甚至崩溃。

  • Android设备在开机时用 configfs gadget 来动态配置USB设备(即作为ADB设备)。
  • 设备(A133)在第一次尝试时 配置失败,导致了adbd工作线程混乱。
  • 虽然最终adb逻辑层(用户空间)连上了,但内核里USB子系统处于异常状态,所以adb数据交换异常卡顿。
  • scrcpy又进一步加大数据流量(大量屏幕帧数据流通过adb),放大了这个异常,出现卡死甚至socket flush timeout