diff --git a/src/backend/common/Workers.cpp b/src/backend/common/Workers.cpp index 08743ab3..3b56e5fe 100644 --- a/src/backend/common/Workers.cpp +++ b/src/backend/common/Workers.cpp @@ -241,7 +241,9 @@ bool xmrig::Workers::tick(uint64_t) const char* color = checkData ? ((benchData == checkData) ? GREEN_BOLD_S : RED_BOLD_S) : BLACK_BOLD_S; - LOG_INFO("%s Benchmark finished in %.3f seconds, hash sum = %s%016" PRIX64 CLEAR, Tags::miner(), dt, color, benchData); + LOG_INFO("%s " WHITE_BOLD("benchmark finished in ") CYAN_BOLD("%.3f seconds") WHITE_BOLD_S " hash sum = " CLEAR "%s%016" PRIX64 CLEAR, + Tags::bench(), dt, color, benchData); + return false; } } diff --git a/src/base/io/log/Log.h b/src/base/io/log/Log.h index bbe9f560..73d4e53f 100644 --- a/src/base/io/log/Log.h +++ b/src/base/io/log/Log.h @@ -103,6 +103,7 @@ private: #define WHITE_S CSI "0;37m" // another name for LT.GRAY #define WHITE_BOLD_S CSI "1;37m" // actually white +#define RED_BG_BOLD_S CSI "41;1m" #define GREEN_BG_BOLD_S CSI "42;1m" #define YELLOW_BG_BOLD_S CSI "43;1m" #define BLUE_BG_S CSI "44m" @@ -130,6 +131,7 @@ private: #define WHITE(x) WHITE_S x CLEAR #define WHITE_BOLD(x) WHITE_BOLD_S x CLEAR +#define RED_BG_BOLD(x) RED_BG_BOLD_S x CLEAR #define GREEN_BG_BOLD(x) GREEN_BG_BOLD_S x CLEAR #define YELLOW_BG_BOLD(x) YELLOW_BG_BOLD_S x CLEAR #define BLUE_BG(x) BLUE_BG_S x CLEAR diff --git a/src/base/io/log/Tags.cpp b/src/base/io/log/Tags.cpp index af36b0ba..77d53078 100644 --- a/src/base/io/log/Tags.cpp +++ b/src/base/io/log/Tags.cpp @@ -70,6 +70,16 @@ const char *xmrig::Tags::randomx() return tag; } #endif + + +#ifdef XMRIG_FEATURE_BENCHMARK +const char *xmrig::Tags::bench() +{ + static const char *tag = RED_BG_BOLD(WHITE_BOLD_S " bench "); + + return tag; +} +#endif #endif diff --git a/src/base/io/log/Tags.h b/src/base/io/log/Tags.h index 072d7d41..9f690ef2 100644 --- a/src/base/io/log/Tags.h +++ b/src/base/io/log/Tags.h @@ -40,6 +40,9 @@ public: # ifdef XMRIG_ALGO_RANDOMX static const char *randomx(); # endif +# ifdef XMRIG_FEATURE_BENCHMARK + static const char *bench(); +# endif # endif # ifdef XMRIG_PROXY_PROJECT diff --git a/src/net/Network.cpp b/src/net/Network.cpp index 0bb741d4..d22e793f 100644 --- a/src/net/Network.cpp +++ b/src/net/Network.cpp @@ -124,9 +124,23 @@ void xmrig::Network::onActive(IStrategy *strategy, IClient *client) return; } + const auto &pool = client->pool(); + +# ifdef XMRIG_FEATURE_BENCHMARK + if (pool.mode() == Pool::MODE_BENCHMARK) { + LOG_NOTICE("%s " MAGENTA_BOLD("start benchmark ") "hashes " CYAN_BOLD("%" PRIu64 "M") " algo " WHITE_BOLD("%s") " print_time " CYAN_BOLD("%us"), + Tags::bench(), + pool.benchSize() / 1000000, + client->job().algorithm().shortName(), + m_controller->config()->printTime()); + + return; + } +# endif + const char *tlsVersion = client->tlsVersion(); LOG_INFO("%s " WHITE_BOLD("use %s ") CYAN_BOLD("%s:%d ") GREEN_BOLD("%s") " " BLACK_BOLD("%s"), - Tags::network(), client->mode(), client->pool().host().data(), client->pool().port(), tlsVersion ? tlsVersion : "", client->ip().data()); + Tags::network(), client->mode(), pool.host().data(), pool.port(), tlsVersion ? tlsVersion : "", client->ip().data()); const char *fingerprint = client->tlsFingerprint(); if (fingerprint != nullptr) { @@ -255,13 +269,18 @@ void xmrig::Network::setJob(IClient *client, const Job &job, bool donate) uint64_t diff = job.diff();; const char *scale = NetworkState::scaleDiff(diff); - if (job.height()) { - LOG_INFO("%s " MAGENTA_BOLD("new job") " from " WHITE_BOLD("%s:%d") " diff " WHITE_BOLD("%" PRIu64 "%s") " algo " WHITE_BOLD("%s") " height " WHITE_BOLD("%" PRIu64), - Tags::network(), client->pool().host().data(), client->pool().port(), diff, scale, job.algorithm().shortName(), job.height()); - } - else { - LOG_INFO("%s " MAGENTA_BOLD("new job") " from " WHITE_BOLD("%s:%d") " diff " WHITE_BOLD("%" PRIu64 "%s") " algo " WHITE_BOLD("%s"), - Tags::network(), client->pool().host().data(), client->pool().port(), diff, scale, job.algorithm().shortName()); +# ifdef XMRIG_FEATURE_BENCHMARK + if (!job.bench()) +# endif + { + if (job.height()) { + LOG_INFO("%s " MAGENTA_BOLD("new job") " from " WHITE_BOLD("%s:%d") " diff " WHITE_BOLD("%" PRIu64 "%s") " algo " WHITE_BOLD("%s") " height " WHITE_BOLD("%" PRIu64), + Tags::network(), client->pool().host().data(), client->pool().port(), diff, scale, job.algorithm().shortName(), job.height()); + } + else { + LOG_INFO("%s " MAGENTA_BOLD("new job") " from " WHITE_BOLD("%s:%d") " diff " WHITE_BOLD("%" PRIu64 "%s") " algo " WHITE_BOLD("%s"), + Tags::network(), client->pool().host().data(), client->pool().port(), diff, scale, job.algorithm().shortName()); + } } if (!donate && m_donate) {