diff --git a/src/Summary.cpp b/src/Summary.cpp index 62d226197..7b22ab348 100644 --- a/src/Summary.cpp +++ b/src/Summary.cpp @@ -39,6 +39,9 @@ #include "version.h" +namespace xmrig { + + #ifdef XMRIG_FEATURE_ASM static const char *coloredAsmNames[] = { RED_BOLD("none"), @@ -49,24 +52,23 @@ static const char *coloredAsmNames[] = { }; -inline static const char *asmName(xmrig::Assembly::Id assembly) +inline static const char *asmName(Assembly::Id assembly) { return coloredAsmNames[assembly]; } #endif -static void print_memory(xmrig::Config *) { +static void print_memory(Config *) { # ifdef _WIN32 - xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s", - "HUGE PAGES", xmrig::VirtualMemory::isHugepagesAvailable() ? GREEN_BOLD("available") : RED_BOLD("unavailable")); + Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s", + "HUGE PAGES", VirtualMemory::isHugepagesAvailable() ? GREEN_BOLD("available") : RED_BOLD("unavailable")); # endif } -static void print_cpu(xmrig::Config *) +static void print_cpu(Config *) { - using namespace xmrig; const ICpuInfo *info = Cpu::info(); Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s%s (%zu/%zu)") " %sx64 %sAES %sAVX2", @@ -95,41 +97,44 @@ static void print_cpu(xmrig::Config *) } -static void print_threads(xmrig::Config *config) +static void print_threads(Config *config) { - xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") WHITE_BOLD("%s%d%%"), - "DONATE", - config->pools().donateLevel() == 0 ? RED_BOLD_S : "", - config->pools().donateLevel() - ); + Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") WHITE_BOLD("%s%d%%"), + "DONATE", + config->pools().donateLevel() == 0 ? RED_BOLD_S : "", + config->pools().donateLevel() + ); # ifdef XMRIG_FEATURE_ASM - if (config->cpu().assembly() == xmrig::Assembly::AUTO) { - const xmrig::Assembly assembly = xmrig::Cpu::info()->assembly(); + if (config->cpu().assembly() == Assembly::AUTO) { + const Assembly assembly = Cpu::info()->assembly(); - xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13sauto:%s"), "ASSEMBLY", asmName(assembly)); + Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13sauto:%s"), "ASSEMBLY", asmName(assembly)); } else { - xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s%s"), "ASSEMBLY", asmName(config->cpu().assembly())); + Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s%s"), "ASSEMBLY", asmName(config->cpu().assembly())); } # endif } -static void print_commands(xmrig::Config *) +static void print_commands(Config *) { - if (xmrig::Log::colors) { - xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("COMMANDS ") MAGENTA_BOLD("h") WHITE_BOLD("ashrate, ") + if (Log::colors) { + Log::print(GREEN_BOLD(" * ") WHITE_BOLD("COMMANDS ") MAGENTA_BOLD("h") WHITE_BOLD("ashrate, ") MAGENTA_BOLD("p") WHITE_BOLD("ause, ") MAGENTA_BOLD("r") WHITE_BOLD("esume")); } else { - xmrig::Log::print(" * COMMANDS 'h' hashrate, 'p' pause, 'r' resume"); + Log::print(" * COMMANDS 'h' hashrate, 'p' pause, 'r' resume"); } } -void Summary::print(xmrig::Controller *controller) +} // namespace xmrig + + +void xmrig::Summary::print(Controller *controller) { controller->config()->printVersions(); print_memory(controller->config()); diff --git a/src/Summary.h b/src/Summary.h index f07dba35f..4317d13e1 100644 --- a/src/Summary.h +++ b/src/Summary.h @@ -5,7 +5,8 @@ * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , - * Copyright 2016-2018 XMRig , + * Copyright 2018-2019 SChernykh + * Copyright 2016-2019 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,20 +22,24 @@ * along with this program. If not, see . */ -#ifndef __SUMMARY_H__ -#define __SUMMARY_H__ +#ifndef XMRIG_SUMMARY_H +#define XMRIG_SUMMARY_H namespace xmrig { - class Controller; -} + + +class Controller; class Summary { public: - static void print(xmrig::Controller *controller); + static void print(Controller *controller); }; -#endif /* __SUMMARY_H__ */ +} // namespace xmrig + + +#endif /* XMRIG_SUMMARY_H */ diff --git a/src/base/kernel/Entry.cpp b/src/base/kernel/Entry.cpp index 1834cb82b..1e12b24d2 100644 --- a/src/base/kernel/Entry.cpp +++ b/src/base/kernel/Entry.cpp @@ -31,6 +31,9 @@ # include #endif +#ifdef XMRIG_FEATURE_HWLOC +# include +#endif #include "base/kernel/Entry.h" #include "base/kernel/Process.h" @@ -75,6 +78,8 @@ static int showVersion() } # endif + printf("hwloc/%s\n", HWLOC_VERSION); + return 0; } diff --git a/src/base/kernel/config/BaseConfig.cpp b/src/base/kernel/config/BaseConfig.cpp index 462639e38..2fcbad702 100644 --- a/src/base/kernel/config/BaseConfig.cpp +++ b/src/base/kernel/config/BaseConfig.cpp @@ -34,6 +34,9 @@ # include #endif +#ifdef XMRIG_FEATURE_HWLOC +# include +#endif #ifdef XMRIG_AMD_PROJECT # if defined(__APPLE__) @@ -95,22 +98,24 @@ void xmrig::BaseConfig::printVersions() # 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); +# endif -# if defined(XMRIG_FEATURE_HTTP) || defined(XMRIG_FEATURE_TLS) - int length = 0; -# endif -# endif + std::string libs; # if defined(XMRIG_FEATURE_TLS) && defined(OPENSSL_VERSION_TEXT) { constexpr const char *v = OPENSSL_VERSION_TEXT + 8; - length += snprintf(buf + length, (sizeof buf) - length, "OpenSSL/%.*s ", static_cast(strchr(v, ' ') - v), v); + snprintf(buf, sizeof buf, "OpenSSL/%.*s ", static_cast(strchr(v, ' ') - v), v); + libs += buf; } # endif - Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13slibuv/%s %s"), "LIBS", uv_version_string(), buf); +# ifdef XMRIG_FEATURE_HWLOC + snprintf(buf, sizeof buf, "hwloc/%s ", HWLOC_VERSION); + libs += buf; +# endif + + Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13slibuv/%s %s"), "LIBS", uv_version_string(), libs.c_str()); }