void Workers::start(IWorker *worker) { const Worker *w = static_cast<const Worker *>(worker); uv_mutex_lock(&m_mutex); m_status.started++; m_status.pages += w->memory().pages; m_status.hugePages += w->memory().hugePages; if (m_status.started == m_status.threads) { const double percent = (double) m_status.hugePages / m_status.pages * 100.0; const size_t memory = m_status.ways * xmrig::cn_select_memory(m_status.algo) / 1024; if (m_status.colors) { LOG_INFO(GREEN_BOLD("READY (CPU)") " threads " CYAN_BOLD("%zu(%zu)") " huge pages %s%zu/%zu %1.0f%%\x1B[0m memory " CYAN_BOLD("%zu KB") "", m_status.threads, m_status.ways, (m_status.hugePages == m_status.pages ? "\x1B[1;32m" : (m_status.hugePages == 0 ? "\x1B[1;31m" : "\x1B[1;33m")), m_status.hugePages, m_status.pages, percent, memory); } else { LOG_INFO("READY (CPU) threads %zu(%zu) huge pages %zu/%zu %1.0f%% memory %zu KB", m_status.threads, m_status.ways, m_status.hugePages, m_status.pages, percent, memory); } } uv_mutex_unlock(&m_mutex); worker->start(); }
void xmrig::CommonConfig::printVersions() { char buf[256] = { 0 }; # if defined(__clang__) snprintf(buf, sizeof buf, "clang/%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__); # elif defined(__GNUC__) snprintf(buf, sizeof buf, "gcc/%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); # elif defined(_MSC_VER) snprintf(buf, sizeof buf, "MSVC/%d", MSVC_VERSION); # endif Log::i()->text(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("%s/%s") WHITE_BOLD(" %s") : " * %-13s%s/%s %s", "ABOUT", APP_NAME, APP_VERSION, buf); # if defined(XMRIG_AMD_PROJECT) # if CL_VERSION_2_0 const char *ocl = "2.0"; # elif CL_VERSION_1_2 const char *ocl = "1.2"; # elif CL_VERSION_1_1 const char *ocl = "1.1"; # elif CL_VERSION_1_0 const char *ocl = "1.0"; # else const char *ocl = "0.0"; # endif int length = snprintf(buf, sizeof buf, "OpenCL/%s ", ocl); # elif defined(XMRIG_NVIDIA_PROJECT) const int cudaVersion = cuda_get_runtime_version(); int length = snprintf(buf, sizeof buf, "CUDA/%d.%d ", cudaVersion / 1000, cudaVersion % 100); # else memset(buf, 0, 16); # if !defined(XMRIG_NO_HTTPD) || !defined(XMRIG_NO_TLS) int length = 0; # endif # endif # if !defined(XMRIG_NO_TLS) && defined(OPENSSL_VERSION_TEXT) { constexpr const char *v = OPENSSL_VERSION_TEXT + 8; length += snprintf(buf + length, (sizeof buf) - length, "OpenSSL/%.*s ", static_cast<int>(strchr(v, ' ') - v), v); } # endif # ifndef XMRIG_NO_HTTPD length += snprintf(buf + length, (sizeof buf) - length, "microhttpd/%s ", MHD_get_version()); # endif Log::i()->text(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13slibuv/%s %s") : " * %-13slibuv/%s %s", "LIBS", uv_version_string(), buf); }
void xmrig::CommonConfig::printAPI() { # ifndef XMRIG_NO_API if (apiPort() == 0) { return; } Log::i()->text(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN("%s:") CYAN_BOLD("%d") : " * %-13s%s:%d", "API BIND", isApiIPv6() ? "[::]" : "0.0.0.0", apiPort()); # endif }
static void print_api(xmrig::Controller *controller) { const int port = controller->config()->apiPort(); if (port == 0) { return; } Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-12s") CYAN("%s:") CYAN_BOLD("%d") : " * %-12s%s:%d", "API BIND", controller->config()->isApiIPv6() ? "[::]" : "0.0.0.0", port); }
static void print_bind(xmrig::Controller *controller) { const std::vector<Addr> &addrs = controller->config()->addrs(); for (size_t i = 0; i < addrs.size(); ++i) { Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("BIND #%-6d") CYAN("%s%s%s:") CYAN_BOLD("%d") : " * BIND #%-6d%s%s%s:%d", i + 1, addrs[i].isIPv6() ? "[" : "", addrs[i].ip(), addrs[i].isIPv6() ? "]" : "", addrs[i].port()); } }
static void print_versions(xmrig::Controller *controller) { char buf[16] = { 0 }; # if defined(__clang__) snprintf(buf, 16, " clang/%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__); # elif defined(__GNUC__) snprintf(buf, 16, " gcc/%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); # elif defined(_MSC_VER) snprintf(buf, 16, " MSVC/%d", MSVC_VERSION); # else buf[0] = '\0'; # endif Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-12s") CYAN_BOLD("%s/%s") WHITE_BOLD(" libuv/%s%s") : " * %-12s%s/%s libuv/%s%s", "VERSIONS", APP_NAME, APP_VERSION, uv_version_string(), buf); }
void Summary::printPools(xmrig::Config *config) { const std::vector<Pool> &pools = config->pools(); for (size_t i = 0; i < pools.size(); ++i) { Log::i()->text(config->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("POOL #%-6zu") CYAN_BOLD("%s") " variant " WHITE_BOLD("%s") : " * POOL #%-6d%s variant %s", i + 1, pools[i].url(), pools[i].algorithm().variantName() ); } # ifdef APP_DEBUG for (const Pool &pool : pools) { pool.print(); } # endif }