diff --git a/interfaces/innerkits/client/appspawn_client.c b/interfaces/innerkits/client/appspawn_client.c index bef4315beac8503d3b107e07070d7dbf787893e3..5699112c78bf2167577492397765f2df8b1c2c2a 100644 --- a/interfaces/innerkits/client/appspawn_client.c +++ b/interfaces/innerkits/client/appspawn_client.c @@ -432,16 +432,16 @@ int AppSpawnClientSendMsg(AppSpawnClientHandle handle, AppSpawnReqMsgHandle reqH APPSPAWN_CHECK(reqNode != NULL && reqNode->msg != NULL, AppSpawnReqMsgFree(reqHandle); return APPSPAWN_ARG_INVALID, "Invalid msgReq"); - APPSPAWN_LOGI("AppSpawnClientSendMsg reqId: %{public}u msgLen: %{public}u %{public}s", - reqNode->reqId, reqNode->msg->msgLen, reqNode->msg->processName); + APPSPAWN_LOGI("AppSpawnClientSendMsg reqId: %{public}u msgLen: %{public}u fd: %{public}d %{public}s", + reqNode->reqId, reqNode->msg->msgLen, reqMgr->socketId, reqNode->msg->processName); pthread_mutex_lock(&reqMgr->mutex); int ret = ClientSendMsg(reqMgr, reqNode, result); if (ret != 0) { result->result = ret; } pthread_mutex_unlock(&reqMgr->mutex); - APPSPAWN_LOGI("AppSpawnClientSendMsg reqId: %{public}u end result: 0x%{public}x pid: %{public}d", - reqNode->reqId, result->result, result->pid); + APPSPAWN_LOGI("AppSpawnClientSendMsg reqId: %{public}u fd: %{public}d end result: 0x%{public}x pid: %{public}d", + reqNode->reqId, reqMgr->socketId, result->result, result->pid); AppSpawnReqMsgFree(reqHandle); return ret; } diff --git a/standard/appspawn_appmgr.c b/standard/appspawn_appmgr.c index 4aa7701960136cbd44f9b176dab4ee243f8cfbdf..b864d494184e627f7853e96f6dc759ecd2ae9d9d 100644 --- a/standard/appspawn_appmgr.c +++ b/standard/appspawn_appmgr.c @@ -320,6 +320,7 @@ void DeleteAppSpawningCtx(AppSpawningCtx *property) DeleteAppSpawnMsg(&property->message); OH_ListRemove(&property->node); + OH_ListInit(&property->node); if (property->forkCtx.timer) { LE_StopTimer(LE_GetDefaultLoop(), property->forkCtx.timer); property->forkCtx.timer = NULL; diff --git a/standard/appspawn_main.c b/standard/appspawn_main.c index bed93f4d47b12ee2e0017711ebee1234571addf8..f3f753bb144c0f024c1e8148ffdb6e1efd11102f 100644 --- a/standard/appspawn_main.c +++ b/standard/appspawn_main.c @@ -21,6 +21,7 @@ #include "appspawn_modulemgr.h" #include "appspawn_manager.h" #include "appspawn_service.h" +#include "appspawn_trace.h" #include "parameter.h" #include "securec.h" @@ -154,7 +155,9 @@ int main(int argc, char *const argv[]) arg->serviceName); } } + StartAppspawnTrace("StartSpawnService"); AppSpawnContent *content = StartSpawnService(arg, argvSize, argc, argv); + FinishAppspawnTrace(); if (content != NULL) { content->runAppSpawn(content, argc, argv); } diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index 51eeec66540926ef9b7cc94bdb8d9743cda96ca9..b281c6690112ab423c805855b8a3cf4da116cb6d 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -200,7 +200,8 @@ APPSPAWN_STATIC void ProcessSignal(const struct signalfd_siginfo *siginfo) HandleDiedPid(pid, siginfo->ssi_uid, status); } #if (defined(CJAPP_SPAWN) || defined(NATIVE_SPAWN)) - if (OH_ListGetCnt(&GetAppSpawnMgr()->appQueue) == 0) { + if (OH_ListGetCnt(&GetAppSpawnMgr()->appQueue) == 0 && + OH_ListGetCnt(&GetAppSpawnMgr()->appSpawnQueue) == 0) { LE_StopLoop(LE_GetDefaultLoop()); } #endif @@ -1394,14 +1395,18 @@ AppSpawnContent *StartSpawnService(const AppSpawnStartArg *startArg, uint32_t ar } // load module appspawn/common + StartAppspawnTrace("AppSpawnLoadCommonModules"); AppSpawnLoadAutoRunModules(MODULE_COMMON); + FinishAppspawnTrace(); AppSpawnModuleMgrInstall(ASAN_MODULE_PATH); APPSPAWN_CHECK(LE_GetDefaultLoop() != NULL, return NULL, "Invalid default loop"); AppSpawnContent *content = AppSpawnCreateContent(arg->socketName, argv[0], argvSize, arg->mode); APPSPAWN_CHECK(content != NULL, return NULL, "Failed to create content for %{public}s", arg->socketName); + StartAppspawnTrace("AppSpawnLoadAutoRunModules"); AppSpawnLoadAutoRunModules(arg->moduleType); // load corresponding plugin according to startup mode + FinishAppspawnTrace(); int ret = ServerStageHookExecute(STAGE_SERVER_PRELOAD, content); // Preload, prase the sandbox APPSPAWN_CHECK(ret == 0, AppSpawnDestroyContent(content); return NULL, "Failed to prepare load %{public}s result: %{public}d", arg->serviceName, ret);