Browse Source

bitforce: debuglog actual result data

Luke Dashjr 12 years ago
parent
commit
5e17620357
1 changed files with 9 additions and 3 deletions
  1. 9 3
      driver-bitforce.c

+ 9 - 3
driver-bitforce.c

@@ -1360,7 +1360,7 @@ bool bitforce_queue_do_results(struct thr_info *thr)
 	struct bitforce_data *data = bitforce->cgpu_data;
 	struct bitforce_data *data = bitforce->cgpu_data;
 	int fd = bitforce->device->device_fd;
 	int fd = bitforce->device->device_fd;
 	int count;
 	int count;
-	char *buf = &data->noncebuf[0];
+	char *noncebuf = &data->noncebuf[0], *buf;
 	unsigned char midstate[32], datatail[12];
 	unsigned char midstate[32], datatail[12];
 	struct work *work;
 	struct work *work;
 	struct list_head *pos, *next_pos;
 	struct list_head *pos, *next_pos;
@@ -1376,7 +1376,7 @@ bool bitforce_queue_do_results(struct thr_info *thr)
 	
 	
 	if (unlikely(count < 0))
 	if (unlikely(count < 0))
 	{
 	{
-		applog(LOG_ERR, "%"PRIpreprv": Received unexpected queue result response: %s", bitforce->proc_repr, buf);
+		applog(LOG_ERR, "%"PRIpreprv": Received unexpected queue result response: %s", bitforce->proc_repr, noncebuf);
 		++bitforce->hw_errors;
 		++bitforce->hw_errors;
 		++hw_errors;
 		++hw_errors;
 		return false;
 		return false;
@@ -1402,14 +1402,20 @@ bool bitforce_queue_do_results(struct thr_info *thr)
 		       bitforce->proc_repr, count, bitforce->sleep_ms);
 		       bitforce->proc_repr, count, bitforce->sleep_ms);
 	
 	
 	count = 0;
 	count = 0;
-	while ((buf = next_line(buf)), buf[0])
+	noncebuf = next_line(noncebuf);
+	while ((buf = noncebuf)[0])
 	{
 	{
+		if ( (noncebuf = next_line(buf)) )
+			noncebuf[-1] = '\0';
+		
 		if (strlen(buf) <= 90)
 		if (strlen(buf) <= 90)
 		{
 		{
 			applog(LOG_ERR, "%"PRIpreprv": Gibberish within queue results: %s", bitforce->proc_repr, buf);
 			applog(LOG_ERR, "%"PRIpreprv": Gibberish within queue results: %s", bitforce->proc_repr, buf);
 			continue;
 			continue;
 		}
 		}
 		
 		
+		applog(LOG_DEBUG, "%"PRIpreprv": Queue result: %s", bitforce->proc_repr, buf);
+		
 		hex2bin(midstate, buf, 32);
 		hex2bin(midstate, buf, 32);
 		hex2bin(datatail, &buf[65], 12);
 		hex2bin(datatail, &buf[65], 12);