summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-02-11 02:48:49 +0000
committeradrian <adrian@FreeBSD.org>2013-02-11 02:48:49 +0000
commit283715c7dcf0c3852f95debb586debb8d9ec4605 (patch)
treeb6077e2b65a8ded5e3cba47a3b86f02d1e80e730
parent5eaca6e3c249ce1b1c88f20d90f7f1a96159b6cb (diff)
downloadFreeBSD-src-283715c7dcf0c3852f95debb586debb8d9ec4605.zip
FreeBSD-src-283715c7dcf0c3852f95debb586debb8d9ec4605.tar.gz
Extend the timestamp to be a timeval, rather than ticks.
This makes it easier to see TX and RX buffer latencies.
-rw-r--r--sys/dev/ath/if_ath_alq.c7
-rw-r--r--sys/dev/ath/if_ath_alq.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/ath/if_ath_alq.c b/sys/dev/ath/if_ath_alq.c
index bd83933..1ad13db 100644
--- a/sys/dev/ath/if_ath_alq.c
+++ b/sys/dev/ath/if_ath_alq.c
@@ -44,6 +44,7 @@
#include <sys/mutex.h>
#include <sys/alq.h>
#include <sys/endian.h>
+#include <sys/time.h>
#include <dev/ath/if_ath_alq.h>
@@ -153,10 +154,13 @@ if_ath_alq_post(struct if_ath_alq *alq, uint16_t op, uint16_t len,
{
struct if_ath_alq_hdr *ap;
struct ale *ale;
+ struct timeval tv;
if (! if_ath_alq_checkdebug(alq, op))
return;
+ microtime(&tv);
+
/*
* Enforce some semblence of sanity on 'len'.
* Although strictly speaking, any length is possible -
@@ -172,7 +176,8 @@ if_ath_alq_post(struct if_ath_alq *alq, uint16_t op, uint16_t len,
ap = (struct if_ath_alq_hdr *) ale->ae_data;
ap->threadid = htobe64((uint64_t) curthread->td_tid);
- ap->tstamp = htobe32((uint32_t) ticks);
+ ap->tstamp_sec = htobe32((uint32_t) tv.tv_sec);
+ ap->tstamp_usec = htobe32((uint32_t) tv.tv_usec);
ap->op = htobe16(op);
ap->len = htobe16(len);
diff --git a/sys/dev/ath/if_ath_alq.h b/sys/dev/ath/if_ath_alq.h
index cb37452..3748d50 100644
--- a/sys/dev/ath/if_ath_alq.h
+++ b/sys/dev/ath/if_ath_alq.h
@@ -116,7 +116,8 @@ struct if_ath_alq {
struct if_ath_alq_hdr {
uint64_t threadid;
- uint32_t tstamp;
+ uint32_t tstamp_sec;
+ uint32_t tstamp_usec;
uint16_t op;
uint16_t len; /* Length of (optional) payload */
};
OpenPOWER on IntegriCloud