BFL add throttle count to internal stats + 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 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
diff --git a/API-README b/API-README
index cc8ee9e..4f812c1 100644
--- a/API-README
+++ b/API-README
@@ -365,6 +365,7 @@ Modified API commands:
'devs' - add 'Diff1 Work' to all devices
'gpu|N' - add 'Diff1 Work'
'pga|N' - add 'Diff1 Work'
+ 'notify' - add '*Dev Throttle' (for BFL Singles)
----------
diff --git a/api.c b/api.c
index b4ec40f..a812381 100644
--- a/api.c
+++ b/api.c
@@ -2561,6 +2561,7 @@ void notifystatus(int device, struct cgpu_info *cgpu, bool isjson, __maybe_unuse
root = api_add_int(root, "*Dev Over Heat", &(cgpu->dev_over_heat_count), false);
root = api_add_int(root, "*Dev Thermal Cutoff", &(cgpu->dev_thermal_cutoff_count), false);
root = api_add_int(root, "*Dev Comms Error", &(cgpu->dev_comms_error_count), false);
+ root = api_add_int(root, "*Dev Throttle", &(cgpu->dev_throttle_count), false);
if (isjson && (device > 0))
strcat(io_buffer, COMMA);
diff --git a/driver-bitforce.c b/driver-bitforce.c
index b8e7bc7..64cc51a 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -386,10 +386,13 @@ static bool bitforce_get_temp(struct cgpu_info *bitforce)
* our responses are out of sync and flush the buffer to
* hopefully recover */
applog(LOG_WARNING, "BFL%i: Garbled response probably throttling, clearing buffer", bitforce->device_id);
+ bitforce->device_last_not_well = time(NULL);
+ bitforce->device_not_well_reason = REASON_DEV_THROTTLE;
+ bitforce->dev_throttle_count++;
/* Count throttling episodes as hardware errors */
bitforce->hw_errors++;
bitforce_clear_buffer(bitforce);
- return false;;
+ return false;
}
return true;
diff --git a/miner.h b/miner.h
index f35ae96..7234cf6 100644
--- a/miner.h
+++ b/miner.h
@@ -276,6 +276,7 @@ enum dev_reason {
REASON_DEV_OVER_HEAT,
REASON_DEV_THERMAL_CUTOFF,
REASON_DEV_COMMS_ERROR,
+ REASON_DEV_THROTTLE,
};
#define REASON_NONE "None"
@@ -288,6 +289,7 @@ enum dev_reason {
#define REASON_DEV_OVER_HEAT_STR "Device over heated"
#define REASON_DEV_THERMAL_CUTOFF_STR "Device reached thermal cutoff"
#define REASON_DEV_COMMS_ERROR_STR "Device comms error"
+#define REASON_DEV_THROTTLE_STR "Device throttle"
#define REASON_UNKNOWN_STR "Unknown reason - code bug"
#define MIN_SEC_UNSET 99999999
@@ -412,6 +414,7 @@ struct cgpu_info {
int dev_over_heat_count; // It's a warning but worth knowing
int dev_thermal_cutoff_count;
int dev_comms_error_count;
+ int dev_throttle_count;
struct cgminer_stats cgminer_stats;
};