{
pthread_t pSelf;
- probeInfo_t probeInfo; log_t log;
- INIT_LOG;
-
+ probeInfo_t probeInfo;
+
PRE_UNCONDITIONAL_BLOCK_BEGIN();
- APPEND_LOG_BASIC(LC_THREAD);
- // input,ret,PCAddr,errno,InternalCall,CallerPCAddr
- log.length += sprintf(log.data + log.length, "`,`,`,0`,0`,1`,0");
+
pSelf = pthread_self();
- log.length += sprintf(log.data + log.length, "`,%lu`,`,%d`,%d",
- pSelf, THREAD_PTHREAD, THREAD_API_INTERNAL_STOP);
- APPEND_LOG_NULL_CALLSTACK();
- printLog(&log, MSG_LOG);
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "p", data);
ptrc = (thread_routine_call *) params;
pthread_t pSelf;
- probeInfo_t probeInfo; log_t log;
-
- // send INTERNAL_START log
- INIT_LOG;
+ probeInfo_t probeInfo;
PRE_UNCONDITIONAL_BLOCK_BEGIN();
- APPEND_LOG_BASIC(LC_THREAD);
- // input,ret,PCAddr,errno,InternalCall,CallerPCAddr
- log.length += sprintf(log.data + log.length, "`,`,`,0`,0`,1`,0");
+
pSelf = pthread_self();
- log.length += sprintf(log.data + log.length, "`,%lu`,`,%d`,%d",
- pSelf, THREAD_PTHREAD, THREAD_API_INTERNAL_START);
- APPEND_LOG_NULL_CALLSTACK();
- printLog(&log, MSG_LOG);
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "p", params);
ret = ptrc->thread_routine(ptrc->argument);
pthread_cleanup_pop(0);
- // send INTERNAL_STOP log
- INIT_LOG;
-
PRE_UNCONDITIONAL_BLOCK_BEGIN();
- APPEND_LOG_BASIC(LC_THREAD);
- // input,ret,PCAddr,errno,InternalCall,CallerPCAddr
- log.length += sprintf(log.data + log.length, "`,`,`,0`,0`,1`,0");
+
pSelf = pthread_self();
- log.length += sprintf(log.data + log.length, "`,%lu`,`,%d`,%d",
- pSelf, THREAD_PTHREAD, THREAD_API_INTERNAL_STOP);
- APPEND_LOG_NULL_CALLSTACK();
- printLog(&log, MSG_LOG);
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "p", params);
ret = pthread_createp(thread, attr, start_routine, arg);
}
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, *thread, THREAD_API_START,
- "%p,%p,%p,%p", thread, attr, start_routine, arg);
-
AFTER_PACK_ORIGINAL_THREAD(ret, *thread, THREAD_API_START,
"pppp", thread, attr, start_routine, arg);
{
static int (*pthread_joinp)(pthread_t thread, void **retval);
- DECLARE_VARIABLE_STANDARD; log_t log;
+ DECLARE_VARIABLE_STANDARD;
GET_REAL_FUNC(pthread_join, LIBPTHREAD);
PRE_PROBEBLOCK_BEGIN();
- // send WAIT_START log
- INIT_LOG;
- APPEND_LOG_BASIC(LC_THREAD);
- APPEND_LOG_INPUT("%lu,%p", thread, retval);
- //ret,PCAddr,errno,InternalCall
- log.length += sprintf(log.data + log.length, "`,`,0`,0`,%d", blockresult);
- APPEND_LOG_CALLER();
- log.length += sprintf(log.data + log.length, "`,%lu`,`,%d`,%d", thread,
- THREAD_PTHREAD, THREAD_API_WAIT_START);
- APPEND_LOG_NULL_CALLSTACK();
- printLog(&log, MSG_LOG);
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "xp", thread, retval);
newerrno = errno;
if(postBlockBegin(blockresult)) {
setProbePoint(&probeInfo);
- INIT_LOG;
- APPEND_LOG_BASIC(LC_THREAD);
- APPEND_LOG_INPUT("%lu,%p", thread, retval);
- APPEND_LOG_RESULT(VT_INT, ret);
- APPEND_LOG_CALLER();
-
- POST_PROBEBLOCK_MIDDLE_THREAD(thread, THREAD_API_WAIT_END);
- POST_PROBEBLOCK_CALLSTACK();
- printLog(&log, MSG_LOG);
-
+
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "xp", thread, retval);
PACK_COMMON_END(ret, errno, blockresult);
pthread_t pSelf;
static void (*pthread_exitp)(void *retval) __attribute__((noreturn));
- DECLARE_VARIABLE_STANDARD; log_t log;
+ DECLARE_VARIABLE_STANDARD;
GET_REAL_FUNC(pthread_exit, LIBPTHREAD);
PRE_PROBEBLOCK_BEGIN();
newerrno = 0;
- INIT_LOG;
- APPEND_LOG_BASIC(LC_THREAD);
- APPEND_LOG_INPUT("%p", retval);
- //ret,PCAddr,errno,InternalCall
- log.length += sprintf(log.data + log.length, "`,`,0`,0`,%d", blockresult);
- APPEND_LOG_CALLER();
pSelf = pthread_self();
- log.length += sprintf(log.data + log.length, "`,%lu`,`,%d`,%d",
- pSelf, THREAD_PTHREAD, THREAD_API_EXIT);
- APPEND_LOG_NULL_CALLSTACK();
- printLog(&log, MSG_LOG);
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_THREAD, LC_THREAD, "p", retval);
BEFORE_ORIGINAL_THREAD(pthread_cancel, LIBPTHREAD);
ret = pthread_cancelp(thread);
-
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_STOP, "%lu", thread);
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_STOP, "x", thread);
BEFORE_ORIGINAL_THREAD(pthread_detach, LIBPTHREAD);
ret = pthread_detachp(thread);
-
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER, "%lu", thread);
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER, "x", thread);
newerrno = errno;
if(postBlockBegin(blockresult)) {
- INIT_LOG;
- APPEND_LOG_BASIC(LC_THREAD);
- log.length += sprintf(log.data + log.length, "`,");
- APPEND_LOG_RESULT(VT_ULONG, ret_pthr);
- APPEND_LOG_CALLER();
-
- POST_PROBEBLOCK_MIDDLE_THREAD(ret_pthr, THREAD_API_OTHER);
- POST_PROBEBLOCK_CALLSTACK();
- printLog(&log, MSG_LOG);
AFTER_PACK_ORIGINAL_THREAD(ret_pthr, ret_pthr, THREAD_API_OTHER, "", 0);
BEFORE_ORIGINAL_THREAD(pthread_equal, LIBPTHREAD);
ret = pthread_equalp(t1, t2);
-
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, t1, THREAD_API_OTHER, "%lu,%lu", t1, t2);
AFTER_PACK_ORIGINAL_THREAD(ret, t1, THREAD_API_OTHER, "xx", t1, t2);
pSelf = pthread_self();
ret = pthread_setcancelstatep(state, oldstate);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, pSelf, THREAD_API_OTHER,
- "%d,%p", state, oldstate);
-
AFTER_PACK_ORIGINAL_THREAD(ret, pSelf, THREAD_API_OTHER,
"dp", state, oldstate);
pSelf = pthread_self();
ret = pthread_setcanceltypep(type, oldtype);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, pSelf, THREAD_API_OTHER,
- "%d,%p", type, oldtype);
-
AFTER_PACK_ORIGINAL_THREAD(ret, pSelf, THREAD_API_OTHER,
"dp", type, oldtype);
ret = pthread_attr_initp(attr);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER, "%p", attr);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER, "p", attr);
return ret;
ret = pthread_attr_destroyp(attr);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER, "%p", attr);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER, "p", attr);
return ret;
ret = pthread_attr_getdetachstatep(attr, detachstate);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, detachstate);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, detachstate);
ret = pthread_attr_setdetachstatep(attr, detachstate);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%d", attr, detachstate);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pd", attr, detachstate);
ret = pthread_attr_getstacksizep(attr, stacksize);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, stacksize);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, stacksize);
ret = pthread_attr_setstacksizep(attr, stacksize);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%u", attr, stacksize);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"px", attr, stacksize);
ret = pthread_attr_getstackaddrp(attr, stackaddr);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, stackaddr);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, stackaddr);
ret = pthread_attr_setstackaddrp(attr, stackaddr);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, stackaddr);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, stackaddr);
ret = pthread_attr_getinheritschedp(attr, inheritsched);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, inheritsched);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, inheritsched);
ret = pthread_attr_setinheritschedp(attr, inheritsched);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%d", attr, inheritsched);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pd", attr, inheritsched);
ret = pthread_attr_getschedparamp(attr, param);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, param);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, param);
ret = pthread_attr_setschedparamp(attr, param);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, param);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, param);
ret = pthread_attr_getschedpolicyp(attr, policy);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, policy);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, policy);
ret = pthread_attr_setschedpolicyp(attr, policy);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%d", attr, policy);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pd", attr, policy);
ret = pthread_attr_getguardsizep(attr, guardsize);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, guardsize);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, guardsize);
ret = pthread_attr_setguardsizep(attr, guardsize);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%u", attr, guardsize);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"px", attr, guardsize);
ret = pthread_attr_getscopep(attr, contentionscope);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p", attr, contentionscope);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pp", attr, contentionscope);
ret = pthread_attr_setscopep(attr, contentionscope);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%d", attr, contentionscope);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"pd", attr, contentionscope);
ret = pthread_attr_getstackp(attr, stackaddr, stacksize);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p,%p", attr, stackaddr, stacksize);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"ppp", attr, stackaddr, stacksize);
ret = pthread_attr_setstackp(attr, stackaddr, stacksize);
- AFTER_ORIGINAL_THREAD_RET(VT_INT, ret, thread, THREAD_API_OTHER,
- "%p,%p,%u", attr, stackaddr, stacksize);
-
AFTER_PACK_ORIGINAL_THREAD(ret, thread, THREAD_API_OTHER,
"ppx", attr, stackaddr, stacksize);