From owner-svn-src-all@FreeBSD.ORG Wed Apr 4 20:46:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BAF9106566B; Wed, 4 Apr 2012 20:46:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CED18FC0C; Wed, 4 Apr 2012 20:46:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q34KkKh0024277; Wed, 4 Apr 2012 20:46:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q34KkKS6024273; Wed, 4 Apr 2012 20:46:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204042046.q34KkKS6024273@svn.freebsd.org> From: Adrian Chadd Date: Wed, 4 Apr 2012 20:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233887 - in head: sys/dev/ath sys/dev/ath/ath_hal tools/tools/ath/athdecode X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2012 20:46:21 -0000 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 #include #include +#include #include #include @@ -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);