Implement target bins removing 95/162395/2 submit/tizen_4.0/20180109.094119
authorAlexander Aksenov <a.aksenov@samsung.com>
Wed, 4 Oct 2017 18:54:38 +0000 (21:54 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 30 Nov 2017 16:57:56 +0000 (19:57 +0300)
Now removing of target bins is handled, they are cleaned on
uninit, messages SWAP_INST_ADD and SWAP_INST_REMOVE handled
in different ways

This commit is related with the same name commit for swap-probe

Change-Id: I85da23d586c685fe0dde75ef79512447ce923a09
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
daemon/da_inst.c
ui_viewer/ui_viewer_lib.c

index eef08b5..9d00bd5 100644 (file)
@@ -700,7 +700,8 @@ static void unlock_lib_list()
        pthread_mutex_unlock(&lib_maps_message_mutex);
 }
 
-static void generate_target_bins(struct user_space_inst_t *us_inst)
+static void generate_target_bins(struct user_space_inst_t *us_inst,
+                                enum AppMessageType type)
 {
        lock_lib_maps_message();
 
@@ -747,7 +748,7 @@ static void generate_target_bins(struct user_space_inst_t *us_inst)
                LOGE("Can't allocate memory for lib_maps_message\n");
                goto unlock_lib_maps_msg;
        }
-       lib_maps_message->type = APP_MSG_TARGET_BINS;
+       lib_maps_message->type = type;
        lib_maps_message->length = total_len;
 
        /* pack data */
@@ -1086,7 +1087,7 @@ int msg_start(struct msg_buf_t *data, struct user_space_inst_t *us_inst,
        if (write_procs(us_inst))
                LOGE("Error adding binaries\n");
 
-       generate_target_bins(us_inst);
+       generate_target_bins(us_inst, APP_MSG_TARGET_BINS_ADD);
 
        if (!add_preload_probes(&us_inst->lib_inst_list)) {
                LOGE("cannot add preload probe\n");
@@ -1169,7 +1170,7 @@ int msg_swap_inst_add(struct msg_buf_t *data, struct user_space_inst_t *us_inst,
        if (write_procs(us_inst))
                LOGE("Error adding binaries\n");
 
-       generate_target_bins(us_inst);
+       generate_target_bins(us_inst, APP_MSG_TARGET_BINS_ADD);
        send_target_bins_to_all_targets();
 
 msg_swap_inst_add_exit:
@@ -1222,7 +1223,7 @@ int msg_swap_inst_remove(struct msg_buf_t *data, struct user_space_inst_t *us_in
 
        if (write_procs(us_inst))
                LOGE("Error adding binaries\n");
-       generate_target_bins(us_inst);
+       generate_target_bins(us_inst, APP_MSG_TARGET_BINS_REMOVE);
        send_target_bins_to_all_targets();
 
 msg_swap_inst_remove_exit:
index 7f995a2..f8101ac 100644 (file)
@@ -293,8 +293,8 @@ static int createSocket(void)
                                        PRINTMSG("APP_MSG_CONFIG");
                                        _configure(data_buf);
                                        recved |= MSG_CONFIG_RECV;
-                               } else if (log.type == APP_MSG_TARGET_BINS) {
-                                       PRINTMSG("APP_MSG_TARGET_BINS <%u>",
+                               } else if (log.type == APP_MSG_TARGET_BINS_ADD) {
+                                       PRINTMSG("APP_MSG_TARGET_BINS_ADD <%u>",
                                                 *((const uint32_t *)data_buf));
                                        /* do nothing */
                                        recved |= MSG_TARGET_BINS_RECV;
@@ -396,8 +396,10 @@ static void *recvThread(void __unused *data)
                                PRINTMSG("APP_MSG_STOP_WITHOUT_KILL");
                                do_finit();
                                break;
-                       } else if(log.type == APP_MSG_TARGET_BINS) {
-                               PRINTMSG("APP_MSG_TARGET_BINS");
+                       } else if (log.type == APP_MSG_TARGET_BINS_ADD) {
+                               PRINTMSG("APP_MSG_TARGET_BINS_ADD");
+                       } else if (log.type == APP_MSG_TARGET_BINS_REMOVE) {
+                               PRINTMSG("APP_MSG_TARGET_BINS_REMOVE");
                        } else if(log.type == APP_MSG_GET_UI_HIERARCHY) {
                                enum ErrorCode err_code = ERR_UNKNOWN;
                                Eina_Bool rendering;