Added debug thread log.

This commit is contained in:
XMRig 2018-09-15 16:48:57 +03:00
parent 93216a51f4
commit 812cd9760f
6 changed files with 47 additions and 13 deletions

View file

@ -24,6 +24,7 @@
#include <assert.h>
#include "common/log/Log.h"
#include "common/net/Pool.h"
#include "rapidjson/document.h"
#include "workers/CpuThread.h"
@ -361,6 +362,17 @@ xmrig::IThread::Multiway xmrig::CpuThread::multiway(AlgoVariant av)
}
#ifdef APP_DEBUG
void xmrig::CpuThread::print() const
{
LOG_DEBUG(GREEN_BOLD("CPU thread: ") " index " WHITE_BOLD("%zu") ", multiway " WHITE_BOLD("%d") ", av " WHITE_BOLD("%d") ",",
index(), static_cast<int>(multiway()), static_cast<int>(m_av));
LOG_DEBUG(" affine_to_cpu: %" PRId64, affinity());
}
#endif
#ifndef XMRIG_NO_API
rapidjson::Value xmrig::CpuThread::toAPI(rapidjson::Document &doc) const
{

View file

@ -21,8 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CPUTHREAD_H__
#define __CPUTHREAD_H__
#ifndef XMRIG_CPUTHREAD_H
#define XMRIG_CPUTHREAD_H
#include "common/xmrig.h"
@ -80,6 +80,10 @@ public:
inline Type type() const override { return CPU; }
protected:
# ifdef APP_DEBUG
void print() const override;
# endif
# ifndef XMRIG_NO_API
rapidjson::Value toAPI(rapidjson::Document &doc) const override;
# endif
@ -101,4 +105,4 @@ private:
} /* namespace xmrig */
#endif /* __CPUTHREAD_H__ */
#endif /* XMRIG_CPUTHREAD_H */

View file

@ -160,6 +160,14 @@ void Workers::setJob(const Job &job, bool donate)
void Workers::start(xmrig::Controller *controller)
{
# ifdef APP_DEBUG
LOG_NOTICE("THREADS ------------------------------------------------------------------");
for (const xmrig::IThread *thread : controller->config()->threads()) {
thread->print();
}
LOG_NOTICE("--------------------------------------------------------------------------");
# endif
m_controller = controller;
const std::vector<xmrig::IThread *> &threads = controller->config()->threads();