|
@@ -2470,11 +2470,34 @@ percentf2(double p, double t, char *buf)
|
|
|
static void adj_width(int var, int *length);
|
|
static void adj_width(int var, int *length);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-void get_statline3(char *buf, struct cgpu_info *cgpu, bool for_curses, bool opt_show_procs)
|
|
|
|
|
-{
|
|
|
|
|
#ifdef HAVE_CURSES
|
|
#ifdef HAVE_CURSES
|
|
|
|
|
+static
|
|
|
|
|
+void format_statline(char *buf, const char *cHr, const char *aHr, const char *uHr, int accepted, int rejected, int stale, int wnotaccepted, int waccepted, int hwerrs, int badnonces, int allnonces)
|
|
|
|
|
+{
|
|
|
static int awidth = 1, rwidth = 1, swidth = 1, hwwidth = 1;
|
|
static int awidth = 1, rwidth = 1, swidth = 1, hwwidth = 1;
|
|
|
-#else
|
|
|
|
|
|
|
+ char rejpcbuf[6];
|
|
|
|
|
+ char bnbuf[6];
|
|
|
|
|
+
|
|
|
|
|
+ adj_width(accepted, &awidth);
|
|
|
|
|
+ adj_width(rejected, &rwidth);
|
|
|
|
|
+ adj_width(stale, &swidth);
|
|
|
|
|
+ adj_width(hwerrs, &hwwidth);
|
|
|
|
|
+
|
|
|
|
|
+ tailsprintf(buf, "%s/%s/%s | A:%*d R:%*d+%*d(%s) HW:%*d/%s",
|
|
|
|
|
+ cHr, aHr, uHr,
|
|
|
|
|
+ awidth, accepted,
|
|
|
|
|
+ rwidth, rejected,
|
|
|
|
|
+ swidth, stale,
|
|
|
|
|
+ percentf(wnotaccepted, waccepted, rejpcbuf),
|
|
|
|
|
+ hwwidth, hwerrs,
|
|
|
|
|
+ percentf2(badnonces, allnonces, bnbuf)
|
|
|
|
|
+ );
|
|
|
|
|
+}
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+void get_statline3(char *buf, struct cgpu_info *cgpu, bool for_curses, bool opt_show_procs)
|
|
|
|
|
+{
|
|
|
|
|
+#ifndef HAVE_CURSES
|
|
|
assert(for_curses == false);
|
|
assert(for_curses == false);
|
|
|
#endif
|
|
#endif
|
|
|
struct device_drv *drv = cgpu->drv;
|
|
struct device_drv *drv = cgpu->drv;
|
|
@@ -2608,21 +2631,13 @@ void get_statline3(char *buf, struct cgpu_info *cgpu, bool for_curses, bool opt_
|
|
|
if (unlikely(all_off))
|
|
if (unlikely(all_off))
|
|
|
cHrStatsI = 2;
|
|
cHrStatsI = 2;
|
|
|
|
|
|
|
|
- adj_width(accepted, &awidth);
|
|
|
|
|
- adj_width(rejected, &rwidth);
|
|
|
|
|
- adj_width(stale, &swidth);
|
|
|
|
|
- adj_width(hwerrs, &hwwidth);
|
|
|
|
|
-
|
|
|
|
|
- tailsprintf(buf, "%s/%s/%s | A:%*d R:%*d+%*d(%s) HW:%*d/%s",
|
|
|
|
|
- cHrStatsOpt[cHrStatsI],
|
|
|
|
|
- aHr, uHr,
|
|
|
|
|
- awidth, accepted,
|
|
|
|
|
- rwidth, rejected,
|
|
|
|
|
- swidth, stale,
|
|
|
|
|
- percentf(wnotaccepted, waccepted, rejpcbuf),
|
|
|
|
|
- hwwidth, hwerrs,
|
|
|
|
|
- percentf2(badnonces, allnonces, bnbuf)
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ format_statline(buf,
|
|
|
|
|
+ cHrStatsOpt[cHrStatsI],
|
|
|
|
|
+ aHr, uHr,
|
|
|
|
|
+ accepted, rejected, stale,
|
|
|
|
|
+ wnotaccepted, waccepted,
|
|
|
|
|
+ hwerrs,
|
|
|
|
|
+ badnonces, allnonces);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
#endif
|
|
#endif
|
|
@@ -6272,6 +6287,7 @@ void thread_reportout(struct thr_info *thr)
|
|
|
static void hashmeter(int thr_id, struct timeval *diff,
|
|
static void hashmeter(int thr_id, struct timeval *diff,
|
|
|
uint64_t hashes_done)
|
|
uint64_t hashes_done)
|
|
|
{
|
|
{
|
|
|
|
|
+ char logstatusline[256];
|
|
|
struct timeval temp_tv_end, total_diff;
|
|
struct timeval temp_tv_end, total_diff;
|
|
|
double secs;
|
|
double secs;
|
|
|
double local_secs;
|
|
double local_secs;
|
|
@@ -6360,13 +6376,49 @@ static void hashmeter(int thr_id, struct timeval *diff,
|
|
|
|
|
|
|
|
multi_format_unit_array(
|
|
multi_format_unit_array(
|
|
|
((char*[]){cHr, aHr, uHr}),
|
|
((char*[]){cHr, aHr, uHr}),
|
|
|
- true, "h/s", H2B_SPACED,
|
|
|
|
|
|
|
+ true, "h/s", H2B_SHORT,
|
|
|
3,
|
|
3,
|
|
|
1e6*rolling,
|
|
1e6*rolling,
|
|
|
1e6*total_mhashes_done / total_secs,
|
|
1e6*total_mhashes_done / total_secs,
|
|
|
utility_to_hashrate(total_diff_accepted / (total_secs ?: 1) * 60));
|
|
utility_to_hashrate(total_diff_accepted / (total_secs ?: 1) * 60));
|
|
|
|
|
|
|
|
- sprintf(statusline, "%s%ds:%s avg:%s u:%s | A:%d R:%d+%d(%s) HW:%d/%s",
|
|
|
|
|
|
|
+#ifdef HAVE_CURSES
|
|
|
|
|
+ if (curses_active_locked()) {
|
|
|
|
|
+ float temp = 0;
|
|
|
|
|
+ struct cgpu_info *proc;
|
|
|
|
|
+ int i;
|
|
|
|
|
+
|
|
|
|
|
+ sprintf(statusline, "(%d) ", total_devices);
|
|
|
|
|
+
|
|
|
|
|
+ // Find the highest temperature of all processors
|
|
|
|
|
+ for (i = 0; i < total_devices; ++i)
|
|
|
|
|
+ {
|
|
|
|
|
+ proc = get_devices(i);
|
|
|
|
|
+ if (proc->temp > temp)
|
|
|
|
|
+ temp = proc->temp;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (temp > 0.)
|
|
|
|
|
+ sprintf(&statusline[7], "%4.1fC | ", temp);
|
|
|
|
|
+ else
|
|
|
|
|
+ strcpy(&statusline[7], " | ");
|
|
|
|
|
+
|
|
|
|
|
+ format_statline(&statusline[15],
|
|
|
|
|
+ cHr, aHr,
|
|
|
|
|
+ uHr,
|
|
|
|
|
+ total_accepted,
|
|
|
|
|
+ total_rejected,
|
|
|
|
|
+ total_stale,
|
|
|
|
|
+ total_diff_rejected + total_diff_stale, total_diff_accepted,
|
|
|
|
|
+ hw_errors, total_bad_nonces, total_diff1);
|
|
|
|
|
+ unlock_curses();
|
|
|
|
|
+ }
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+ // Add a space
|
|
|
|
|
+ memmove(&uHr[6], &uHr[5], strlen(&uHr[5]) + 1);
|
|
|
|
|
+ uHr[5] = ' ';
|
|
|
|
|
+
|
|
|
|
|
+ sprintf(logstatusline, "%s%ds:%s avg:%s u:%s | A:%d R:%d+%d(%s) HW:%d/%s",
|
|
|
want_per_device_stats ? "ALL " : "",
|
|
want_per_device_stats ? "ALL " : "",
|
|
|
opt_log_interval,
|
|
opt_log_interval,
|
|
|
cHr, aHr,
|
|
cHr, aHr,
|
|
@@ -6386,10 +6438,10 @@ out_unlock:
|
|
|
|
|
|
|
|
if (showlog) {
|
|
if (showlog) {
|
|
|
if (!curses_active) {
|
|
if (!curses_active) {
|
|
|
- printf("%s \r", statusline);
|
|
|
|
|
|
|
+ printf("%s \r", logstatusline);
|
|
|
fflush(stdout);
|
|
fflush(stdout);
|
|
|
} else
|
|
} else
|
|
|
- applog(LOG_INFO, "%s", statusline);
|
|
|
|
|
|
|
+ applog(LOG_INFO, "%s", logstatusline);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|