All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 20/22] brcmfmac: add trace event for capturing BDC header
Date: Thu, 6 Jun 2013 13:18:05 +0200	[thread overview]
Message-ID: <1370517487-14395-21-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1370517487-14395-1-git-send-email-arend@broadcom.com>

The BDC header contains PropTx TLV signals that are useful to capture
for debugging. This event captures the header and tlv's in binary
form. This can be post-processed using trace-cmd plugin.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c  |    3 +++
 .../net/wireless/brcm80211/brcmfmac/tracepoint.h   |   21 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
index 59c77aa..dd85401 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
@@ -30,6 +30,7 @@
 #include "dhd_bus.h"
 #include "fwsignal.h"
 #include "dhd_dbg.h"
+#include "tracepoint.h"
 
 struct brcmf_proto_cdc_dcmd {
 	__le32 cmd;	/* dongle command value */
@@ -292,6 +293,7 @@ void brcmf_proto_hdrpush(struct brcmf_pub *drvr, int ifidx, u8 offset,
 	h->flags2 = 0;
 	h->data_offset = offset;
 	BDC_SET_IF_IDX(h, ifidx);
+	trace_brcmf_bdchdr(pktbuf->data);
 }
 
 int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
@@ -309,6 +311,7 @@ int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
 		return -EBADE;
 	}
 
+	trace_brcmf_bdchdr(pktbuf->data);
 	h = (struct brcmf_proto_bdc_header *)(pktbuf->data);
 
 	*ifidx = BDC_GET_IF_IDX(h);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/tracepoint.h b/drivers/net/wireless/brcm80211/brcmfmac/tracepoint.h
index 9df1f7a..bc29171 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/tracepoint.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/tracepoint.h
@@ -87,6 +87,27 @@ TRACE_EVENT(brcmf_hexdump,
 	TP_printk("hexdump [length=%lu]", __entry->len)
 );
 
+TRACE_EVENT(brcmf_bdchdr,
+	TP_PROTO(void *data),
+	TP_ARGS(data),
+	TP_STRUCT__entry(
+		__field(u8, flags)
+		__field(u8, prio)
+		__field(u8, flags2)
+		__field(u32, siglen)
+		__dynamic_array(u8, signal, *((u8 *)data + 3) * 4)
+	),
+	TP_fast_assign(
+		__entry->flags = *(u8 *)data;
+		__entry->prio = *((u8 *)data + 1);
+		__entry->flags2 = *((u8 *)data + 2);
+		__entry->siglen = *((u8 *)data + 3) * 4;
+		memcpy(__get_dynamic_array(signal),
+		       (u8 *)data + 4, __entry->siglen);
+	),
+	TP_printk("bdc: prio=%d siglen=%d", __entry->prio, __entry->siglen)
+);
+
 #ifdef CONFIG_BRCM_TRACING
 
 #undef TRACE_INCLUDE_PATH
-- 
1.7.10.4



  parent reply	other threads:[~2013-06-06 11:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 11:17 [PATCH 00/22] brcmfmac: firmware-signalling fixes and cleanup Arend van Spriel
2013-06-06 11:17 ` [PATCH 01/22] brcmfmac: allow firmware-signal tlv to be longer than specified Arend van Spriel
2013-06-06 11:17 ` [PATCH 02/22] brcmfmac: remove fifo bitfield from brcmf_skbuff_cb::if_flags Arend van Spriel
2013-06-06 11:17 ` [PATCH 03/22] brcmfmac: Take bus flowcontrol at credit mgmt into account Arend van Spriel
2013-06-06 11:17 ` [PATCH 04/22] brcmfmac: rework credit pickup to assure consistent handling Arend van Spriel
2013-06-06 11:17 ` [PATCH 05/22] brcmfmac: explicitly indicate sk_buff is sent upon request credit Arend van Spriel
2013-06-06 11:17 ` [PATCH 06/22] brcmfmac: reducing debug logging in firmware-signalling code Arend van Spriel
2013-06-06 11:17 ` [PATCH 07/22] brcmfmac: On bus flow control use fw signalling or netif Arend van Spriel
2013-06-06 11:17 ` [PATCH 08/22] brcmfmac: For FW signalling it is necessary to track gen bit Arend van Spriel
2013-06-06 11:17 ` [PATCH 09/22] brcmfmac: Correct creditmap when credit borrowing is active Arend van Spriel
2013-06-06 11:17 ` [PATCH 10/22] brcmfmac: Sent TIM information in case of data available Arend van Spriel
2013-06-06 11:17 ` [PATCH 11/22] brcmfmac: Find correct MAC descriptor in case of TDLS Arend van Spriel
2013-06-06 11:17 ` [PATCH 12/22] brcmfmac: fix invalid ifp lookup in firmware-signalling Arend van Spriel
2013-06-06 11:17 ` [PATCH 13/22] brcmfmac: Accept only first creditmap event Arend van Spriel
2013-06-06 11:17 ` [PATCH 14/22] brcmfmac: Signalling header push and pull on logic places Arend van Spriel
2013-06-06 11:18 ` [PATCH 15/22] brcmfmac: Fix endless loop when brcmf_fws_commit_skb fails Arend van Spriel
2013-06-06 11:18 ` [PATCH 16/22] brcmfmac: Simplify counting transit count Arend van Spriel
2013-06-06 11:18 ` [PATCH 17/22] brcmfmac: fix send_pkts statistic counter in firmware-signalling Arend van Spriel
2013-06-06 11:18 ` [PATCH 18/22] brcmfmac: Always use fifo_credits, also for requested credits Arend van Spriel
2013-06-06 11:18 ` [PATCH 19/22] brcmfmac: use credit mechanism for BC/MC if support by firmware Arend van Spriel
2013-06-06 11:18 ` Arend van Spriel [this message]
2013-06-06 11:18 ` [PATCH 21/22] brcmfmac: increment hard_header_len instead of overriding Arend van Spriel
2013-06-06 11:18 ` [PATCH 22/22] brcmfmac: add debugfs statistics for firmware-signalling Arend van Spriel
2013-06-11 20:27 ` [PATCH 00/22] brcmfmac: firmware-signalling fixes and cleanup Arend van Spriel
2013-06-11 20:59   ` John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370517487-14395-21-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.