mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
klondike - debug dump structured replies
This commit is contained in:
parent
5154e8472d
commit
3b9e39fa99
@ -82,7 +82,7 @@ typedef struct _workresult {
|
|||||||
uint32_t nonce;
|
uint32_t nonce;
|
||||||
} WORKRESULT;
|
} WORKRESULT;
|
||||||
|
|
||||||
typedef struct kondike_cfg {
|
typedef struct klondike_cfg {
|
||||||
uint16_t hashclock;
|
uint16_t hashclock;
|
||||||
uint8_t temptarget;
|
uint8_t temptarget;
|
||||||
uint8_t tempcritical;
|
uint8_t tempcritical;
|
||||||
@ -339,12 +339,18 @@ static void klondike_check_nonce(struct cgpu_info *klncgpu, WORKRESULT *result)
|
|||||||
//inc_hw_errors(klncgpu->thr[0]);
|
//inc_hw_errors(klncgpu->thr[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change this to LOG_WARNING if you wish to always see the replies
|
||||||
|
#define READ_DEBUG LOG_DEBUG
|
||||||
|
|
||||||
// thread to keep looking for replies
|
// thread to keep looking for replies
|
||||||
static void *klondike_get_replies(void *userdata)
|
static void *klondike_get_replies(void *userdata)
|
||||||
{
|
{
|
||||||
struct cgpu_info *klncgpu = (struct cgpu_info *)userdata;
|
struct cgpu_info *klncgpu = (struct cgpu_info *)userdata;
|
||||||
struct klondike_info *klninfo = (struct klondike_info *)(klncgpu->device_data);
|
struct klondike_info *klninfo = (struct klondike_info *)(klncgpu->device_data);
|
||||||
struct klondike_status *ks;
|
struct klondike_status *ks;
|
||||||
|
struct _workresult *wr;
|
||||||
|
struct klondike_cfg *kc;
|
||||||
|
struct klondike_id *ki;
|
||||||
char *replybuf;
|
char *replybuf;
|
||||||
int err, recd;
|
int err, recd;
|
||||||
|
|
||||||
@ -361,7 +367,7 @@ static void *klondike_get_replies(void *userdata)
|
|||||||
if (!err && recd == REPLY_SIZE) {
|
if (!err && recd == REPLY_SIZE) {
|
||||||
if (opt_log_level <= LOG_DEBUG) {
|
if (opt_log_level <= LOG_DEBUG) {
|
||||||
char *hexdata = bin2hex((unsigned char *)(replybuf+1), recd);
|
char *hexdata = bin2hex((unsigned char *)(replybuf+1), recd);
|
||||||
applog(LOG_DEBUG, "%s (%s) reply [%s:%s]", klncgpu->drv->dname, klncgpu->device_path, replybuf+1, hexdata);
|
applog(READ_DEBUG, "%s (%s) reply [%s:%s]", klncgpu->drv->dname, klncgpu->device_path, replybuf+1, hexdata);
|
||||||
free(hexdata);
|
free(hexdata);
|
||||||
}
|
}
|
||||||
if (++klninfo->nextreply == MAX_REPLY_COUNT)
|
if (++klninfo->nextreply == MAX_REPLY_COUNT)
|
||||||
@ -370,7 +376,16 @@ static void *klondike_get_replies(void *userdata)
|
|||||||
replybuf[0] = replybuf[1];
|
replybuf[0] = replybuf[1];
|
||||||
switch (replybuf[0]) {
|
switch (replybuf[0]) {
|
||||||
case '=':
|
case '=':
|
||||||
|
wr = (struct _workresult *)(replybuf+1);
|
||||||
klondike_check_nonce(klncgpu, (WORKRESULT *)replybuf);
|
klondike_check_nonce(klncgpu, (WORKRESULT *)replybuf);
|
||||||
|
applog(READ_DEBUG,
|
||||||
|
"%s (%s) reply: work [%c] device=%d workid=%d"
|
||||||
|
" nonce=0x%08x",
|
||||||
|
klncgpu->drv->dname, klncgpu->device_path,
|
||||||
|
*(replybuf+1),
|
||||||
|
(int)(wr->device),
|
||||||
|
(int)(wr->workid),
|
||||||
|
(unsigned int)(wr->nonce));
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
case 'W':
|
case 'W':
|
||||||
@ -381,6 +396,45 @@ static void *klondike_get_replies(void *userdata)
|
|||||||
klninfo->errorcount += ks->errorcount;
|
klninfo->errorcount += ks->errorcount;
|
||||||
klninfo->noisecount += ks->noise;
|
klninfo->noisecount += ks->noise;
|
||||||
wr_unlock(&(klninfo->stat_lock));
|
wr_unlock(&(klninfo->stat_lock));
|
||||||
|
applog(READ_DEBUG,
|
||||||
|
"%s (%s) reply: status [%c] chips=%d slaves=%d"
|
||||||
|
" workcq=%d workid=%d temp=%d fan=%d errors=%d"
|
||||||
|
" hashes=%d max=%d noise=%d",
|
||||||
|
klncgpu->drv->dname, klncgpu->device_path,
|
||||||
|
*(replybuf+1),
|
||||||
|
(int)(ks->chipcount),
|
||||||
|
(int)(ks->slavecount),
|
||||||
|
(int)(ks->workqc),
|
||||||
|
(int)(ks->workid),
|
||||||
|
(int)(ks->temp),
|
||||||
|
(int)(ks->fanspeed),
|
||||||
|
(int)(ks->errorcount),
|
||||||
|
(int)(ks->hashcount),
|
||||||
|
(int)(ks->maxcount),
|
||||||
|
(int)(ks->noise));
|
||||||
|
break;
|
||||||
|
case 'C':
|
||||||
|
kc = (struct klondike_cfg *)(replybuf+2);
|
||||||
|
applog(READ_DEBUG,
|
||||||
|
"%s (%s) reply: config [%c] clock=%d temptarget=%d"
|
||||||
|
" tempcrit=%d fan=%d",
|
||||||
|
klncgpu->drv->dname, klncgpu->device_path,
|
||||||
|
*(replybuf+1),
|
||||||
|
(int)(kc->hashclock),
|
||||||
|
(int)(kc->temptarget),
|
||||||
|
(int)(kc->tempcritical),
|
||||||
|
(int)(kc->fantarget));
|
||||||
|
break;
|
||||||
|
case 'I':
|
||||||
|
ki = (struct klondike_id *)(replybuf+2);
|
||||||
|
applog(READ_DEBUG,
|
||||||
|
"%s (%s) reply: info [%c] version=0x%02x prod=%.7s"
|
||||||
|
" serial=0x%08x",
|
||||||
|
klncgpu->drv->dname, klncgpu->device_path,
|
||||||
|
*(replybuf+1),
|
||||||
|
(int)(ki->version),
|
||||||
|
ki->product,
|
||||||
|
(unsigned int)(ki->serial));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user