Browse Source

Added hwloc version display.

pull/1087/head
XMRig 5 years ago
parent
commit
4263c6c381
  1. 47
      src/Summary.cpp
  2. 19
      src/Summary.h
  3. 5
      src/base/kernel/Entry.cpp
  4. 21
      src/base/kernel/config/BaseConfig.cpp

47
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());

19
src/Summary.h

@ -5,7 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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 */

5
src/base/kernel/Entry.cpp

@ -31,6 +31,9 @@
# include <openssl/opensslv.h>
#endif
#ifdef XMRIG_FEATURE_HWLOC
# include <hwloc.h>
#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;
}

21
src/base/kernel/config/BaseConfig.cpp

@ -34,6 +34,9 @@
# include <openssl/opensslv.h>
#endif
#ifdef XMRIG_FEATURE_HWLOC
# include <hwloc.h>
#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);
# 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<int>(strchr(v, ' ') - v), v);
snprintf(buf, sizeof buf, "OpenSSL/%.*s ", static_cast<int>(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());
}

Loading…
Cancel
Save