bab - also report dead chip count screen
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
diff --git a/driver-bab.c b/driver-bab.c
index bafa1cd..eaf7d42 100644
--- a/driver-bab.c
+++ b/driver-bab.c
@@ -2744,11 +2744,36 @@ static struct api_data *bab_api_stats(struct cgpu_info *babcgpu)
static void bab_get_statline_before(char *buf, size_t bufsiz, struct cgpu_info *babcgpu)
{
struct bab_info *babinfo = (struct bab_info *)(babcgpu->device_data);
+#if UPDATE_HISTORY
+ struct timeval now;
+ double elapsed;
+ int i, dead = 0;
+ cgtime(&now);
+ elapsed = tdiff(&now, &(babcgpu->dev_start_tv));
+
+ // At least get 15s of nonces before saying anything is dead
+ if (elapsed > 15.0) {
+ K_RLOCK(babinfo->nfree_list);
+ for (i = 0; i < babinfo->chips; i++) {
+ if (babinfo->good_nonces[i]->count == 0 &&
+ babinfo->bad_nonces[i]->count > 1)
+ dead++;
+ }
+ K_RUNLOCK(babinfo->nfree_list);
+ }
+
+ tailsprintf(buf, bufsiz, "%d.%02d.%03d D:%03d | ",
+ babinfo->banks,
+ babinfo->boards,
+ babinfo->chips,
+ dead);
+#else
tailsprintf(buf, bufsiz, "B:%d B:%02d C:%03d | ",
babinfo->banks,
babinfo->boards,
babinfo->chips);
+#endif
}
#endif