svn commit: r246648 - head/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Mon Feb 11 02:48:50 UTC 2013


Author: adrian
Date: Mon Feb 11 02:48:49 2013
New Revision: 246648
URL: http://svnweb.freebsd.org/changeset/base/246648

Log:
  Extend the timestamp to be a timeval, rather than ticks.
  
  This makes it easier to see TX and RX buffer latencies.

Modified:
  head/sys/dev/ath/if_ath_alq.c
  head/sys/dev/ath/if_ath_alq.h

Modified: head/sys/dev/ath/if_ath_alq.c
==============================================================================
--- head/sys/dev/ath/if_ath_alq.c	Mon Feb 11 02:15:26 2013	(r246647)
+++ head/sys/dev/ath/if_ath_alq.c	Mon Feb 11 02:48:49 2013	(r246648)
@@ -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, 
 {
 	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, 
 
 	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);
 

Modified: head/sys/dev/ath/if_ath_alq.h
==============================================================================
--- head/sys/dev/ath/if_ath_alq.h	Mon Feb 11 02:15:26 2013	(r246647)
+++ head/sys/dev/ath/if_ath_alq.h	Mon Feb 11 02:48:49 2013	(r246648)
@@ -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 */
 };


More information about the svn-src-all mailing list