mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-09 20:21:01 +00:00
usb timeouts - min/max also
This commit is contained in:
parent
2dffc96e3c
commit
759ce6e7d2
12
api.c
12
api.c
@ -3054,17 +3054,23 @@ static int itemstats(struct io_data *io_data, int i, char *id, struct cgminer_st
|
||||
"%"PRIu64" 0", cgpu->usbinfo.tmo_count);
|
||||
} else {
|
||||
snprintf(details, sizeof(details),
|
||||
"%"PRIu64" %d=%d/%"PRIu64"/%"PRIu64
|
||||
" %d=%d/%"PRIu64"/%"PRIu64
|
||||
" %d=%d/%"PRIu64"/%"PRIu64" ",
|
||||
"%"PRIu64" %d=%d/%d/%d/%"PRIu64"/%"PRIu64
|
||||
" %d=%d/%d/%d/%"PRIu64"/%"PRIu64
|
||||
" %d=%d/%d/%d/%"PRIu64"/%"PRIu64" ",
|
||||
cgpu->usbinfo.tmo_count,
|
||||
USB_TMO_0, cgpu->usbinfo.usb_tmo[0].count,
|
||||
cgpu->usbinfo.usb_tmo[0].min_tmo,
|
||||
cgpu->usbinfo.usb_tmo[0].max_tmo,
|
||||
cgpu->usbinfo.usb_tmo[0].total_over,
|
||||
cgpu->usbinfo.usb_tmo[0].total_tmo,
|
||||
USB_TMO_1, cgpu->usbinfo.usb_tmo[1].count,
|
||||
cgpu->usbinfo.usb_tmo[1].min_tmo,
|
||||
cgpu->usbinfo.usb_tmo[1].max_tmo,
|
||||
cgpu->usbinfo.usb_tmo[1].total_over,
|
||||
cgpu->usbinfo.usb_tmo[1].total_tmo,
|
||||
USB_TMO_2, cgpu->usbinfo.usb_tmo[2].count,
|
||||
cgpu->usbinfo.usb_tmo[2].min_tmo,
|
||||
cgpu->usbinfo.usb_tmo[2].max_tmo,
|
||||
cgpu->usbinfo.usb_tmo[2].total_over,
|
||||
cgpu->usbinfo.usb_tmo[2].total_tmo);
|
||||
}
|
||||
|
12
usbutils.c
12
usbutils.c
@ -2135,12 +2135,13 @@ static void stats(struct cgpu_info *cgpu, struct timeval *tv_start, struct timev
|
||||
// timeout checks are only done when stats are enabled
|
||||
extrams = SECTOMS(tdiff(tv_finish, tv_start)) - timeout;
|
||||
if (extrams >= USB_TMO_0) {
|
||||
uint32_t totms = (uint32_t)(timeout + extrams);
|
||||
int offset = 0;
|
||||
|
||||
if (extrams >= USB_TMO_2) {
|
||||
applog(LOG_ERR, "%s%i: TIMEOUT %s took %dms but was %dms",
|
||||
cgpu->drv->name, cgpu->device_id,
|
||||
usb_cmdname(cmd), extrams+timeout, timeout) ;
|
||||
usb_cmdname(cmd), totms, timeout) ;
|
||||
offset = 2;
|
||||
} else if (extrams >= USB_TMO_1)
|
||||
offset = 1;
|
||||
@ -2148,6 +2149,15 @@ static void stats(struct cgpu_info *cgpu, struct timeval *tv_start, struct timev
|
||||
cgpu->usbinfo.usb_tmo[offset].count++;
|
||||
cgpu->usbinfo.usb_tmo[offset].total_over += extrams;
|
||||
cgpu->usbinfo.usb_tmo[offset].total_tmo += timeout;
|
||||
if (cgpu->usbinfo.usb_tmo[offset].min_tmo == 0) {
|
||||
cgpu->usbinfo.usb_tmo[offset].min_tmo = totms;
|
||||
cgpu->usbinfo.usb_tmo[offset].max_tmo = totms;
|
||||
} else {
|
||||
if (cgpu->usbinfo.usb_tmo[offset].min_tmo > totms)
|
||||
cgpu->usbinfo.usb_tmo[offset].min_tmo = totms;
|
||||
if (cgpu->usbinfo.usb_tmo[offset].max_tmo < totms)
|
||||
cgpu->usbinfo.usb_tmo[offset].max_tmo = totms;
|
||||
}
|
||||
}
|
||||
|
||||
details = &(usb_stats[cgpu->usbinfo.usbstat - 1].details[cmd * 2 + seq]);
|
||||
|
@ -193,6 +193,8 @@ struct cg_usb_device {
|
||||
|
||||
struct cg_usb_tmo {
|
||||
uint32_t count;
|
||||
uint32_t min_tmo;
|
||||
uint32_t max_tmo;
|
||||
uint64_t total_over;
|
||||
uint64_t total_tmo;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user