1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-10 23:08:07 +00:00

Rework the last-initialised time displayed.

This commit is contained in:
Con Kolivas 2011-08-15 22:21:17 +10:00
parent cfe8534c39
commit 4e48561a13
2 changed files with 11 additions and 1 deletions

11
main.c
View File

@ -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);

View File

@ -152,6 +152,7 @@ struct cgpu_info {
double efficiency;
double utility;
enum alive status;
char init[40];
};
struct thr_info {