aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2013-02-11 02:48:49 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2013-02-11 02:48:49 +0000
commit81561d0459a3e35e6bfa0c8e850d7d45225e28a5 (patch)
treeb6077e2b65a8ded5e3cba47a3b86f02d1e80e730 /sys/dev
parent53d21f0bbe643981593626fc9238a9e16b013c64 (diff)
downloadsrc-81561d0459a3e35e6bfa0c8e850d7d45225e28a5.tar.gz
src-81561d0459a3e35e6bfa0c8e850d7d45225e28a5.zip
Extend the timestamp to be a timeval, rather than ticks.
This makes it easier to see TX and RX buffer latencies.
Notes
Notes: svn path=/head/; revision=246648
Diffstat (limited to 'sys/dev')
-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 bd8393378269..1ad13db5e75d 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 cb37452499c4..3748d50af7ed 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 */
};