Rework the last-initialised time displayed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
diff --git a/main.c b/main.c
index 858623f..15b3da2 100644
--- a/main.c
+++ b/main.c
@@ -1972,6 +1972,7 @@ retry:
gpu, cgpu->rolling, cgpu->total_mhashes / total_secs,
cgpu->getworks, cgpu->accepted, cgpu->rejected, cgpu->hw_errors,
cgpu->efficiency, cgpu->utility);
+ wlog("Last initialised: %s\n", cgpu->init);
for (i = 0; i < mining_threads; i++) {
thr = &thr_info[i];
if (thr->cgpu != cgpu)
@@ -3384,6 +3385,7 @@ static void *reinit_gpu(void *userdata)
struct thr_info *mythr = userdata;
struct cgpu_info *cgpu;
struct thr_info *thr;
+ struct timeval now;
char name[256];
int thr_id;
int gpu;
@@ -3446,6 +3448,9 @@ select_cgpu:
applog(LOG_WARNING, "Thread %d restarted", thr_id);
}
+ gettimeofday(&now, NULL);
+ get_datestamp(cgpu->init, &now);
+
gpu_devices[gpu] = true;
for (thr_id = 0; thr_id < gpu_threads; thr_id ++) {
if (dev_from_id(thr_id) != gpu)
@@ -4069,13 +4074,15 @@ int main (int argc, char *argv[])
/* start GPU mining threads */
for (i = 0; i < nDevs * opt_g_threads; i++) {
int gpu = i % nDevs;
+ struct cgpu_info *cgpu;
+ struct timeval now;
gpus[gpu].is_gpu = 1;
gpus[gpu].cpu_gpu = gpu;
thr = &thr_info[i];
thr->id = i;
- thr->cgpu = &gpus[gpu];
+ cgpu = thr->cgpu = &gpus[gpu];
thr->q = tq_new();
if (!thr->q)
@@ -4098,6 +4105,8 @@ int main (int argc, char *argv[])
continue;
}
applog(LOG_INFO, "initCl() finished. Found %s", name);
+ gettimeofday(&now, NULL);
+ get_datestamp(cgpu->init, &now);
if (unlikely(thr_info_create(thr, NULL, gpuminer_thread, thr)))
quit(1, "thread %d create failed", i);
diff --git a/miner.h b/miner.h
index 4a70651..b1034ba 100644
--- a/miner.h
+++ b/miner.h
@@ -152,6 +152,7 @@ struct cgpu_info {
double efficiency;
double utility;
enum alive status;
+ char init[40];
};
struct thr_info {