Browse Source

Remove devlock lock contention statistics since transfers are all done under read lock now.

nfactor-troky
Con Kolivas 11 years ago
parent
commit
023ca6a11d
  1. 9
      api.c
  2. 6
      miner.h
  3. 20
      usbutils.c

9
api.c

@ -3089,7 +3089,6 @@ static int itemstats(struct io_data *io_data, int i, char *id, struct cgminer_st
if (cgpu) { if (cgpu) {
#ifdef USE_USBUTILS #ifdef USE_USBUTILS
char details[256]; char details[256];
int val;
if (cgpu->usbinfo.pipe_count) if (cgpu->usbinfo.pipe_count)
snprintf(details, sizeof(details), snprintf(details, sizeof(details),
@ -3143,14 +3142,6 @@ static int itemstats(struct io_data *io_data, int i, char *id, struct cgminer_st
root = api_add_string(root, "USB tmo", details, true); root = api_add_string(root, "USB tmo", details, true);
root = api_add_int(root, "USB cancellations", &cgpu->usb_cancels, false); root = api_add_int(root, "USB cancellations", &cgpu->usb_cancels, false);
root = api_add_int(root, "USB bulk reads", &cgpu->usb_bulk_reads, false);
val = cgpu->usb_rlock_total_wait / (cgpu->usb_bulk_reads ? : 1);
root = api_add_int(root, "USB avg rlock ms wait", &val, true);
root = api_add_int(root, "USB max rlock ms wait", &cgpu->usb_rlock_max_wait, false);
root = api_add_int(root, "USB bulk writes", &cgpu->usb_bulk_writes, false);
val = cgpu->usb_wlock_total_wait / (cgpu->usb_bulk_writes ? : 1);
root = api_add_int(root, "USB avg wlock ms wait", &val, true);
root = api_add_int(root, "USB max wlock ms wait", &cgpu->usb_wlock_max_wait, false);
#endif #endif
} }

6
miner.h

@ -472,12 +472,6 @@ struct cgpu_info {
#endif #endif
#ifdef USE_USBUTILS #ifdef USE_USBUTILS
struct cg_usb_info usbinfo; struct cg_usb_info usbinfo;
int usb_bulk_writes;
int usb_bulk_reads;
int usb_wlock_total_wait;
int usb_rlock_total_wait;
int usb_wlock_max_wait;
int usb_rlock_max_wait;
int usb_cancels; int usb_cancels;
#endif #endif
#ifdef USE_MODMINER #ifdef USE_MODMINER

20
usbutils.c

@ -2364,18 +2364,8 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
int endlen; int endlen;
unsigned char *ptr, *usbbuf = cgpu->usbinfo.bulkbuf; unsigned char *ptr, *usbbuf = cgpu->usbinfo.bulkbuf;
size_t usbbufread; size_t usbbufread;
int lock_wait;
/* Get statistics on how long reads wait on the devlock */
cgpu->usb_bulk_reads++;
cgtime(&read_start);
DEVRLOCK(cgpu, pstate); DEVRLOCK(cgpu, pstate);
cgtime(&tv_finish);
lock_wait = ms_tdiff(&tv_finish, &read_start);
cgpu->usb_rlock_total_wait += lock_wait;
if (lock_wait > cgpu->usb_rlock_max_wait)
cgpu->usb_rlock_max_wait = lock_wait;
if (cgpu->usbinfo.nodev) { if (cgpu->usbinfo.nodev) {
*buf = '\0'; *buf = '\0';
@ -2642,18 +2632,8 @@ int _usb_write(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_
double max, done; double max, done;
__maybe_unused bool first = true; __maybe_unused bool first = true;
int err, sent, tot, pstate; int err, sent, tot, pstate;
int lock_wait;
/* Get statistics on how long writes wait on the devlock */
cgpu->usb_bulk_writes++;
cgtime(&read_start);
DEVRLOCK(cgpu, pstate); DEVRLOCK(cgpu, pstate);
cgtime(&tv_finish);
lock_wait = ms_tdiff(&tv_finish, &read_start);
cgpu->usb_wlock_total_wait += lock_wait;
if (lock_wait > cgpu->usb_wlock_max_wait)
cgpu->usb_wlock_max_wait = lock_wait;
USBDEBUG("USB debug: _usb_write(%s (nodev=%s),intinfo=%d,epinfo=%d,buf='%s',bufsiz=%d,proc=%p,timeout=%u,cmd=%s)", cgpu->drv->name, bool_str(cgpu->usbinfo.nodev), intinfo, epinfo, (char *)str_text(buf), (int)bufsiz, processed, timeout, usb_cmdname(cmd)); USBDEBUG("USB debug: _usb_write(%s (nodev=%s),intinfo=%d,epinfo=%d,buf='%s',bufsiz=%d,proc=%p,timeout=%u,cmd=%s)", cgpu->drv->name, bool_str(cgpu->usbinfo.nodev), intinfo, epinfo, (char *)str_text(buf), (int)bufsiz, processed, timeout, usb_cmdname(cmd));

Loading…
Cancel
Save