From fa2fc563a157d1c56eefe687079177e5aae92b2f Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 4 Oct 2017 21:54:38 +0300 Subject: [PATCH] Implement target bins removing 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 --- daemon/da_inst.c | 11 ++++++----- ui_viewer/ui_viewer_lib.c | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/daemon/da_inst.c b/daemon/da_inst.c index eef08b5..9d00bd5 100644 --- a/daemon/da_inst.c +++ b/daemon/da_inst.c @@ -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: diff --git a/ui_viewer/ui_viewer_lib.c b/ui_viewer/ui_viewer_lib.c index 7f995a2..f8101ac 100644 --- a/ui_viewer/ui_viewer_lib.c +++ b/ui_viewer/ui_viewer_lib.c @@ -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; -- 2.7.4