|
|
|
@@ -21,6 +21,7 @@ |
|
|
|
|
|
|
|
#include "framework/common/ge_inner_error_codes.h" |
|
|
|
#include "toolchain/slog.h" |
|
|
|
|
|
|
|
#ifdef __GNUC__ |
|
|
|
#include <unistd.h> |
|
|
|
#include <sys/syscall.h> |
|
|
|
@@ -35,21 +36,20 @@ extern "C" { |
|
|
|
#define GE_MODULE_NAME static_cast<int>(GE) |
|
|
|
|
|
|
|
// trace status of log |
|
|
|
enum TraceStatus { TRACE_INIT = 0, TRACE_RUNNING, TRACE_WAITING, TRACE_STOP }; |
|
|
|
enum TraceStatus { |
|
|
|
TRACE_INIT = 0, TRACE_RUNNING, TRACE_WAITING, TRACE_STOP |
|
|
|
}; |
|
|
|
|
|
|
|
class GeLog { |
|
|
|
public: |
|
|
|
public: |
|
|
|
static uint64_t GetTid() { |
|
|
|
#ifdef __GNUC__ |
|
|
|
static uint64_t GetTid() { |
|
|
|
thread_local static uint64_t tid = static_cast<uint64_t>(syscall(__NR_gettid)); |
|
|
|
return tid; |
|
|
|
} |
|
|
|
thread_local static uint64_t tid = static_cast<uint64_t>(syscall(__NR_gettid)); |
|
|
|
#else |
|
|
|
static uint64_t GetTid() { |
|
|
|
thread_local static uint64_t tid = static_cast<uint64_t>(GetCurrentThreadId()); |
|
|
|
return tid; |
|
|
|
} |
|
|
|
thread_local static uint64_t tid = static_cast<uint64_t>(GetCurrentThreadId()); |
|
|
|
#endif |
|
|
|
return tid; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
inline bool IsLogEnable(int module_name, int log_level) { |
|
|
|
|