2017-06-07 22:16:45 +00:00
|
|
|
/* XMRig
|
|
|
|
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
|
|
|
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
|
|
|
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
|
|
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
|
|
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
2019-02-03 07:44:23 +00:00
|
|
|
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
|
|
|
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
|
|
|
* Copyright 2016-2019 XMRig <support@xmrig.com>
|
2017-06-07 22:16:45 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2017-07-18 19:38:38 +00:00
|
|
|
#include <inttypes.h>
|
2017-11-17 09:59:46 +00:00
|
|
|
#include <stdio.h>
|
2017-06-07 22:16:45 +00:00
|
|
|
#include <uv.h>
|
|
|
|
|
|
|
|
|
2019-03-26 18:29:37 +00:00
|
|
|
#include "base/io/log/Log.h"
|
2019-03-14 18:50:35 +00:00
|
|
|
#include "base/net/stratum/Pool.h"
|
2018-09-23 14:51:56 +00:00
|
|
|
#include "common/cpu/Cpu.h"
|
2018-03-31 09:29:47 +00:00
|
|
|
#include "core/Config.h"
|
|
|
|
#include "core/Controller.h"
|
2018-09-24 11:19:26 +00:00
|
|
|
#include "crypto/Asm.h"
|
2017-06-09 22:20:54 +00:00
|
|
|
#include "Mem.h"
|
2017-06-07 22:51:24 +00:00
|
|
|
#include "Summary.h"
|
2017-06-07 22:16:45 +00:00
|
|
|
#include "version.h"
|
|
|
|
|
|
|
|
|
2018-09-24 11:19:26 +00:00
|
|
|
#ifndef XMRIG_NO_ASM
|
|
|
|
static const char *coloredAsmNames[] = {
|
2019-03-26 18:29:37 +00:00
|
|
|
RED_BOLD("none"),
|
2018-09-24 11:19:26 +00:00
|
|
|
"auto",
|
2019-03-26 18:29:37 +00:00
|
|
|
GREEN_BOLD("intel"),
|
|
|
|
GREEN_BOLD("ryzen"),
|
|
|
|
GREEN_BOLD("bulldozer")
|
2018-09-24 11:19:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-03-26 18:29:37 +00:00
|
|
|
inline static const char *asmName(xmrig::Assembly assembly)
|
2018-09-24 11:19:26 +00:00
|
|
|
{
|
2019-03-26 18:29:37 +00:00
|
|
|
return coloredAsmNames[assembly];
|
2018-09-24 11:19:26 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2019-03-26 18:29:37 +00:00
|
|
|
static void print_memory(xmrig::Config *) {
|
2018-04-15 04:08:47 +00:00
|
|
|
# ifdef _WIN32
|
2019-03-26 18:29:37 +00:00
|
|
|
xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s",
|
|
|
|
"HUGE PAGES", Mem::isHugepagesAvailable() ? GREEN_BOLD("available") : RED_BOLD("unavailable"));
|
2018-04-15 04:08:47 +00:00
|
|
|
# endif
|
2017-06-09 22:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-03-26 18:29:37 +00:00
|
|
|
static void print_cpu(xmrig::Config *)
|
2017-06-07 22:16:45 +00:00
|
|
|
{
|
2018-09-23 14:51:56 +00:00
|
|
|
using namespace xmrig;
|
|
|
|
|
2019-03-26 18:29:37 +00:00
|
|
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s%s (%d)") " %sx64 %sAES %sAVX2",
|
|
|
|
"CPU",
|
|
|
|
Cpu::info()->brand(),
|
|
|
|
Cpu::info()->sockets(),
|
|
|
|
Cpu::info()->isX64() ? GREEN_BOLD_S : RED_BOLD("-"),
|
|
|
|
Cpu::info()->hasAES() ? GREEN_BOLD_S : RED_BOLD("-"),
|
|
|
|
Cpu::info()->hasAVX2() ? GREEN_BOLD_S : RED_BOLD("-")
|
|
|
|
);
|
|
|
|
# ifndef XMRIG_NO_LIBCPUID
|
|
|
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s%.1f MB/%.1f MB"), "CPU L2/L3", Cpu::info()->L2() / 1024.0, Cpu::info()->L3() / 1024.0);
|
|
|
|
# endif
|
2017-06-07 22:16:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-31 09:29:47 +00:00
|
|
|
static void print_threads(xmrig::Config *config)
|
2017-06-08 23:47:46 +00:00
|
|
|
{
|
2018-04-19 04:54:11 +00:00
|
|
|
if (config->threadsMode() != xmrig::Config::Advanced) {
|
2018-05-31 18:48:31 +00:00
|
|
|
char buf[32] = { 0 };
|
2018-04-19 04:54:11 +00:00
|
|
|
if (config->affinity() != -1L) {
|
2018-05-31 18:48:31 +00:00
|
|
|
snprintf(buf, sizeof buf, ", affinity=0x%" PRIX64, config->affinity());
|
2018-04-19 04:54:11 +00:00
|
|
|
}
|
|
|
|
|
2019-03-26 18:29:37 +00:00
|
|
|
xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("%d") WHITE_BOLD(", %s, av=%d, %sdonate=%d%%") WHITE_BOLD("%s"),
|
|
|
|
"THREADS",
|
|
|
|
config->threadsCount(),
|
|
|
|
config->algorithm().shortName(),
|
|
|
|
config->algoVariant(),
|
|
|
|
config->pools().donateLevel() == 0 ? RED_BOLD_S : "",
|
|
|
|
config->pools().donateLevel(),
|
|
|
|
buf
|
|
|
|
);
|
2017-06-08 23:47:46 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-03-26 18:29:37 +00:00
|
|
|
xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("%d") WHITE_BOLD(", %s, %sdonate=%d%%"),
|
|
|
|
"THREADS",
|
|
|
|
config->threadsCount(),
|
|
|
|
config->algorithm().shortName(),
|
|
|
|
config->pools().donateLevel() == 0 ? RED_BOLD_S : "",
|
|
|
|
config->pools().donateLevel()
|
|
|
|
);
|
2017-06-08 23:47:46 +00:00
|
|
|
}
|
2018-09-24 11:19:26 +00:00
|
|
|
|
|
|
|
# ifndef XMRIG_NO_ASM
|
|
|
|
if (config->assembly() == xmrig::ASM_AUTO) {
|
|
|
|
const xmrig::Assembly assembly = xmrig::Cpu::info()->assembly();
|
|
|
|
|
2019-03-26 18:29:37 +00:00
|
|
|
xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13sauto:%s"), asmName(assembly));
|
2018-09-24 11:19:26 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-03-26 18:29:37 +00:00
|
|
|
xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s%s"), asmName(config->assembly()));
|
2018-09-24 11:19:26 +00:00
|
|
|
}
|
|
|
|
# endif
|
2017-06-16 08:32:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-03-26 18:29:37 +00:00
|
|
|
static void print_commands(xmrig::Config *)
|
2017-07-23 07:04:23 +00:00
|
|
|
{
|
2019-03-26 18:29:37 +00:00
|
|
|
if (xmrig::Log::colors) {
|
2019-03-26 12:56:35 +00:00
|
|
|
xmrig::Log::print(GREEN_BOLD(" * ") WHITE_BOLD("COMMANDS ") MAGENTA_BOLD("h") WHITE_BOLD("ashrate, ")
|
2018-05-31 18:48:31 +00:00
|
|
|
MAGENTA_BOLD("p") WHITE_BOLD("ause, ")
|
|
|
|
MAGENTA_BOLD("r") WHITE_BOLD("esume"));
|
2017-07-23 07:04:23 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-03-26 12:56:35 +00:00
|
|
|
xmrig::Log::print(" * COMMANDS 'h' hashrate, 'p' pause, 'r' resume");
|
2017-07-23 07:04:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-31 09:29:47 +00:00
|
|
|
void Summary::print(xmrig::Controller *controller)
|
2017-06-07 22:16:45 +00:00
|
|
|
{
|
2018-09-16 02:04:20 +00:00
|
|
|
controller->config()->printVersions();
|
2018-03-31 09:29:47 +00:00
|
|
|
print_memory(controller->config());
|
|
|
|
print_cpu(controller->config());
|
|
|
|
print_threads(controller->config());
|
2018-09-16 02:04:20 +00:00
|
|
|
controller->config()->printPools();
|
|
|
|
controller->config()->printAPI();
|
2017-09-02 12:50:27 +00:00
|
|
|
|
2018-03-31 09:29:47 +00:00
|
|
|
print_commands(controller->config());
|
2017-06-07 22:16:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|