ath10k: add trace event for WMI_DEBUG_MESG_EVENTID
authorKalle Valo <kvalo@qca.qualcomm.com>
Fri, 3 Jan 2014 10:59:26 +0000 (12:59 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 10 Jan 2014 09:49:33 +0000 (11:49 +0200)
Send firmware WMI debug logs to user space for further processing.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/trace.h
drivers/net/wireless/ath/ath10k/wmi.c

index 90817dd..4eb2ecb 100644 (file)
@@ -182,6 +182,27 @@ TRACE_EVENT(ath10k_htt_stats,
        )
 );
 
+TRACE_EVENT(ath10k_wmi_dbglog,
+       TP_PROTO(void *buf, size_t buf_len),
+
+       TP_ARGS(buf, buf_len),
+
+       TP_STRUCT__entry(
+               __field(size_t, buf_len)
+               __dynamic_array(u8, buf, buf_len)
+       ),
+
+       TP_fast_assign(
+               __entry->buf_len = buf_len;
+               memcpy(__get_dynamic_array(buf), buf, buf_len);
+       ),
+
+       TP_printk(
+               "len %zu",
+               __entry->buf_len
+       )
+);
+
 #endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
 
 /* we don't want to use include/trace/events */
index f992570..4e043bb 100644 (file)
@@ -1071,9 +1071,14 @@ static void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb)
        ath10k_dbg(ATH10K_DBG_WMI, "WMI_ECHO_EVENTID\n");
 }
 
-static void ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
+static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
 {
-       ath10k_dbg(ATH10K_DBG_WMI, "WMI_DEBUG_MESG_EVENTID\n");
+       ath10k_dbg(ATH10K_DBG_WMI, "wmi event debug mesg len %d\n",
+                  skb->len);
+
+       trace_ath10k_wmi_dbglog(skb->data, skb->len);
+
+       return 0;
 }
 
 static void ath10k_wmi_event_update_stats(struct ath10k *ar,