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.
This commit is contained in:
Adrian Chadd 2012-04-04 20:46:20 +00:00
parent bb16310a44
commit 2fe1131c7b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=233887
3 changed files with 6 additions and 1 deletions

View File

@ -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_int32_t reg, u_int32_t val)
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_int32_t reg)
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_int32_t v)
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;

View File

@ -29,6 +29,7 @@
* existing file.
*/
struct athregrec {
uint32_t threadid;
uint32_t op : 8,
reg : 24;
uint32_t val;

View File

@ -375,7 +375,7 @@ oprw(FILE *fd, int recnum, struct athregrec *r)
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);