All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janusz Dziedzic <janusz.dziedzic@tieto.com>
To: linux-wireless@vger.kernel.org
Cc: ath9k-devel@lists.ath9k.org, Janusz Dziedzic <janusz.dziedzic@tieto.com>
Subject: [PATCH 12/12] ath9k: MCC, print time elapsed between events
Date: Thu, 12 Nov 2015 14:15:49 +0100	[thread overview]
Message-ID: <1447334149-15507-12-git-send-email-janusz.dziedzic@tieto.com> (raw)
In-Reply-To: <1447334149-15507-1-git-send-email-janusz.dziedzic@tieto.com>

This is useful for MCC debugging and bug fixing.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 drivers/net/wireless/ath/ath9k/ath9k.h   |  1 +
 drivers/net/wireless/ath/ath9k/channel.c | 19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 4616229..952a467 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -983,6 +983,7 @@ struct ath_softc {
 	struct ath_offchannel offchannel;
 	struct ath_chanctx *next_chan;
 	struct completion go_beacon;
+	struct timespec last_event_time;
 #endif
 
 	unsigned long driver_data;
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index b0d74f0..d6b1076 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -226,6 +226,20 @@ static const char *chanctx_state_string(enum ath_chanctx_state state)
 	}
 }
 
+static const u32 chanctx_event_delta(struct ath_softc *sc)
+{
+	u64 ms;
+	struct timespec ts, *old;
+
+	getrawmonotonic(&ts);
+	old = &sc->last_event_time;
+	ms = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
+	ms -= old->tv_sec * 1000 + old->tv_nsec / 1000000;
+	sc->last_event_time = ts;
+
+	return (u32)ms;
+}
+
 void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx)
 {
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
@@ -507,10 +521,11 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
 
 	spin_lock_bh(&sc->chan_lock);
 
-	ath_dbg(common, CHAN_CTX, "cur_chan: %d MHz, event: %s, state: %s\n",
+	ath_dbg(common, CHAN_CTX, "cur_chan: %d MHz, event: %s, state: %s, delta: %u ms\n",
 		sc->cur_chan->chandef.center_freq1,
 		chanctx_event_string(ev),
-		chanctx_state_string(sc->sched.state));
+		chanctx_state_string(sc->sched.state),
+		chanctx_event_delta(sc));
 
 	switch (ev) {
 	case ATH_CHANCTX_EVENT_BEACON_PREPARE:
-- 
1.9.1


WARNING: multiple messages have this Message-ID (diff)
From: Janusz Dziedzic <janusz.dziedzic@tieto.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH 12/12] ath9k: MCC, print time elapsed between events
Date: Thu, 12 Nov 2015 14:15:49 +0100	[thread overview]
Message-ID: <1447334149-15507-12-git-send-email-janusz.dziedzic@tieto.com> (raw)
In-Reply-To: <1447334149-15507-1-git-send-email-janusz.dziedzic@tieto.com>

This is useful for MCC debugging and bug fixing.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 drivers/net/wireless/ath/ath9k/ath9k.h   |  1 +
 drivers/net/wireless/ath/ath9k/channel.c | 19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 4616229..952a467 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -983,6 +983,7 @@ struct ath_softc {
 	struct ath_offchannel offchannel;
 	struct ath_chanctx *next_chan;
 	struct completion go_beacon;
+	struct timespec last_event_time;
 #endif
 
 	unsigned long driver_data;
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index b0d74f0..d6b1076 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -226,6 +226,20 @@ static const char *chanctx_state_string(enum ath_chanctx_state state)
 	}
 }
 
+static const u32 chanctx_event_delta(struct ath_softc *sc)
+{
+	u64 ms;
+	struct timespec ts, *old;
+
+	getrawmonotonic(&ts);
+	old = &sc->last_event_time;
+	ms = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
+	ms -= old->tv_sec * 1000 + old->tv_nsec / 1000000;
+	sc->last_event_time = ts;
+
+	return (u32)ms;
+}
+
 void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx)
 {
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
@@ -507,10 +521,11 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
 
 	spin_lock_bh(&sc->chan_lock);
 
-	ath_dbg(common, CHAN_CTX, "cur_chan: %d MHz, event: %s, state: %s\n",
+	ath_dbg(common, CHAN_CTX, "cur_chan: %d MHz, event: %s, state: %s, delta: %u ms\n",
 		sc->cur_chan->chandef.center_freq1,
 		chanctx_event_string(ev),
-		chanctx_state_string(sc->sched.state));
+		chanctx_state_string(sc->sched.state),
+		chanctx_event_delta(sc));
 
 	switch (ev) {
 	case ATH_CHANCTX_EVENT_BEACON_PREPARE:
-- 
1.9.1

  parent reply	other threads:[~2015-11-12 13:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 13:15 [PATCH 01/12] ath9k: add debug messages to aggr/chanctx funcs Janusz Dziedzic
2015-11-12 13:15 ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:15 ` [PATCH 02/12] ath9k: print real timer value Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:15 ` [PATCH 03/12] ath9k: queue null frames in case of MCC Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:15 ` [PATCH 04/12] ath9k: P2P_CLIENT, send frames after 1ms AP/GO will aprear Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:15 ` [PATCH 05/12] ath9k: use u32 when calculate tsf Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 19:51   ` Kalle Valo
2015-11-12 19:51     ` [ath9k-devel] " Kalle Valo
2015-11-12 13:15 ` [PATCH 06/12] ath9k: setup correct skb priority for nullfunc Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:15 ` [PATCH 07/12] ath9k: MCC enable Opportunistic Power Save Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:15 ` [PATCH 08/12] ath9k: P2P_CLIENT, get/set NOA correctly Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:15 ` [PATCH 09/12] ath9k: request NOA update when chanctx active Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:59   ` kbuild test robot
2015-11-12 14:09     ` [ath9k-devel] " kbuild test robot
2015-11-12 13:15 ` [PATCH 10/12] ath9k: MCC, add NOA also in case of an AP Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:15 ` [PATCH 11/12] ath9k: MCC add sta_ap_ratio module param Janusz Dziedzic
2015-11-12 13:15   ` [ath9k-devel] " Janusz Dziedzic
2015-11-12 13:15 ` Janusz Dziedzic [this message]
2015-11-12 13:15   ` [ath9k-devel] [PATCH 12/12] ath9k: MCC, print time elapsed between events Janusz Dziedzic

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=1447334149-15507-12-git-send-email-janusz.dziedzic@tieto.com \
    --to=janusz.dziedzic@tieto.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=linux-wireless@vger.kernel.org \
    /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.