Making tracing use the fast logger path.

This commit is contained in:
Ben Vanik 2015-09-05 21:12:10 -07:00
parent 6c07eb8e5c
commit 33270cd2a0
1 changed files with 7 additions and 13 deletions

View File

@ -11,6 +11,7 @@
#include <cinttypes> #include <cinttypes>
#include "xenia/base/logging.h"
#include "xenia/base/vec128.h" #include "xenia/base/vec128.h"
#include "xenia/cpu/backend/x64/x64_emitter.h" #include "xenia/cpu/backend/x64/x64_emitter.h"
#include "xenia/cpu/processor.h" #include "xenia/cpu/processor.h"
@ -30,19 +31,12 @@ bool trace_enabled = true;
#define THREAD_MATCH \ #define THREAD_MATCH \
(!TARGET_THREAD || thread_state->thread_id() == TARGET_THREAD) (!TARGET_THREAD || thread_state->thread_id() == TARGET_THREAD)
#if !DTRACE
#define IFLUSH() \
if (trace_enabled && THREAD_MATCH) fflush(stdout)
#else
#define IFLUSH() #define IFLUSH()
#endif #define IPRINT(s) \
#define IPRINT \ if (trace_enabled && THREAD_MATCH) xe::LogLine('t', s)
if (trace_enabled && THREAD_MATCH) printf #define DFLUSH()
#define DFLUSH() \ #define DPRINT(...) \
if (trace_enabled && THREAD_MATCH) fflush(stdout) if (trace_enabled && THREAD_MATCH) xe::LogLineFormat('t', __VA_ARGS__)
#define DPRINT \
DFLUSH(); \
if (trace_enabled && THREAD_MATCH) printf
uint32_t GetTracingMode() { uint32_t GetTracingMode() {
uint32_t mode = 0; uint32_t mode = 0;
@ -57,7 +51,7 @@ uint32_t GetTracingMode() {
void TraceString(void* raw_context, const char* str) { void TraceString(void* raw_context, const char* str) {
auto thread_state = *reinterpret_cast<ThreadState**>(raw_context); auto thread_state = *reinterpret_cast<ThreadState**>(raw_context);
IPRINT("XE[t] :%d: %s\n", thread_state->thread_id(), str); IPRINT(str);
IFLUSH(); IFLUSH();
} }