Browse Source

Bugfix: Update utility every get_statline call, and include every processor involved

Luke Dashjr 13 years ago
parent
commit
0b286b8f8b
1 changed files with 6 additions and 6 deletions
  1. 6 6
      miner.c

+ 6 - 6
miner.c

@@ -2186,6 +2186,9 @@ static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 	if (!opt_show_procs)
 	if (!opt_show_procs)
 		cgpu = cgpu->device;
 		cgpu = cgpu->device;
 	
 	
+	cgpu->utility = cgpu->accepted / total_secs * 60;
+	cgpu->utility_diff1 = cgpu->diff_accepted / total_secs * 60;
+	
 	double rolling = cgpu->rolling;
 	double rolling = cgpu->rolling;
 	double mhashes = cgpu->total_mhashes;
 	double mhashes = cgpu->total_mhashes;
 	double wutil = cgpu->utility_diff1;
 	double wutil = cgpu->utility_diff1;
@@ -2197,6 +2200,9 @@ static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 	if (!opt_show_procs)
 	if (!opt_show_procs)
 		for (struct cgpu_info *slave = cgpu; (slave = slave->next_proc); )
 		for (struct cgpu_info *slave = cgpu; (slave = slave->next_proc); )
 		{
 		{
+			slave->utility = slave->accepted / total_secs * 60;
+			slave->utility_diff1 = slave->diff_accepted / total_secs * 60;
+			
 			rolling += slave->rolling;
 			rolling += slave->rolling;
 			mhashes += slave->total_mhashes;
 			mhashes += slave->total_mhashes;
 			wutil += slave->utility_diff1;
 			wutil += slave->utility_diff1;
@@ -2414,9 +2420,6 @@ static void curses_print_devstatus(int thr_id)
 	if (ypos >= statusy - 1)
 	if (ypos >= statusy - 1)
 		return;
 		return;
 
 
-	cgpu->utility = cgpu->accepted / total_secs * 60;
-	cgpu->utility_diff1 = cgpu->diff_accepted / total_secs * 60;
-
 	if (wmove(statuswin, ypos, 0) == ERR)
 	if (wmove(statuswin, ypos, 0) == ERR)
 		return;
 		return;
 	
 	
@@ -2881,9 +2884,6 @@ static bool submit_upstream_work_completed(struct work *work, bool resubmit, str
 
 
 	share_result(val, res, err, work, resubmit, worktime);
 	share_result(val, res, err, work, resubmit, worktime);
 
 
-	cgpu->utility = cgpu->accepted / total_secs * 60;
-	cgpu->utility_diff1 = cgpu->diff_accepted / total_secs * 60;
-
 	if (!opt_realquiet)
 	if (!opt_realquiet)
 		print_status(thr_id);
 		print_status(thr_id);
 	if (!want_per_device_stats) {
 	if (!want_per_device_stats) {