bab record/report spie and miso errors
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
diff --git a/driver-bab.c b/driver-bab.c
index fb7f795..902e51f 100644
--- a/driver-bab.c
+++ b/driver-bab.c
@@ -243,6 +243,7 @@ struct bab_work_send {
struct bab_work_reply {
uint32_t nonce[BAB_REPLY_NONCES];
uint32_t jobsel;
+ uint32_t spichk;
};
#define BAB_CHIP_MIN (sizeof(struct bab_work_reply)+16)
@@ -1656,8 +1657,8 @@ static bool bab_do_work(struct cgpu_info *babcgpu)
K_ITEM *witem, *sitem, *ritem;
struct timeval when, now;
double delay;
- int chip, rep, j, nonces;
- uint32_t nonce;
+ int chip, rep, j, nonces, spie = 0, miso = 0;
+ uint32_t nonce, spichk;
bool res;
cgtime(&now);
@@ -1739,6 +1740,12 @@ static bool bab_do_work(struct cgpu_info *babcgpu)
DATAR(ritem)->not_first_reply = babinfo->not_first_reply[chip];
memcpy(&(DATAR(ritem)->when), &when, sizeof(when));
+ spichk = babinfo->chip_results[chip].spichk;
+ if (spichk != 0 && spichk != 0xffffffff) {
+ babinfo->chip_spie[chip]++;
+ spie++;
+ }
+
nonces = 0;
for (rep = 0; rep < BAB_REPLY_NONCES; rep++) {
nonce = babinfo->chip_results[chip].nonce[rep];
@@ -1750,6 +1757,12 @@ static bool bab_do_work(struct cgpu_info *babcgpu)
}
}
+ if (nonces == BAB_REPLY_NONCES) {
+ babinfo->chip_miso[chip]++;
+ miso++;
+ // Test the results anyway
+ }
+
/*
* Send even with zero nonces
* so cleanup_older() is called for the chip
@@ -1769,7 +1782,7 @@ static bool bab_do_work(struct cgpu_info *babcgpu)
}
- applog(LOG_DEBUG, "Work: items:%d", work_items);
+ applog(LOG_DEBUG, "Work: items:%d spie:%d miso:%d", work_items, spie, miso);
return true;
}
@@ -2030,6 +2043,28 @@ static struct api_data *bab_api_stats(struct cgpu_info *babcgpu)
data[0] = '\0';
for (j = i; j <= to; j++) {
+ snprintf(buf, sizeof(buf),
+ "%s%d",
+ j == i ? "" : " ",
+ (int)(babinfo->chip_spie[j]));
+ strcat(data, buf);
+ }
+ snprintf(buf, sizeof(buf), "Spie %d - %d", i, to);
+ root = api_add_string(root, buf, data, true);
+
+ data[0] = '\0';
+ for (j = i; j <= to; j++) {
+ snprintf(buf, sizeof(buf),
+ "%s%d",
+ j == i ? "" : " ",
+ (int)(babinfo->chip_miso[j]));
+ strcat(data, buf);
+ }
+ snprintf(buf, sizeof(buf), "Miso %d - %d", i, to);
+ root = api_add_string(root, buf, data, true);
+
+ data[0] = '\0';
+ for (j = i; j <= to; j++) {
tot = (float)(babinfo->chip_good[j] + babinfo->chip_bad[j]);
if (tot != 0)
hw = 100.0 * (float)(babinfo->chip_bad[j]) / tot;