From: Anastasia Lyupa Date: Thu, 24 Oct 2013 08:54:26 +0000 (+0400) Subject: [FIX] sampling start when profiling has not started X-Git-Tag: Tizen_SDK_2.3~149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e8ba54b1cba690c5374c8eef182ffbe1c9b24c4;p=platform%2Fcore%2Fsystem%2Fswap-manager.git [FIX] sampling start when profiling has not started Change-Id: I799bbefcd8e5d5b110dc77594540e46ac614ae73 Signed-off-by: Anastasia Lyupa --- diff --git a/daemon/da_protocol.c b/daemon/da_protocol.c index a403ba0..cc06545 100644 --- a/daemon/da_protocol.c +++ b/daemon/da_protocol.c @@ -993,6 +993,8 @@ static int process_msg_start(struct msg_buf_t *msg_control) goto send_ack; } + running_status_on(&prof_session); + if (start_profiling() < 0) { LOGE("cannot start profiling\n"); if (stop_all() != ERR_NO) { @@ -1003,7 +1005,6 @@ static int process_msg_start(struct msg_buf_t *msg_control) } err_code = ERR_NO; - running_status_on(&prof_session); send_ack: get_serialized_time(&serialized_time); sendACKToHost(NMSG_START, err_code, (void *)&serialized_time, diff --git a/daemon/threads.c b/daemon/threads.c index 7482170..3c43d84 100644 --- a/daemon/threads.c +++ b/daemon/threads.c @@ -301,6 +301,11 @@ int samplingStart() if(manager.sampling_thread != -1) // already started return 1; + if (check_running_status(&prof_session) == 0) { + LOGI("try to start sampling when running_status is 0\n"); + return 1; + } + if(pthread_create(&(manager.sampling_thread), NULL, samplingThread, NULL) < 0) { LOGE("Failed to create sampling thread\n");