|
@@ -1987,14 +1987,14 @@ static int itemstats(int i, char *id, struct cgminer_stats *stats, char *extra,
|
|
|
extra = (char *)BLANK;
|
|
extra = (char *)BLANK;
|
|
|
|
|
|
|
|
sprintf(buf, isjson
|
|
sprintf(buf, isjson
|
|
|
- ? "%s{\"STATS\":%d,\"ID\":\"%s\",\"Elapsed\":%.0f,\"Calls\":%d,\"Wait\":%ld.%06ld,\"Max\":%ld.%06ld,\"Min\":%ld.%06ld%s%s}"
|
|
|
|
|
- : "%sSTATS=%d,ID=%s,Elapsed=%.0f,Calls=%d,Wait=%ld.%06ld,Max=%ld.%06ld,Min=%ld.%06ld%s%s" SEPSTR,
|
|
|
|
|
|
|
+ ? "%s{\"STATS\":%d,\"ID\":\"%s\",\"Elapsed\":%.0f,\"Calls\":%d,\"Wait\":%ld.%06ld,\"Max\":%ld.%06ld,\"Min\":%ld.%06ld%s}"
|
|
|
|
|
+ : "%sSTATS=%d,ID=%s,Elapsed=%.0f,Calls=%d,Wait=%ld.%06ld,Max=%ld.%06ld,Min=%ld.%06ld%s" SEPSTR,
|
|
|
(isjson && (i > 0)) ? COMMA : BLANK,
|
|
(isjson && (i > 0)) ? COMMA : BLANK,
|
|
|
i, id, total_secs, stats->getwork_calls,
|
|
i, id, total_secs, stats->getwork_calls,
|
|
|
stats->getwork_wait.tv_sec, stats->getwork_wait.tv_usec,
|
|
stats->getwork_wait.tv_sec, stats->getwork_wait.tv_usec,
|
|
|
stats->getwork_wait_max.tv_sec, stats->getwork_wait_max.tv_usec,
|
|
stats->getwork_wait_max.tv_sec, stats->getwork_wait_max.tv_usec,
|
|
|
stats->getwork_wait_min.tv_sec, stats->getwork_wait_min.tv_usec,
|
|
stats->getwork_wait_min.tv_sec, stats->getwork_wait_min.tv_usec,
|
|
|
- *extra ? COMMA : BLANK, extra);
|
|
|
|
|
|
|
+ extra);
|
|
|
|
|
|
|
|
strcat(io_buffer, buf);
|
|
strcat(io_buffer, buf);
|
|
|
|
|
|
|
@@ -2020,15 +2020,15 @@ static void minerstats(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
|
|
|
for (j = 0; j < total_devices; j++) {
|
|
for (j = 0; j < total_devices; j++) {
|
|
|
struct cgpu_info *cgpu = devices[j];
|
|
struct cgpu_info *cgpu = devices[j];
|
|
|
|
|
|
|
|
- if (cgpu && cgpu->api) {
|
|
|
|
|
- if (cgpu->api->get_api_stats)
|
|
|
|
|
- cgpu->api->get_api_stats(extra, cgpu, isjson);
|
|
|
|
|
- else
|
|
|
|
|
- extra[0] = '\0';
|
|
|
|
|
-
|
|
|
|
|
- sprintf(id, "%s%d", cgpu->api->name, cgpu->device_id);
|
|
|
|
|
- i = itemstats(i, id, &(cgpu->cgminer_stats), extra, isjson);
|
|
|
|
|
|
|
+ extra[0] = '\0';
|
|
|
|
|
+ if (cgpu->api->get_extra_device_perf_stats) {
|
|
|
|
|
+ json_t *info = cgpu->api->get_extra_device_perf_stats(cgpu);
|
|
|
|
|
+ append_kv(extra, info, isjson);
|
|
|
|
|
+ json_decref(info);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ sprintf(id, "%s%d", cgpu->api->name, cgpu->device_id);
|
|
|
|
|
+ i = itemstats(i, id, &(cgpu->cgminer_stats), extra, isjson);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (j = 0; j < total_pools; j++) {
|
|
for (j = 0; j < total_pools; j++) {
|