bab record continuous (and max) bad nonces
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
diff --git a/driver-bab.c b/driver-bab.c
index 6b094f4..6ed6282 100644
--- a/driver-bab.c
+++ b/driver-bab.c
@@ -364,6 +364,9 @@ struct bab_info {
uint64_t chip_bad[BAB_MAXCHIPS];
uint64_t chip_ncore[BAB_MAXCHIPS][BAB_X_COORD][BAB_Y_COORD];
+ uint64_t chip_cont_bad[BAB_MAXCHIPS];
+ uint64_t chip_max_bad[BAB_MAXCHIPS];
+
uint64_t untested_nonces;
uint64_t tested_nonces;
@@ -1535,6 +1538,8 @@ static bool oknonce(struct thr_info *thr, struct cgpu_info *babcgpu, int chip, u
babinfo->max_proc_links = proc_links;
babinfo->total_work_links += work_links;
+ babinfo->chip_cont_bad[chip] = 0;
+
#if UPDATE_HISTORY
process_history(babinfo, chip, when, true, &now);
#endif
@@ -1562,6 +1567,10 @@ static bool oknonce(struct thr_info *thr, struct cgpu_info *babcgpu, int chip, u
babinfo->fail_total_links += links;
babinfo->fail_total_work_links += work_links;
+ babinfo->chip_cont_bad[chip]++;
+ if (babinfo->chip_max_bad[chip] < babinfo->chip_cont_bad[chip])
+ babinfo->chip_max_bad[chip] = babinfo->chip_cont_bad[chip];
+
#if UPDATE_HISTORY
process_history(babinfo, chip, when, false, &now);
#endif
@@ -2077,6 +2086,28 @@ static struct api_data *bab_api_stats(struct cgpu_info *babcgpu)
snprintf(buf, sizeof(buf),
"%s%"PRIu64,
j == i ? "" : " ",
+ babinfo->chip_cont_bad[j]);
+ strcat(data, buf);
+ }
+ snprintf(buf, sizeof(buf), "Cont-Bad %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%"PRIu64,
+ j == i ? "" : " ",
+ babinfo->chip_max_bad[j]);
+ strcat(data, buf);
+ }
+ snprintf(buf, sizeof(buf), "Max-Bad %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%"PRIu64,
+ j == i ? "" : " ",
history_good[j]);
strcat(data, buf);
}