[PATCH v2 09/21] ath10k: print fw debug messages in hex.

Valo, Kalle kvalo at qca.qualcomm.com
Wed Sep 14 07:18:05 PDT 2016


greearb at candelatech.com writes:

> From: Ben Greear <greearb at candelatech.com>
>
> This allows user-space tools to decode debug-log
> messages by parsing dmesg or /var/log/messages.
>
> Signed-off-by: Ben Greear <greearb at candelatech.com>

Don't tracing points already provide the same information?

> +void ath10k_dbg_print_fw_dbg_buffer(struct ath10k *ar, __le32 *ibuf, int len,
> +				    const char* lvl)
> +{
> +	/* Print out raw hex, external tools can decode if
> +	 * they care.
> +	 * TODO:  Add ar identifier to messages.
> +	 */
> +	int q = 0;
> +
> +	dev_printk(lvl, ar->dev, "ath10k_pci ATH10K_DBG_BUFFER:\n");
> +	while (q < len) {
> +		if (q + 8 <= len) {
> +			printk("%sath10k: [%04d]: %08X %08X %08X %08X %08X %08X %08X %08X\n",
> +			       lvl, q,
> +			       ibuf[q], ibuf[q+1], ibuf[q+2], ibuf[q+3],
> +			       ibuf[q+4], ibuf[q+5], ibuf[q+6], ibuf[q+7]);
> +			q += 8;
> +		}
> +		else if (q + 7 <= len) {
> +			printk("%sath10k: [%04d]: %08X %08X %08X %08X %08X %08X %08X\n",
> +			       lvl, q,
> +			       ibuf[q], ibuf[q+1], ibuf[q+2], ibuf[q+3],
> +			       ibuf[q+4], ibuf[q+5], ibuf[q+6]);
> +			q += 7;
> +		}
> +		else if (q + 6 <= len) {
> +			printk("%sath10k: [%04d]: %08X %08X %08X %08X %08X %08X\n",
> +			       lvl, q,
> +			       ibuf[q], ibuf[q+1], ibuf[q+2], ibuf[q+3],
> +			       ibuf[q+4], ibuf[q+5]);
> +			q += 6;
> +		}
> +		else if (q + 5 <= len) {
> +			printk("%sath10k: [%04d]: %08X %08X %08X %08X %08X\n",
> +			       lvl, q,
> +			       ibuf[q], ibuf[q+1], ibuf[q+2], ibuf[q+3],
> +			       ibuf[q+4]);
> +			q += 5;
> +		}
> +		else if (q + 4 <= len) {
> +			printk("%sath10k: [%04d]: %08X %08X %08X %08X\n",
> +			       lvl, q,
> +			       ibuf[q], ibuf[q+1], ibuf[q+2], ibuf[q+3]);
> +			q += 4;
> +		}
> +		else if (q + 3 <= len) {
> +			printk("%sath10k: [%04d]: %08X %08X %08X\n",
> +			       lvl, q,
> +			       ibuf[q], ibuf[q+1], ibuf[q+2]);
> +			q += 3;
> +		}
> +		else if (q + 2 <= len) {
> +			printk("%sath10k: [%04d]: %08X %08X\n",
> +			       lvl, q,
> +			       ibuf[q], ibuf[q+1]);
> +			q += 2;
> +		}
> +		else if (q + 1 <= len) {
> +			printk("%sath10k: [%04d]: %08X\n",
> +			       lvl, q,
> +			       ibuf[q]);
> +			q += 1;
> +		}
> +		else {
> +			break;
> +		}
> +	}/* while */
> +
> +	dev_printk(lvl, ar->dev, "ATH10K_END\n");
> +}

Isn't this almost the same as what ath10k_dbg_dump() does?

-- 
Kalle Valo


More information about the ath10k mailing list