|
|
|
@ -110,6 +110,9 @@ extern uint64_t global_hashrate;
@@ -110,6 +110,9 @@ extern uint64_t global_hashrate;
|
|
|
|
|
extern uint32_t accepted_count; |
|
|
|
|
extern uint32_t rejected_count; |
|
|
|
|
|
|
|
|
|
extern int device_map[8]; |
|
|
|
|
extern char *device_name[8]; |
|
|
|
|
|
|
|
|
|
#define gpu_threads opt_n_threads |
|
|
|
|
|
|
|
|
|
/***************************************************************/ |
|
|
|
@ -119,7 +122,8 @@ static void gpustatus(int thr_id)
@@ -119,7 +122,8 @@ static void gpustatus(int thr_id)
|
|
|
|
|
if (thr_id >= 0 && thr_id < gpu_threads) { |
|
|
|
|
struct cgpu_info *cgpu = &thr_info[thr_id].gpu; |
|
|
|
|
char buf[512]; *buf = '\0'; |
|
|
|
|
char pstate[8]; *pstate = '\0'; |
|
|
|
|
char pstate[8]; |
|
|
|
|
char* card; |
|
|
|
|
|
|
|
|
|
cgpu->thr_id = thr_id; |
|
|
|
|
|
|
|
|
@ -152,9 +156,11 @@ static void gpustatus(int thr_id)
@@ -152,9 +156,11 @@ static void gpustatus(int thr_id)
|
|
|
|
|
if (cgpu->gpu_pstate == -1) |
|
|
|
|
*pstate= '\0'; |
|
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "GPU=%d;TEMP=%.1f;FAN=%d;FREQ=%d;" |
|
|
|
|
"PST=%s;KHS=%.2f;HWF=%d;I=%d|", |
|
|
|
|
thr_id, cgpu->gpu_temp, cgpu->gpu_fan, |
|
|
|
|
card = device_name[device_map[thr_id]]; |
|
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "GPU=%d;CARD=%s;TEMP=%.1f;FAN=%d;" |
|
|
|
|
"FREQ=%d;PST=%s;KHS=%.2f;HWF=%d;I=%d|", |
|
|
|
|
thr_id, card, cgpu->gpu_temp, cgpu->gpu_fan, |
|
|
|
|
cgpu->gpu_clock, pstate, cgpu->khashes, |
|
|
|
|
cgpu->hw_errors, cgpu->intensity); |
|
|
|
|
|
|
|
|
@ -179,9 +185,10 @@ static char *getsummary(char *params)
@@ -179,9 +185,10 @@ static char *getsummary(char *params)
|
|
|
|
|
|
|
|
|
|
*buffer = '\0'; |
|
|
|
|
sprintf(buffer, "NAME=%s;VER=%s;API=%s;" |
|
|
|
|
"ALGO=%s;KHS=%.2f;ACC=%d;REJ=%d;ACCMN=%.3f;DIFF=%.6f;UPTIME=%.0f;TS=%u|", |
|
|
|
|
"ALGO=%s;GPUS=%d;KHS=%.2f;ACC=%d;REJ=%d;" |
|
|
|
|
"ACCMN=%.3f;DIFF=%.6f;UPTIME=%.0f;TS=%u|", |
|
|
|
|
PACKAGE_NAME, PACKAGE_VERSION, APIVERSION, |
|
|
|
|
algo, (double)global_hashrate / 1000.0, |
|
|
|
|
algo, gpu_threads, (double)global_hashrate / 1000.0, |
|
|
|
|
accepted_count, rejected_count, |
|
|
|
|
accps, global_diff, uptime, (uint32_t) ts); |
|
|
|
|
return buffer; |
|
|
|
@ -190,7 +197,7 @@ static char *getsummary(char *params)
@@ -190,7 +197,7 @@ static char *getsummary(char *params)
|
|
|
|
|
/**
|
|
|
|
|
* Returns gpu/thread specific stats |
|
|
|
|
*/ |
|
|
|
|
static char *getstats(char *params) |
|
|
|
|
static char *getthreads(char *params) |
|
|
|
|
{ |
|
|
|
|
*buffer = '\0'; |
|
|
|
|
for (int i = 0; i < gpu_threads; i++) |
|
|
|
@ -211,9 +218,10 @@ static char *gethistory(char *params)
@@ -211,9 +218,10 @@ static char *gethistory(char *params)
|
|
|
|
|
int records = stats_get_history(thr, data, ARRAY_SIZE(data)); |
|
|
|
|
for (int i = 0; i < records; i++) { |
|
|
|
|
time_t ts = data[i].tm_stat; |
|
|
|
|
p += sprintf(p, "GPU=%d;KHS=%.2f;DIFF=%.6f;COUNT=%u;FOUND=%u;TS=%u|", |
|
|
|
|
data[i].gpu_id, data[i].hashrate, data[i].difficulty, data[i].hashcount, |
|
|
|
|
data[i].hashfound, (uint32_t)ts); |
|
|
|
|
p += sprintf(p, "GPU=%d;KHS=%.2f;DIFF=%.6f;" |
|
|
|
|
"COUNT=%u;FOUND=%u;TS=%u|", |
|
|
|
|
data[i].gpu_id, data[i].hashrate, data[i].difficulty, |
|
|
|
|
data[i].hashcount, data[i].hashfound, (uint32_t)ts); |
|
|
|
|
} |
|
|
|
|
return buffer; |
|
|
|
|
} |
|
|
|
@ -224,7 +232,7 @@ struct CMDS {
@@ -224,7 +232,7 @@ struct CMDS {
|
|
|
|
|
char *(*func)(char *); |
|
|
|
|
} cmds[] = { |
|
|
|
|
{ "summary", getsummary }, |
|
|
|
|
{ "stats", getstats }, |
|
|
|
|
{ "threads", getthreads }, |
|
|
|
|
{ "histo", gethistory }, |
|
|
|
|
/* keep it the last */ |
|
|
|
|
{ "help", gethelp }, |
|
|
|
|