From ddbf2f16b0db2eef9fa011a177f8bef633e93598 Mon Sep 17 00:00:00 2001 From: Nikita Kalyazin Date: Thu, 8 Aug 2013 18:35:54 +0400 Subject: [PATCH] [FIX] wrong app start time Now time is sent in usecs --- helper/libdaprobe.c | 5 +++-- include/dahelper.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/helper/libdaprobe.c b/helper/libdaprobe.c index 7dba408..5a167cc 100755 --- a/helper/libdaprobe.c +++ b/helper/libdaprobe.c @@ -144,7 +144,7 @@ static int createSocket(void) { } - sprintf(buf, "%d|%u", getpid(), gTraceInfo.app.startTime); + sprintf(buf, "%d|%llu", getpid(), gTraceInfo.app.startTime); printLogStr(buf, MSG_PID); PRINTMSG("createSocket connect() success\n"); } @@ -327,7 +327,8 @@ void __attribute__((constructor)) _init_probe() // get app start time gettimeofday(&ttime, NULL); - gTraceInfo.app.startTime = ((ttime.tv_sec * 10000 + (ttime.tv_usec/100))); + gTraceInfo.app.startTime = (uint64_t)ttime.tv_sec * 1000 * 1000 + + ttime.tv_usec; // create socket for communication with da_daemon if(createSocket() == 0) diff --git a/include/dahelper.h b/include/dahelper.h index e764aee..0a5691e 100755 --- a/include/dahelper.h +++ b/include/dahelper.h @@ -176,7 +176,7 @@ typedef struct typedef struct { char appName[128]; - unsigned int startTime; + uint64_t startTime; } __appInfo; typedef struct -- 2.7.4