Browse Source

+Strange Counter -printf Counter

Anatoly Legkodymov 12 years ago
parent
commit
c5375bf640
3 changed files with 10 additions and 3 deletions
  1. 5 0
      driver-bitfury.c
  2. 4 3
      libbitfury.c
  3. 1 0
      libbitfury.h

+ 5 - 0
driver-bitfury.c

@@ -163,6 +163,7 @@ static int64_t bitfury_scanHash(struct thr_info *thr)
 		int len, k;
 		double gh[32][8] = {0};
 		double ghsum = 0, gh1h = 0, gh2h = 0;
+		unsigned strange_counter = 0;
 
 		for (chip = 0; chip < chip_n; chip++) {
 			int shares_found = calc_stat(devices[chip].stat_ts, short_stat, now);
@@ -181,9 +182,13 @@ static int64_t bitfury_scanHash(struct thr_info *thr)
 			shares_total += shares_found;
 			shares_first += chip < 4 ? shares_found : 0;
 			shares_last += chip > 3 ? shares_found : 0;
+			strange_counter += devices[chip].strange_counter;
+			devices[chip].strange_counter = 0;
 		}
 		sprintf(line, "vvvvwww SHORT stat %ds: wwwvvvv", short_stat);
 		applog(LOG_WARNING, line);
+		sprintf(line, "stranges: %u", strange_counter);
+		applog(LOG_WARNING, line);
 		for(i = 0; i < 32; i++)
 			if(strlen(stat_lines[i])) {
 				len = strlen(stat_lines[i]);

+ 4 - 3
libbitfury.c

@@ -564,7 +564,8 @@ int libbitfury_sendHashData(struct bitfury_device *bf, int chip_n) {
 						found++;
 					}
 					if (!found) {
-						printf("AAA Strange: %08x, chip_id: %d\n", pn, chip_id);
+						//printf("AAA Strange: %08x, chip_id: %d\n", pn, chip_id);
+						d->strange_counter++;
 					}
 				}
 			}
@@ -608,10 +609,10 @@ int libbitfury_sendHashData(struct bitfury_device *bf, int chip_n) {
 				mhz = 1.0 / ns * 65.0 * 1000.0;
 
 				if (d->counter1 > 0 && d->counter1 < 0x001FFFFF) {
-					printf("AAA chip_id %2d: %llu ms, req1_cycles: %08u,  counter1: %08d, ocounter1: %08d, counter2: %08d, cycles: %08d, ns: %.2f, mhz: %.2f \n", chip_id, period / 1000000ULL, req1_cycles, d->counter1, d->ocounter1, d->counter2, cycles, ns, mhz);
+					//printf("//AAA chip_id %2d: %llu ms, req1_cycles: %08u,  counter1: %08d, ocounter1: %08d, counter2: %08d, cycles: %08d, ns: %.2f, mhz: %.2f \n", chip_id, period / 1000000ULL, req1_cycles, d->counter1, d->ocounter1, d->counter2, cycles, ns, mhz);
 				}
 				if (ns > 2000.0 || ns < 20) {
-					printf("AAA %d!Stupid ns chip_id %2d: %llu ms, req1_cycles: %08u,  counter1: %08d, ocounter1: %08d, counter2: %08d, cycles: %08d, ns: %.2f, mhz: %.2f \n", ccase, chip_id, period / 1000000ULL, req1_cycles, d->counter1, d->ocounter1, d->counter2, cycles, ns, mhz);
+					//printf("AAA %d!Stupid ns chip_id %2d: %llu ms, req1_cycles: %08u,  counter1: %08d, ocounter1: %08d, counter2: %08d, cycles: %08d, ns: %.2f, mhz: %.2f \n", ccase, chip_id, period / 1000000ULL, req1_cycles, d->counter1, d->ocounter1, d->counter2, cycles, ns, mhz);
 					ns = 200.0;
 				} else {
 					d->ns = ns;

+ 1 - 0
libbitfury.h

@@ -73,6 +73,7 @@ struct bitfury_device {
 	double ns;
 	unsigned slot;
 	unsigned fasync;
+	unsigned strange_counter;
 };
 
 int libbitfury_readHashData(unsigned int *res);