Browse Source

icarus: Include ns/hash estimates for each nonce result, in debug logging

Luke Dashjr 10 years ago
parent
commit
6b3aff5f2f
1 changed files with 11 additions and 5 deletions
  1. 11 5
      driver-icarus.c

+ 11 - 5
driver-icarus.c

@@ -1095,11 +1095,17 @@ keepwaiting:
 		hash_count++;
 		hash_count *= info->fpga_count;
 
-		applog(LOG_DEBUG, "%"PRIpreprv" nonce = 0x%08x = 0x%08" PRIx64 " hashes (%"PRId64".%06lus)",
-		       proc->proc_repr,
-		       nonce,
-		       (uint64_t)hash_count,
-		       (int64_t)elapsed.tv_sec, (unsigned long)elapsed.tv_usec);
+		if (opt_debug)
+		{
+			const uint64_t elapsed_fs = (elapsed.tv_sec * 1000000000000000LL) + (elapsed.tv_usec * 1000000000LL);
+			const uint64_t est_Hs_fs = elapsed_fs / hash_count;
+			applog(LOG_DEBUG, "%"PRIpreprv" nonce = 0x%08x = 0x%08" PRIx64 " hashes (%"PRId64".%06lus; %llu.%06luns/hash)",
+			       proc->proc_repr,
+			       nonce,
+			       (uint64_t)hash_count,
+			       (int64_t)elapsed.tv_sec, (unsigned long)elapsed.tv_usec,
+			       (unsigned long long)(est_Hs_fs / 1000000LL), (unsigned long)(est_Hs_fs % 1000000LL));
+		}
 	}
 	else
 	{