Browse Source

Display processor name with thread disabled/re-enabled messages

Luke Dashjr 13 years ago
parent
commit
f5d3c9057c
1 changed files with 13 additions and 5 deletions
  1. 13 5
      miner.c

+ 13 - 5
miner.c

@@ -6841,26 +6841,34 @@ bool abandon_work(struct work *work, struct timeval *wdiff, uint64_t hashes)
 	return false;
 	return false;
 }
 }
 
 
-void mt_disable_start(struct thr_info *mythr)
+static
+void __thr_being_msg(struct thr_info *thr, const char *being)
 {
 {
-	int thr_id = mythr->id;
+	struct cgpu_info *proc = thr->cgpu;
 	
 	
+	if (proc->threads > 1)
+		applog(LOG_WARNING, "%"PRIpreprv" (thread %d) being %s", proc->proc_repr, thr->id, being);
+	else
+		applog(LOG_WARNING, "%"PRIpreprv" being %s", proc->proc_repr, being);
+}
+
+void mt_disable_start(struct thr_info *mythr)
+{
 	hashmeter2(mythr);
 	hashmeter2(mythr);
 	mythr->prev_work = mythr->work;
 	mythr->prev_work = mythr->work;
 	mythr->work = NULL;
 	mythr->work = NULL;
 	mythr->_job_transition_in_progress = false;
 	mythr->_job_transition_in_progress = false;
-	applog(LOG_WARNING, "Thread %d being disabled", thr_id);
+	__thr_being_msg(mythr, "disabled");
 	mythr->rolling = mythr->cgpu->rolling = 0;
 	mythr->rolling = mythr->cgpu->rolling = 0;
 	thread_reportout(mythr);
 	thread_reportout(mythr);
 }
 }
 
 
 void mt_disable_finish(struct thr_info *mythr)
 void mt_disable_finish(struct thr_info *mythr)
 {
 {
-	int thr_id = mythr->id;
 	const struct device_api *api = mythr->cgpu->api;
 	const struct device_api *api = mythr->cgpu->api;
 	
 	
 	thread_reportin(mythr);
 	thread_reportin(mythr);
-	applog(LOG_WARNING, "Thread %d being re-enabled", thr_id);
+	__thr_being_msg(mythr, "re-enabled");
 	if (api->thread_enable)
 	if (api->thread_enable)
 		api->thread_enable(mythr);
 		api->thread_enable(mythr);
 }
 }