From 5b279813412138f44c87cb35c9f74746a1d4b67d Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 30 Sep 2013 22:04:22 +1000 Subject: [PATCH] Display stats regarding locking delays in API. --- api.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api.c b/api.c index c70446df..ab84faa0 100644 --- a/api.c +++ b/api.c @@ -3096,6 +3096,7 @@ static int itemstats(struct io_data *io_data, int i, char *id, struct cgminer_st if (cgpu) { #ifdef USE_USBUTILS char details[256]; + int val; if (cgpu->usbinfo.pipe_count) snprintf(details, sizeof(details), @@ -3148,6 +3149,14 @@ 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_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 }