Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Feb 2013 02:48:49 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r246648 - head/sys/dev/ath
Message-ID:  <201302110248.r1B2mnlE013297@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */
 };



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302110248.r1B2mnlE013297>