[FIX] start profiling time value in MSG_START_ACK 97/19997/2
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Thu, 24 Apr 2014 08:52:16 +0000 (12:52 +0400)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Fri, 25 Apr 2014 12:21:13 +0000 (05:21 -0700)
Change-Id: I7b9d07d514ca79c175261d5e5c3b9f9e0a8acc55
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
daemon/da_protocol.c

index 4a37cd4..e74cba0 100644 (file)
@@ -854,6 +854,9 @@ static int process_msg_start(struct msg_buf_t *msg_control)
        struct msg_t *msg_reply = NULL;
        uint32_t serialized_time[2];
 
+       //get start profiling time
+       get_serialized_time(serialized_time);
+
        if (check_running_status(&prof_session) == 1) {
                LOGW("Profiling has already been started\n");
                goto send_ack;
@@ -880,6 +883,9 @@ static int process_msg_start(struct msg_buf_t *msg_control)
                goto send_ack;
        }
 
+       //get time right before ioctl for more accurate start time value
+       get_serialized_time(serialized_time);
+
        if (ioctl_send_msg(msg_reply) != 0) {
                LOGE("cannot send message to device\n");
                goto send_ack;
@@ -898,7 +904,6 @@ static int process_msg_start(struct msg_buf_t *msg_control)
 
        err_code = ERR_NO;
 send_ack:
-       get_serialized_time(serialized_time);
        sendACKToHost(NMSG_START, err_code, (void *)&serialized_time,
                      sizeof(serialized_time));
        if (msg_reply != NULL)