参考高通文档:80-76240-16_REV_AA_Wi-Fi_Debug_Techniques
大纲
一、 WLAN Debug Logs –logcat
■ Logcat log logcat is a command-line tool that dumps the log of system messages,
■ Including stack traces when the device throws an error.
■ Need to enable WLAN verbose log before capturing logcat log.
■ Option1 by Android UI
Activate Developer Options
Goto Settings -> System -> About Phone -> BuildNumber (Click this 7 times)
Enable Wifi Verbose logging
Goto Settings -> System -> Advanced -> Develop Options -> Enable Wifi Verbose logging
Option 2 by command line
Run below command at adb shell, then reboot target
#cmd wifi set-verbose-logging enabled
#cmd wifi is-verbose-logging
二、WPA_SUPPLICANT default debug level is debug
to enable more debug log, you can try below:
msmnile_au:/ # wpa_cli log_level EXCESSIVE
enum {MSG_EXCESSIVE, MSG_MSGDUMP, MSG_DEBUG, MSG_INFO, MSG_WARNING, MSG_ERROR}
三、WLAN Driver/FW log
1、By default, WLAN log will be saved at below directory in your target.
/data/vendor/wifi/wlan_logs/
msmnile_gvmq:/data/vendor/wifi/wlan_logs # ls -al
-rw-r--r-- 1 system system 18538947 2023-03-26 16:39 cnss_fw_logs_current.txt
-rw-r--r-- 1 system system 30971954 2023-03-26 15:38 host_driver_logs_current.txt
实际的8155下看的是
#:/data/vendor/wifi/wlan_logs # ls -lh total 15M -rw-r--r-- 1 system system 0 1970-01-01 08:00 cnss_fw_logs_current.txt -rw-r--r-- 1 system system 30M 2024-12-27 05:48 host_driver_logs_000.txt -rw-r--r-- 1 system system 32 2024-12-27 05:48 host_driver_logs_current.txt -rw-r--r-- 1 system system 0 1970-01-01 08:00 txrx_pktlog_current.dat
2、If your FW log size is 0, follow below to enable WLAN FW log.
1、Make sure below file is existed in your target.
/vendor/firmware_mnt/image/qcXXX/Data.msc
2、Make sure below INI setting
vendor/etc/wifi/qcn7605/WCNSS_qcom_cfg.ini
gEnablefwlog=1
gFwDebugLogLevel=0
gFwDebugModuleLoglevel=1,1,2,1,3,1,4,0,5,1,6,0,7,0,8,1,9,1,13,1,14,1,17,1,18,1,19,1,22,1,26,1,28,1,29,1,31,1,36,1,38,1,46,1,47,1,50,1,52,1,53,1,56,1,60,1,61,1
2.1 The default WLAN log saves latest 2 archives with 30M size, if you need more logs to debug, try below changes:
modify /data/vendor/wifi/cnss_diag.conf, change to max 10 file and each 100M.
original:
MAX_LOG_FILE_SIZE = 30 // 30M each file
MAX_ARCHIVES = 2 // max log segment
modify:
MAX_LOG_FILE_SIZE = 100 // 100M each file
MAX_ARCHIVES = 10
2.2 How to change debug host log level?
Modify WCNSS_qcom_cfg.ini
gHostModuleLoglevel
描述:Input Module ID and Log level alternately and continuously
Module ID: Please refer QDF_MODULE_ID in qcacld source code.
Debug Level:
enum host_log_level {
HOST_LOG_LEVEL_NONE = 0, HOST_LOG_LEVEL_FATAL, HOST_LOG_LEVEL_ERROR,
HOST_LOG_LEVEL_WARN, HOST_LOG_LEVEL_INFO, HOST_LOG_LEVEL_DEBUG,
HOST_LOG_LEVEL_TRACE, HOST_LOG_LEVEL_MAX,
};
Example: gHostModuleLoglevel=51, 1, 52, 2, 53, 4, 54, 5, 56, 6
51/52/53/54/56 are Module ID
1/2/4/5/6 are Debug Level.
五、待继续
六、 博世公司抓驱动日志
分析VCS Wifi连接问题需要抓取相关log和配置信息,抓取方法流程顺序如下:
1、设置log登记,命令如下
adb root
adb remount
adb shell setprop persist.log.tag D
adb shell setprop persist.wifi.debug.level.enable true
adb shell settings put global wifi_verbose_logging_enable 1
adb shell setprop persist.log.tag.wpa_supplicant DEBUG
adb shell wpa_cli log_level MSGDUMP
并修改Android系统中/vendor/etc/wifi/qca6390/WCNSS_qcom_cfg.ini文件下面几项,然后重启生效
gMulticastHostFwMsgs=1
gEnablefwlog=1
gFwDebugLogLevel=3
2、将wifi相关配置信息保存到电脑端,adb命令如下:
adb root
adb remount
adb pull /vendor/firmware_mnt/verinfo/ver_info.txt ./
adb pull /data/vendor/wifi/hostapd/hostapd_swkan0.conf ./
3、QA复现问题前先开始抓wifi-driver和wifi-dmesg.log,adb命令如下:
adb root
adb shell cnss_diag -f -c > wifi-dirver.txt //此命令在复现问题之前执行,复现问题后Ctrl+c停止
adb shell dmesg -w > ./wifi-dmesg.txt //此命令在复现问题之前执行,复现问题后Ctrl+c停止
1、上面的cnss_diag -f -c > wifi-dirver.txt 后,在/data/vendor/wifi/wlan_logs有firware log
但用cnss_diag -q -f ,日志应该也有
参考:https://blog.csdn.net/feelinghappy/article/details/108536224
2、8155 驱动和固件日志的大小设置
/data/vendor/wifi/cnss_diag.conf
1|hqcos:/ # cat /data/vendor/wifi/cnss_diag.conf
LOG_PATH_FLAG = 1
MAX_LOG_FILE_SIZE = 30
MAX_ARCHIVES = 2
MAX_PKTLOG_ARCHIVES = 4
LOG_STORAGE_PATH = /data/vendor/wifi/wlan_logs/
AVAILABLE_MEMORY_THRESHOLD = 100
MAX_LOG_BUFFER = 2
MAX_PKTLOG_BUFFER = 10
HOST_LOG_FILE = /data/vendor/wifi/wlan_logs/buffered_cnsshost_log.txt
FIRMWARE_LOG_FILE = /data/vendor/wifi/wlan_logs/buffered_cnssfw_log.txt
ENABLE_FLUSH_LOG = 0
REAL_TIME_WRITE = 0
cnssdiag: 抓取wifi固件的日志
vendor/qcom/proprietary/wlan/common-tools/cnssdiag/
固件加载流程和cnss_daemon