Added printHealth to IBackend interface.

This commit is contained in:
XMRig 2020-02-14 01:11:53 +07:00
parent 56f23db878
commit 2f27d5d108
No known key found for this signature in database
GPG key ID: 446A53638BE94409
8 changed files with 54 additions and 44 deletions

View file

@ -5,8 +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 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 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
@ -254,7 +254,8 @@ public:
}
}
LOG_INFO(CYAN_BOLD("#%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CLEAR WHITE_BOLD("%s") "%s",
LOG_INFO("%s" CYAN_BOLD(" #%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CLEAR WHITE_BOLD("%s") "%s",
tag,
device.index(),
device.topology().toString().data(),
health.power,
@ -338,13 +339,8 @@ const xmrig::String &xmrig::CudaBackend::type() const
}
void xmrig::CudaBackend::execCommand(char command)
void xmrig::CudaBackend::execCommand(char)
{
# ifdef XMRIG_FEATURE_NVML
if (command == 'e' || command == 'E') {
d_ptr->printHealth();
}
# endif
}
@ -387,6 +383,14 @@ void xmrig::CudaBackend::printHashrate(bool details)
}
void xmrig::CudaBackend::printHealth()
{
# ifdef XMRIG_FEATURE_NVML
d_ptr->printHealth();
# endif
}
void xmrig::CudaBackend::setJob(const Job &job)
{
const auto &cuda = d_ptr->controller->config()->cuda();
@ -455,15 +459,6 @@ void xmrig::CudaBackend::stop()
void xmrig::CudaBackend::tick(uint64_t ticks)
{
d_ptr->workers.tick(ticks);
# ifdef XMRIG_FEATURE_NVML
if (isEnabled()) {
auto seconds = d_ptr->controller->config()->healthPrintTime();
if (seconds && ticks && (ticks % (seconds * 2)) == 0) {
d_ptr->printHealth();
}
}
# endif
}