svn commit: r233887 - in head: sys/dev/ath sys/dev/ath/ath_hal
tools/tools/ath/athdecode
Adrian Chadd
adrian at FreeBSD.org
Wed Apr 4 20:46:21 UTC 2012
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);
More information about the svn-src-all
mailing list