|
|
@ -676,23 +676,30 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work, |
|
|
|
return hash_count; |
|
|
|
return hash_count; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void icarus_api_stats(char *buf, struct cgpu_info *cgpu, bool isjson) |
|
|
|
static struct api_data *icarus_api_stats(struct cgpu_info *cgpu) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
struct api_data *root = NULL; |
|
|
|
struct ICARUS_INFO *info = icarus_info[cgpu->device_id]; |
|
|
|
struct ICARUS_INFO *info = icarus_info[cgpu->device_id]; |
|
|
|
|
|
|
|
|
|
|
|
// Warning, access to these is not locked - but we don't really
|
|
|
|
// Warning, access to these is not locked - but we don't really
|
|
|
|
// care since hashing performance is way more important than
|
|
|
|
// care since hashing performance is way more important than
|
|
|
|
// locking access to displaying API debug 'stats'
|
|
|
|
// locking access to displaying API debug 'stats'
|
|
|
|
sprintf(buf, isjson |
|
|
|
// If locking becomes an issue for any of them, use copy_data=true also
|
|
|
|
? "\"read_count\":%d,\"fullnonce\":%f,\"count\":%d,\"Hs\":%.15f,\"W\":%f,\"total_values\":%u,\"range\":%"PRIu64",\"history_count\":%"PRIu64",\"history_time\":%f,\"min_data_count\":%u,\"timing_values\":%u" |
|
|
|
root = api_add_int(root, "read_count", &(info->read_count), false); |
|
|
|
: "read_count=%d,fullnonce=%f,count=%d,Hs=%.15f,W=%f,total_values=%u,range=%"PRIu64",history_count=%"PRIu64",history_time=%f,min_data_count=%u,timing_values=%u", |
|
|
|
root = api_add_double(root, "fullnonce", &(info->fullnonce), false); |
|
|
|
info->read_count, info->fullnonce, |
|
|
|
root = api_add_int(root, "count", &(info->count), false); |
|
|
|
info->count, info->Hs, info->W, |
|
|
|
root = api_add_hs(root, "Hs", &(info->Hs), false); |
|
|
|
info->values, info->hash_count_range, |
|
|
|
root = api_add_double(root, "W", &(info->W), false); |
|
|
|
info->history_count, |
|
|
|
root = api_add_uint(root, "total_values", &(info->values), false); |
|
|
|
(double)(info->history_time.tv_sec) |
|
|
|
root = api_add_uint64(root, "range", &(info->hash_count_range), false); |
|
|
|
+ ((double)(info->history_time.tv_usec))/((double)1000000), |
|
|
|
root = api_add_uint64(root, "history_count", &(info->history_count), false); |
|
|
|
info->min_data_count, info->history[0].values); |
|
|
|
root = api_add_timeval(root, "history_time", &(info->history_time), false); |
|
|
|
|
|
|
|
root = api_add_uint(root, "min_data_count", &(info->min_data_count), false); |
|
|
|
|
|
|
|
root = api_add_uint(root, "timing_values", &(info->history[0].values), false); |
|
|
|
|
|
|
|
root = api_add_const(root, "timing_mode", timing_mode_str(info->timing_mode), false); |
|
|
|
|
|
|
|
root = api_add_bool(root, "is_timing", &(info->do_icarus_timing), false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return root; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void icarus_shutdown(struct thr_info *thr) |
|
|
|
static void icarus_shutdown(struct thr_info *thr) |
|
|
|