Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2012 20:46:20 +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: r233887 - in head: sys/dev/ath sys/dev/ath/ath_hal tools/tools/ath/athdecode
Message-ID:  <201204042046.q34KkKS6024273@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed Apr  4 20:46:20 2012
New Revision: 233887
URL: http://svn.freebsd.org/changeset/base/233887

Log:
  Add a threadid to the ah_decode API.
  
  This adds the current thread ID to each logged register and mark entry,
  allowing for easier debugging of concurrent/overlapping NIC operations.

Modified:
  head/sys/dev/ath/ah_osdep.c
  head/sys/dev/ath/ath_hal/ah_decode.h
  head/tools/tools/ath/athdecode/main.c

Modified: head/sys/dev/ath/ah_osdep.c
==============================================================================
--- head/sys/dev/ath/ah_osdep.c	Wed Apr  4 20:42:45 2012	(r233886)
+++ head/sys/dev/ath/ah_osdep.c	Wed Apr  4 20:46:20 2012	(r233887)
@@ -38,6 +38,7 @@
 #include <sys/bus.h>
 #include <sys/malloc.h>
 #include <sys/proc.h>
+#include <sys/pcpu.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
 
@@ -257,6 +258,7 @@ ath_hal_reg_write(struct ath_hal *ah, u_
 		struct ale *ale = ath_hal_alq_get(ah);
 		if (ale) {
 			struct athregrec *r = (struct athregrec *) ale->ae_data;
+			r->threadid = curthread->td_tid;
 			r->op = OP_WRITE;
 			r->reg = reg;
 			r->val = val;
@@ -296,6 +298,7 @@ ath_hal_reg_read(struct ath_hal *ah, u_i
 		struct ale *ale = ath_hal_alq_get(ah);
 		if (ale) {
 			struct athregrec *r = (struct athregrec *) ale->ae_data;
+			r->threadid = curthread->td_tid;
 			r->op = OP_READ;
 			r->reg = reg;
 			r->val = val;
@@ -312,6 +315,7 @@ OS_MARK(struct ath_hal *ah, u_int id, u_
 		struct ale *ale = ath_hal_alq_get(ah);
 		if (ale) {
 			struct athregrec *r = (struct athregrec *) ale->ae_data;
+			r->threadid = curthread->td_tid;
 			r->op = OP_MARK;
 			r->reg = id;
 			r->val = v;

Modified: head/sys/dev/ath/ath_hal/ah_decode.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_decode.h	Wed Apr  4 20:42:45 2012	(r233886)
+++ head/sys/dev/ath/ath_hal/ah_decode.h	Wed Apr  4 20:46:20 2012	(r233887)
@@ -29,6 +29,7 @@
  * existing file.
  */
 struct athregrec {
+	uint32_t	threadid;
 	uint32_t	op	: 8,
 			reg	: 24;
 	uint32_t	val;

Modified: head/tools/tools/ath/athdecode/main.c
==============================================================================
--- head/tools/tools/ath/athdecode/main.c	Wed Apr  4 20:42:45 2012	(r233886)
+++ head/tools/tools/ath/athdecode/main.c	Wed Apr  4 20:46:20 2012	(r233887)
@@ -375,7 +375,7 @@ oprw(FILE *fd, int recnum, struct athreg
 	const char* bits;
 	int i;
 
-	fprintf(fd, "\n%05d: ", recnum);
+	fprintf(fd, "\n%05d: [%d] ", recnum, r->threadid);
 	dr = findreg(r->reg);
 	if (dr != NULL && dr->name != NULL) {
 		snprintf(buf, sizeof (buf), "AR_%s (0x%x)", dr->name, r->reg);



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