Store per-chip submit information for bxf device and show them in the API.
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
diff --git a/driver-bitfury.c b/driver-bitfury.c
index 016539c..30f8647 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -327,13 +327,15 @@ static void parse_bxf_submit(struct cgpu_info *bitfury, struct bitfury_info *inf
struct work *match_work, *tmp, *work = NULL;
struct thr_info *thr = info->thr;
uint32_t nonce, timestamp;
- int workid;
+ int workid, chip = -1;
- if (!sscanf(&buf[7], "%x %x %x", &nonce, &workid, ×tamp)) {
+ if (!sscanf(&buf[7], "%x %x %x %d", &nonce, &workid, ×tamp, &chip)) {
applog(LOG_WARNING, "%s %d: Failed to parse submit response",
bitfury->drv->name, bitfury->device_id);
return;
}
+ if (chip > -1 && chip < 2)
+ info->submits[chip]++;
applog(LOG_DEBUG, "%s %d: Parsed nonce %u workid %d timestamp %u",
bitfury->drv->name, bitfury->device_id, nonce, workid, timestamp);
@@ -897,6 +899,8 @@ static struct api_data *bxf_api_stats(struct bitfury_info *info)
root = api_add_int(root, "Core1 hwerror", &info->filtered_hw[1], false);
root = api_add_int(root, "Core0 jobs", &info->job[0], false);
root = api_add_int(root, "Core1 jobs", &info->job[1], false);
+ root = api_add_int(root, "Core0 submits", &info->submits[0], false);
+ root = api_add_int(root, "Core1 submits", &info->submits[1], false);
return root;
}
diff --git a/driver-bitfury.h b/driver-bitfury.h
index 42a805e..9412076 100644
--- a/driver-bitfury.h
+++ b/driver-bitfury.h
@@ -57,6 +57,7 @@ struct bitfury_info {
uint8_t clocks; // There are two but we set them equal
int filtered_hw[2]; // Hardware errors we're told about but are filtered
int job[2]; // Completed jobs we're told about
+ int submits[2]; // Submitted responses
};
#endif /* BITFURY_H */