# Debug

Source: [https://docs.qualcomm.com/doc/80-70017-14/topic/report_a_w_fi_issue_to_qualcomm.html](https://docs.qualcomm.com/doc/80-70017-14/topic/report_a_w_fi_issue_to_qualcomm.html)

If you experience issues with configuring or using Wi-Fi features, you can report them to
                [Qualcomm](https://www.qualcomm.com/support). You can also collect logs from various modules for troubleshooting
            purposes.

### Report Wi-Fi issues

To report an issue to [Qualcomm](https://www.qualcomm.com/support), provide the following details.

- Provide setup information 

| Information type | Description |
    | --- | --- |
    | Platform information | Platform name and software version |
    | Wi-Fi AP information | Model name, channel/mode/bandwidth/security, and firmware<br>                                        version |
    | Related logs | For more information, see Logs for ath11k. |
    | Test setup, steps, and expected result | Test procedures used while reporting the issue. |
- Package all log files for debugging and report them to Qualcomm. 
The
                        following table lists the logs required to report an issue.

| Log name | Protocol issues | Throughput issues |
    | --- | --- | --- |
    | Host driver logs | Required | Required |
    | Firmware logs | Required | Required |
    | Wireless sniffer logs | Recommended | Required |
    | Supplicant logs | Required | Required |

## Logs for ath11k

Source: [https://docs.qualcomm.com/doc/80-70017-14/topic/report_a_w_fi_issue_to_qualcomm.html](https://docs.qualcomm.com/doc/80-70017-14/topic/report_a_w_fi_issue_to_qualcomm.html)

The Wi-Fi subsystem offers tools and logs to assist with troubleshooting issues.

### Pull Wpa\_supplicant logs

If you observe any issue, run the following command to collect wpa\_supplicant logs:

    scp -r root@<ip_addr>:/tmp/wpa_supplicant-log.txt .Copy to clipboard

For example, if the IP address of the DUT is `192.168.1.22`, run the
                following
                command:

    scp -r root@192.168.1.22:/tmp/wpa_supplicant-log.txt .Copy to clipboard

### Pull Wi-Fi host driver and firmware logs

To pull the Wi-Fi host driver and firmware logs for the ath11k driver, do the
                following:

1. Run the `trace-cmd` tool on the DUT as follows:

    - For the entire log, run the following command:

            trace-cmd record -e ath11k_htt_pktlog -e ath11k_htt_ppdu_stats -e ath11k_htt_rxdesc -e ath11k_log_err -e ath11k_log_warn -e ath11k_log_info -e ath11k_wmi_cmd -e ath11k_wmi_event -e ath11k_log_dbg -e ath11k_log_dbg_dump -e ath11k_wmi_diag -e ath11k_ps_timekeeperCopy to clipboard
    - For firmware log, run the following command:

            trace-cmd record -e ath11k_wmi_diagCopy to clipboard
2. Run the intended test case or reproduce the issue.
3. Stop `trace-cmd` by pressing **Ctrl + C**.

    The `trace.dat` log appears as follows:

    **Sample output**

root@qcm6490:/tmp#
        root@qcm6490:/tmp# trace-cmd record -e ath1lk_htt_pktlog -e ath1lk_htt_ppdu_stats -e athllk_htt_rxdesc -e ath11k_log_err -e ath11k_log_warn -e athllk_log_info
         -e ath1lk_wmi_cmd -e ath11k_wmi_event -e ath1lk_log_dbg -e ath1lk_log_dbg_dump -e ath11k_wmi_diag -e athllk_ps_timekeeper
        Hit Ctrl^C to stop recording
        ^CCPUO data recorded at offset=0x7fc000
        151552 bytes in size
        CPU1 data recorded at offset=0x821000
        163840 bytes in size
        CPU2 data recorded at offset=0x849000
        0 bytes in size
        CPU3 data recorded at offset=0x849000
        0 bytes in size
        CPU4 data recorded at offset=0x849000
        0 bytes in size
        CPU5 data recorded at offset=0x849000
        0 bytes in size
        CPU6 data recorded at offset=0x849000
        0 bytes in size
        CPU7 data recorded at offset=0x849000
        0 bytes in size
        root@qcm6490:/tmp# ls -al
        ls: cannot access 'ssgtzd': Permission denied
        total 8600
        drwxrwxrwt. 10 root  root  280 Sep 16  06:21 .
        drwxr-xr-x. 22 root  root  4096 Sep  9 10:34 ..
        srw-rw-rw-. 1 system system   0 Apr 28  2022 property-vault.socket
        s?????????? ? ?       ?       ?            ? ssgtzd
        drwx------. 3 root   root   60 Apr 28 2022 systemd-private-e9b8fea895944dd5a0fd05770af20d6e-ModemManager.service-52N7rb
        drwx------. 3 root   root   60 Apr 28 2022 systemd-private-e9b8fea895944dd5a0fd05770af20d6e-bluetooth.service-1nYL2F
        drwx------. 3 root   root   60 Apr 28 2022 systemd-private-e9b8fea895944dd5a0fd05770af20d6e-chronyd.service-UmA8vV
        drwx------. 3 root   root   60 Jan  6 1980 systemd-private-e9b8fea895944dd5a0fd05770af20d6e-ninfod.service-nSxLqH
        drwx------. 3 root   root   60 Jan  6 1980 systemd-private-e9b8fea895944dd5a0fd05770af20d6e-rdisc.service-voag6w
        drwx------. 3 root   root   60 Apr 28 2022 systemd-private-e9b81ea895944dd5a0fd05770af20d6e-systemd-logind.service-kHhqPi
        drwx------. 3 root   root   60 Jan  6 1980 systemd-private-e9b8fea895944dd5a0fd05770af20d6e-systemd-resolved.service-hQ2tR3
        drwx------. 3 root   root   60 Jan  1 1970 systemd-private-e9b8fea895944dd5a0fd05770af20d6e-systemd-timesyncd.service-Ghf2u0
        -rw-r--r--. 1 root   root 8687616 Sep 16 06:21 trace.dat
        -rw-r-----. 1 root   root 114229 Sep 16 06:04 wpa_supplicant-log.txtCopy to clipboard
4. Copy the `trace.dat` log from the DUT to the Ubuntu host
                        device.
5. Get the host and firmware logs as follows:

    - To get the host log from the `trace.dat` log, run the
                                following command:

            trace-cmd report trace.dat > host.txtCopy to clipboard

        **Sample output**

jbhanu@hu-jbhanu-hyd:/local/mnt/workspace/ath11k$ ls -al
            total 18464
            drwxrwxr-x 2 jbhanu users    4096 Aug 15 08:48 .
            drwxrwxrwt 12 root root      4096 Aug 15 08:48 ..
            -rw-r--r-- 1 jbhanu users 18898944 Aug 15 08:48 trace.dat
            jbhanu@hu-jbhanu-hyd:/local/mnt/workspace/ath11k$ trace-cmd report trace.dat > host.txt
            jbhanu@hu-jbhanu-hyd:/local/mnt/workspace/ath11k$ ls -al
            total 19500
            drwxrwxr-x 2 jbhanu users    4096 Aug 15 08:48 .
            drwxrwxrwt 12 root  root     4096 Aug 15 08:48 ..
            -rw-rw-r-- 1  jbhanu users 1059505 Aug 15 08:48 host.txt
            -rw-r--r-- 1  jbhanu users 18898944 Aug 15 08:48 trace.dat
            jbhanu@hu-jbhanu-hyd:/local/mnt/workspace/ath11k$Copy to clipboard

Note: 
                                
You can install the `trace-cmd` tool by running
                                    the following command in the Ubuntu terminal:

            apt-get install trace-cmdCopy to clipboard
    - To get the firmware logs, share the `trace.dat` log and
                            issue details on the support portal.

### Capture driver logs in dmesg

The ath11k commands for dmesg are as follows:

    enum ath11k_debug_mask {
              ATH11K_DBG_AHB          = 0x00000001,
              ATH11K_DBG_WMI          = 0x00000002,
              ATH11K_DBG_HTC          = 0x00000004,
              ATH11K_DBG_DP_HTT       = 0x00000008,
              ATH11K_DBG_MAC          = 0x00000010,
              ATH11K_DBG_BOOT         = 0x00000020,
              ATH11K_DBG_QMI          = 0x00000040,
              ATH11K_DBG_DATA         = 0x00000080,
              ATH11K_DBG_MGMT         = 0x00000100,
              ATH11K_DBG_REG          = 0x00000200,
              ATH11K_DBG_TESTMODE     = 0x00000400,
              ATH11K_DBG_HAL          = 0x00000800,
              ATH11K_DBG_PCI          = 0x00001000,
              ATH11K_DBG_DP_TX        = 0x00002000,
              ATH11K_DBG_DP_RX        = 0x00004000,
              ATH11K_DBG_CE           = 0x00008000,
      };
    Copy to clipboard

You can use each command to get a specific log. For example,

- To get WMI-related driver logs, run the following command:

        echo 0x2 > /sys/module/ath11k/parameters/debug_maskCopy to clipboard
- To get host target communication (HTC) related logs, run the following
                    command:

        echo 0x4 > /sys/module/ath11k/parameters/debug_maskCopy to clipboard

### Wireless sniffer

A wireless sniffer intercepts the Wi-Fi frames over the air. Run the Wireshark
                software on any Linux or Windows device that can sniff the Wi-Fi frames.

### Collect firmware dump

When the device crashes, the firmware dump is saved as a BIN file at the
                    /var/spool/crash directory.

    sh-5.1# cd /var/spool/crash/
    sh-5.1# ls
    0000:01:00.0_2022-04-28_17-51-45.binCopy to clipboard

Share this dump
                file
                on
                the support portal.

## Logs for CLD driver

Source: [https://docs.qualcomm.com/doc/80-70017-14/topic/report_a_w_fi_issue_to_qualcomm.html](https://docs.qualcomm.com/doc/80-70017-14/topic/report_a_w_fi_issue_to_qualcomm.html)

The Wi-Fi subsystem offers tools and logs to assist with troubleshooting issues.

### Pull Wi-Fi host driver and firmware logs

Logs from the Wi-Fi host driver and firmware are in the
                    /var/persist/wlan\_logs directory.

The /usr/sbin/cnss\_diag module facilitates this logging.

To pull these logs, perform the following steps:

1. For continuous logging before any Wi-Fi operation, run the
                            `cnss_diag` in the background and then run the following
                        command:

        cnss_diag -s -f -q &Copy to clipboard

    **Sample                                output**

root@qcm6490:~# cnss_diag -s -f -q &
        [1] 4285
        root@qcm6490:~# diag: Diag_LSM_Init: invoked for pid: 4285 with init_count: 0
        diag:successfully connected to socket 3
        diag: Diag_LSM_Init: done for pid: 4285 with init_count: 1
        Diag LSM init done!diag: Successfully registered commands with the driver
        initialize_cnsslog_timer: create cnss log timer
        c1d80211 ctx init done, proceed to add mcast groupscnss_open_log_file: create directory /var/persist/wlan_logs/ ret = 0 errno= 2failed to open file a+ mode or file size 0 is less than max_file_size 31457280
        cnss_open_log_file: directory /var/persist/wlan_logs/ createdfailed to open file a+ mode or file size 0 is less than max_file_size 31457280
        radio_id:0 or gdiag_header is invalidradio_id:1 or gdiag_header is invalidcnss_open_log_file: directory /var/persist/wlan_logs/ createdloaded msc path:/lib/firmware/qcom/qcm6490/Data.msc chipset:0
        loaded msc path:/lib/firmware/qcom/qcm6490/Data.msc chipset:6750
        process_cnss_diag_msg: start cnss log timerCopy to clipboard
2. Pull the Wi-Fi logs at /var/persist/wlan\_logs by
                            running the following command in a separate command
                            prompt:

        scp -r root@192.168.1.22:/var/persist/wlan_logs/ .Copy to clipboard

    **Sample output**

C:\Users\jbhanu\Downloads\K2L>scp -r root@10.92.180.250:/var/persist/wlan_logs/.
        cnss_fw_logs_current.txt                                                                     100%  22MB  6.3MB/s  00:03
        cnss_fw_logs_000.txt                                                                         100%  30MB  5.8MB/s  00:05
        txrx_pktlog_current.dat                                                                      100%   0    0.0KB/s  00:00
        host_driver_logs_current.txt                                                                 100%  540KB 6.4MB/s  00:00
        cnss_fw_logs_001.txt                                                                         100%  30MB  5.8MB/s  00:05Copy to clipboard

Last Published: Dec 17, 2024

Previous Topic
 
Configure Next Topic

References