As it's done for tid
Change-Id: Ieecf7ce5cc7f82bd1a9e1ad3bc078278152ab573
Signed-off-by: Nikita Kalyazin <n.kalyazin@samsung.com>
__thread int gProbeBlockCount = 0;
__thread int gProbeDepth = 0;
+pid_t gPid = -1;
__thread pid_t gTid = -1;
int g_timerfd = 0;
}
}
+// return current process id
+static pid_t _getpid()
+{
+ if (gPid == -1)
+ gPid = getpid();
+ return gPid;
+}
+
// return current thread id
static pid_t _gettid()
{
real_pthread_mutex_unlock(&(gTraceInfo.index.eventMutex));
iProbe->currentTime = getCurrentTime();
- iProbe->pID = getpid();
+ iProbe->pID = _getpid();
iProbe->tID = _gettid();
iProbe->callDepth = gProbeDepth;