From 423fe95b84ad04aa831b8a41f3a307a19455e12e Mon Sep 17 00:00:00 2001 From: Vitaliy Cherepanov Date: Thu, 24 Apr 2014 12:52:16 +0400 Subject: [PATCH] [FIX] start profiling time value in MSG_START_ACK Change-Id: I7b9d07d514ca79c175261d5e5c3b9f9e0a8acc55 Signed-off-by: Vitaliy Cherepanov --- daemon/da_protocol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/daemon/da_protocol.c b/daemon/da_protocol.c index 4a37cd4..e74cba0 100644 --- a/daemon/da_protocol.c +++ b/daemon/da_protocol.c @@ -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) -- 2.7.4