diff --git a/src/backend/common/Workers.cpp b/src/backend/common/Workers.cpp index 7ed9bd8e..2d0729f3 100644 --- a/src/backend/common/Workers.cpp +++ b/src/backend/common/Workers.cpp @@ -29,6 +29,7 @@ #include "backend/common/Workers.h" #include "backend/cpu/CpuWorker.h" #include "base/io/log/Log.h" +#include "base/tools/Object.h" #ifdef XMRIG_FEATURE_OPENCL @@ -42,9 +43,10 @@ namespace xmrig { class WorkersPrivate { public: - inline WorkersPrivate() - { - } + XMRIG_DISABLE_COPY_MOVE(WorkersPrivate) + + + WorkersPrivate() = default; inline ~WorkersPrivate() @@ -155,7 +157,7 @@ void xmrig::Workers::onReady(void *arg) IWorker *worker = create(handle); if (!worker || !worker->selfTest()) { - LOG_ERR("thread %zu error: \"hash self-test failed\".", worker->id()); + LOG_ERR("%s " RED("thread ") RED_BOLD("#%zu") RED(" self-test failed"), T::tag(), worker->id()); delete worker; return; diff --git a/src/backend/common/interfaces/IBackend.h b/src/backend/common/interfaces/IBackend.h index 91f3e634..b284d188 100644 --- a/src/backend/common/interfaces/IBackend.h +++ b/src/backend/common/interfaces/IBackend.h @@ -26,7 +26,7 @@ #define XMRIG_IBACKEND_H -#include +#include #include "rapidjson/fwd.h" diff --git a/src/backend/cpu/CpuLaunchData.cpp b/src/backend/cpu/CpuLaunchData.cpp index 3916e7d2..bbfc6bba 100644 --- a/src/backend/cpu/CpuLaunchData.cpp +++ b/src/backend/cpu/CpuLaunchData.cpp @@ -24,13 +24,15 @@ */ -#include - - #include "backend/cpu/CpuLaunchData.h" + +#include "backend/common/Tags.h" #include "backend/cpu/CpuConfig.h" +#include + + xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread) : algorithm(algorithm), assembly(config.assembly()), @@ -65,3 +67,9 @@ xmrig::CnHash::AlgoVariant xmrig::CpuLaunchData::av() const return static_cast(!hwAES ? (intensity + 5) : (intensity + 2)); } + + +const char *xmrig::CpuLaunchData::tag() +{ + return cpu_tag(); +} diff --git a/src/backend/cpu/CpuLaunchData.h b/src/backend/cpu/CpuLaunchData.h index 92636bca..58673844 100644 --- a/src/backend/cpu/CpuLaunchData.h +++ b/src/backend/cpu/CpuLaunchData.h @@ -54,6 +54,8 @@ public: inline bool operator!=(const CpuLaunchData &other) const { return !isEqual(other); } inline bool operator==(const CpuLaunchData &other) const { return isEqual(other); } + static const char *tag(); + const Algorithm algorithm; const Assembly assembly; const bool hugePages; diff --git a/src/backend/opencl/OclLaunchData.cpp b/src/backend/opencl/OclLaunchData.cpp index f09e7b19..149ba075 100644 --- a/src/backend/opencl/OclLaunchData.cpp +++ b/src/backend/opencl/OclLaunchData.cpp @@ -25,6 +25,8 @@ #include "backend/opencl/OclLaunchData.h" + +#include "backend/common/Tags.h" #include "backend/opencl/OclConfig.h" @@ -45,3 +47,9 @@ bool xmrig::OclLaunchData::isEqual(const OclLaunchData &other) const return (other.algorithm == algorithm && other.thread == thread); } + + +const char *xmrig::OclLaunchData::tag() +{ + return ocl_tag(); +} diff --git a/src/backend/opencl/OclLaunchData.h b/src/backend/opencl/OclLaunchData.h index 66c2aaf0..ab4ca09b 100644 --- a/src/backend/opencl/OclLaunchData.h +++ b/src/backend/opencl/OclLaunchData.h @@ -62,6 +62,8 @@ public: inline bool operator!=(const OclLaunchData &other) const { return !isEqual(other); } inline bool operator==(const OclLaunchData &other) const { return isEqual(other); } + static const char *tag(); + cl_context ctx = nullptr; const Algorithm algorithm; const bool cache;