#include "probeinfo.h"
#include "dahelper.h"
+#include "binproto.h"
+
static enum DaOptions _sopt = OPT_THREAD;
extern __thread unsigned int gProbeDepth;
probeInfo.pID, probeInfo.tID);
_ThreadImpl* pSelf =(_ThreadImpl*)params;
- const Thread* pThread;
+ const Thread* pThread = NULL;
if(pSelf != null){
pThread = pSelf->GetThread();
}
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "p", params);
+ PACK_COMMON_END((unsigned int)pSelf, 0, blockresult);
+ PACK_THREAD((unsigned int)pThread, THREAD_OSPTHREAD_WORKER, THREAD_API_INTERNAL_START);
+ FLUSH_LOCAL_BUF();
+
preBlockEnd();
}
// all probe should be reachable inside thread start_routine (user implemented Thread::Run)
probeInfo.pID, probeInfo.tID);
_ThreadImpl* pSelf =(_ThreadImpl*)params;
- const Thread* pThread;
+ const Thread* pThread = NULL;
if(pSelf != null){
pThread = pSelf->GetThread();
}
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "p", params);
+ PACK_COMMON_END((unsigned int)pSelf, 0, blockresult);
+ PACK_THREAD((unsigned int)pThread, THREAD_OSPTHREAD_WORKER, THREAD_API_INTERNAL_STOP);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return null;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "x", milliSeconds);
+ PACK_COMMON_END(0, 0, blockresult);
+ PACK_THREAD((unsigned int)currentThread, THREAD_OSPTHREAD_WORKER, THREAD_API_WAIT_START);
+ FLUSH_LOCAL_BUF();
+
preBlockEnd();
}
//
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "x", milliSeconds);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int)currentThread, THREAD_OSPTHREAD_WORKER, THREAD_API_WAIT_END);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "", 0);
+ PACK_COMMON_END((unsigned int)currentThread, res, blockresult);
+ PACK_THREAD((unsigned int)currentThread, THREAD_OSPTHREAD_WORKER, THREAD_API_OTHER);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return currentThread;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "", 0);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int)currentThread, THREAD_OSPTHREAD_WORKER, THREAD_API_OTHER);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "d", exitCode);
+ PACK_COMMON_END(0, 0, blockresult);
+ PACK_THREAD((unsigned int)currentThread, THREAD_OSPTHREAD_WORKER, THREAD_API_EXIT);
+ FLUSH_LOCAL_BUF();
+
preBlockEnd();
}
//
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "dxd", threadType, stackSize, priority);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_NEW);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "xd", stackSize, priority);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_NEW);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "sxd", temp, stackSize, priority);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_NEW);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "sdxd", temp, threadType, stackSize, priority);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_NEW);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "xxd", (unsigned int) &target, stackSize, priority);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_NEW);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "sxxd", temp, (unsigned int) &target, stackSize, priority);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_NEW);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "d", exitCode);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_OTHER);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "s", temp);
+ PACK_COMMON_END(0, res, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_OTHER);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "", 0);
+ PACK_COMMON_END(0, 0, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_WAIT_START);
+ FLUSH_LOCAL_BUF();
+
preBlockEnd();
}
//
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "", 0);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_WAIT_END);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "", 0);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_START);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "", 0);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_WORKER, THREAD_API_STOP);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "xd", stackSize, priority);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_EVENTDRIVEN, THREAD_API_NEW);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "sx", temp, stackSize);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_EVENTDRIVEN, THREAD_API_NEW);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;
log.length += sprintf(log.data + log.length, "`,callstack_end");
printLog(&log, MSG_LOG);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "", 0);
+ PACK_COMMON_END(ret, ret, blockresult);
+ PACK_THREAD((unsigned int) this, THREAD_OSPTHREAD_EVENTDRIVEN, THREAD_API_STOP);
+ FLUSH_LOCAL_BUF();
+
postBlockEnd();
}
return ret;