cpc = (candidate_process_context_t*)user_data;
__update_slot_state(cpc, launchpad::LoaderMethod::Ttl, false);
- _D("Deactivate event: type(%d)", cpc->type);
+ _D("Deactivate event: type(%d), loader_name(%s)",
+ cpc->type, cpc->loader_name);
return G_SOURCE_REMOVE;
}
cpc = (candidate_process_context_t*)user_data;
cpc->timer = 0;
+ _W("type(%d), loader_name(%s), state(%d)",
+ cpc->type, cpc->loader_name, cpc->state);
if (cpc->pid != CANDIDATE_NONE) {
_W("Candidate(%d) process(%d) is running", cpc->type, cpc->pid);
return G_SOURCE_REMOVE;
}
static void __set_timer(candidate_process_context_t* cpc) {
- if (cpc == nullptr || cpc->timer > 0)
+ if (cpc == nullptr || cpc->timer > 0) {
+ _E("Invalid parameter");
return;
+ }
- if ((cpc->detection_method & static_cast<int>(launchpad::LoaderMethod::Timeout)) &&
+ _W("type(%d), loader_name(%s), state(%d)",
+ cpc->type, cpc->loader_name, cpc->state);
+ if ((cpc->detection_method &
+ static_cast<int>(launchpad::LoaderMethod::Timeout)) &&
cpc->state == CANDIDATE_PROCESS_STATE_RUNNING) {
cpc->timer = g_timeout_add(cpc->timeout_val, __handle_timeout_event, cpc);
+ if (cpc->timer == 0)
+ _E("g_timeout_add() is failed. %d:%s", cpc->type, cpc->loader_name);
+ } else {
+ _E("Skip adding timer. detection_method(%d), state(%d)",
+ cpc->detection_method, cpc->state);
}
}
if (!cpc)
return;
- _D("Dispose candidate process %d", cpc->type);
+ _D("Dispose candidate process %d:%s", cpc->type, cpc->loader_name);
if (cpc->pid > 0) {
_D("kill process %d", cpc->pid);
__kill_process(cpc->pid);
__dispose_candidate_process(cpc);
- _D("Dispose hydra process %d", cpc->type);
+ _D("Dispose hydra process %d:%s", cpc->type, cpc->loader_name);
if (cpc->hydra_pid > 0) {
_D("kill process %d", cpc->hydra_pid);
__kill_process(cpc->hydra_pid);
return -1;
__candidate_process_real_launch(cpc->send_fd, pkt);
- SECURE_LOGD("Request to candidate process, pid: %d, bin path: %s", cpc->pid,
+ _W("Request to candidate process, pid: %d, bin path: %s", cpc->pid,
app_path);
pid = cpc->pid;
return;
cpc->app_exists = app_exists;
+ _W("type(%d), loader_name(%s), app_check(%d), app_exists(%d)",
+ cpc->type, cpc->loader_name, cpc->app_check, cpc->app_exists);
if (cpc->app_check && !cpc->app_exists) {
if (cpc->pid > 0)
__dispose_candidate_process(cpc);
}
static void __deactivate_slot(candidate_process_context_t* cpc) {
+ _W("type(%d), loader_name(%s), state(%d)",
+ cpc->type, cpc->loader_name, cpc->state);
if (cpc->state == CANDIDATE_PROCESS_STATE_PAUSED)
return;
}
static void __activate_slot(candidate_process_context_t* cpc) {
+ _W("type(%d), loader_name(%s), state(%d)",
+ cpc->type, cpc->loader_name, cpc->state);
if (cpc->state == CANDIDATE_PROCESS_STATE_RUNNING)
return;
if ((cpc->app_check && !cpc->app_exists) || cpc->pid > CANDIDATE_NONE)
return;
- if (cpc->detection_method & static_cast<int>(launchpad::LoaderMethod::Timeout))
+ if (cpc->detection_method &
+ static_cast<int>(launchpad::LoaderMethod::Timeout))
__set_timer(cpc);
}
static void __update_slot_state(candidate_process_context_t* cpc,
- launchpad::LoaderMethod method,
- bool force) {
+ launchpad::LoaderMethod method, bool force) {
+ _W("type(%d), loader_name(%s), state(%d), method(%d), force(%d)",
+ cpc->type, cpc->loader_name, cpc->state, static_cast<int>(method), force);
switch (method) {
case launchpad::LoaderMethod::OutOfMemory:
- if ((force || cpc->deactivation_method & static_cast<int>(method)) && __is_low_memory()) {
+ if ((force || cpc->deactivation_method & static_cast<int>(method)) &&
+ __is_low_memory()) {
_W("Low memory, deactivate slot %d", cpc->type);
__deactivate_slot(cpc);
} else {