diff --git a/modules/common/appspawn_begetctl.c b/modules/common/appspawn_begetctl.c index 3696bb8ffb15f38071f147ebdb5ee79abcb5b8b9..984af15423c02a83633d6bffa2b9199c1c6f41bc 100755 --- a/modules/common/appspawn_begetctl.c +++ b/modules/common/appspawn_begetctl.c @@ -70,7 +70,7 @@ APPSPAWN_STATIC int RunBegetctlBootApp(AppSpawnMgr *content, AppSpawningCtx *pro APPSPAWN_CHECK_ONLY_EXPER(property != NULL, return -1); UNUSED(content); if ((property->client.flags & APP_BEGETCTL_BOOT) != APP_BEGETCTL_BOOT) { - APPSPAWN_LOGW("Enter begetctl boot without BEGETCTL_BOOT flag set"); + APPSPAWN_LOGV("Enter begetctl boot without BEGETCTL_BOOT flag set"); return 0; } uint32_t len = 0; diff --git a/modules/sandbox/normal/sandbox_common.cpp b/modules/sandbox/normal/sandbox_common.cpp index 0503c71acc67f50612debf0c734b31d0dc70fe37..0e2aede3bce5f76f323caa3364694f4898d3e7ba 100644 --- a/modules/sandbox/normal/sandbox_common.cpp +++ b/modules/sandbox/normal/sandbox_common.cpp @@ -1015,7 +1015,7 @@ int32_t SandboxCommon::DoAppSandboxMountOnce(const AppSpawningCtx *appProperty, ret = mount(nullptr, arg->destPath, nullptr, arg->mountSharedFlag, nullptr); if (ret != 0) { - APPSPAWN_LOGI("errno is: %{public}d, private mount to %{public}s '%{public}u' failed", + APPSPAWN_DUMPI("errno is: %{public}d, private mount to %{public}s '%{public}u' failed", errno, arg->destPath, arg->mountSharedFlag); if (errno == EINVAL) { CheckMountStatus(arg->destPath); diff --git a/modules/sandbox/normal/sandbox_core.cpp b/modules/sandbox/normal/sandbox_core.cpp index ea47460d33e899971584fded47015ee6a65c0f25..d6598d1005ed5d650962c095076ac051ddb18f4e 100644 --- a/modules/sandbox/normal/sandbox_core.cpp +++ b/modules/sandbox/normal/sandbox_core.cpp @@ -434,7 +434,7 @@ int32_t SandboxCore::MountAllHsp(const AppSpawningCtx *appProperty, std::string APPSPAWN_CHECK(count == cJSON_GetArraySize(modules), return -1, "MountAllHsp: sizes are not same"); APPSPAWN_CHECK(count == cJSON_GetArraySize(versions), return -1, "MountAllHsp: sizes are not same"); - APPSPAWN_LOGI("MountAllHsp app: %{public}s, count: %{public}d", GetBundleName(appProperty), count); + APPSPAWN_LOGV("MountAllHsp app: %{public}s, count: %{public}d", GetBundleName(appProperty), count); for (int i = 0; i < count; i++) { if (!(cJSON_IsString(cJSON_GetArrayItem(bundles, i)) && cJSON_IsString(cJSON_GetArrayItem(modules, i)) && cJSON_IsString(cJSON_GetArrayItem(versions, i)))) { diff --git a/modules/sandbox/normal/sandbox_def.h b/modules/sandbox/normal/sandbox_def.h index e0dcfdc8c797c68fd03a01bcf0c69858b0e188bb..5a6d0469747daebda486158426342e32facbb890 100644 --- a/modules/sandbox/normal/sandbox_def.h +++ b/modules/sandbox/normal/sandbox_def.h @@ -30,7 +30,7 @@ constexpr int32_t FILE_ACCESS_COMMON_DIR_STATUS = 0; constexpr int32_t FILE_CROSS_APP_STATUS = 1; constexpr static mode_t FILE_MODE = 0711; constexpr static mode_t BASIC_MOUNT_FLAGS = MS_REC | MS_BIND; -constexpr int32_t MAX_MOUNT_TIME = 500; // 500us +constexpr int32_t MAX_MOUNT_TIME = 5000; // 5000us constexpr int32_t LOCK_STATUS_SIZE = 16; // 沙盒配置文件 diff --git a/modules/sandbox/normal/sandbox_shared_mount.cpp b/modules/sandbox/normal/sandbox_shared_mount.cpp index 6b68acaeeb39b64c69195784783c76ee42f15652..d7b127ba0627973c82c6992d3bb32c78c8b0496c 100644 --- a/modules/sandbox/normal/sandbox_shared_mount.cpp +++ b/modules/sandbox/normal/sandbox_shared_mount.cpp @@ -112,7 +112,7 @@ static bool IsUnlockStatus(uint32_t uid) std::string lockStatusParam = "startup.appspawn.lockstatus_" + std::to_string(uid); char userLockStatus[LOCK_STATUS_SIZE] = {0}; int ret = GetParameter(lockStatusParam.c_str(), "1", userLockStatus, sizeof(userLockStatus)); - APPSPAWN_LOGI("lockStatus %{public}u %{public}s", uid, userLockStatus); + APPSPAWN_DUMPI("lockStatus %{public}u %{public}s", uid, userLockStatus); if (ret > 0 && (strcmp(userLockStatus, "0") == 0)) { // 0:unlock status 1:lock status return true; } @@ -141,7 +141,7 @@ static int DoSharedMount(const SharedMountArgs *arg) APPSPAWN_LOGE("mount path %{public}s to shared failed, errno %{public}d", arg->destPath, errno); return ret; } - APPSPAWN_LOGI("mount path %{public}s to shared success", arg->destPath); + APPSPAWN_DUMPI("mount path %{public}s to shared success", arg->destPath); return 0; } diff --git a/modules/sandbox/sandbox_dec.c b/modules/sandbox/sandbox_dec.c index 72c0d4f8ecc49ec8ae99545226d0338456ce4c48..b093bed622715279c6c4c87e8d59e5e559e9e98d 100644 --- a/modules/sandbox/sandbox_dec.c +++ b/modules/sandbox/sandbox_dec.c @@ -127,7 +127,7 @@ static int SetDenyConstraintDirs(AppSpawnMgr *content) } else { APPSPAWN_LOGI("set CONSTRAINT_DEC_POLICY_CMD sandbox policy success."); for (uint32_t i = 0; i < decPolicyInfos.pathNum; i++) { - APPSPAWN_LOGI("policy info: %{public}s", decPolicyInfos.path[i].path); + APPSPAWN_DUMPI("%{public}s", decPolicyInfos.path[i].path); } } close(fd); @@ -159,9 +159,9 @@ static int SetForcedPrefixDirs(AppSpawnMgr *content) if (ioctl(fd, SET_DEC_PREFIX_CMD, &decPolicyInfos) < 0) { APPSPAWN_LOGE("set sandbox forced prefix failed."); } else { - APPSPAWN_LOGI("set SET_DEC_PREFIX_CMD sandbox policy success."); + APPSPAWN_LOGV("set SET_DEC_PREFIX_CMD sandbox policy success."); for (uint32_t i = 0; i < decPolicyInfos.pathNum; i++) { - APPSPAWN_LOGI("policy info: %{public}s", decPolicyInfos.path[i].path); + APPSPAWN_DUMPI("%{public}s", decPolicyInfos.path[i].path); } } close(fd); @@ -190,9 +190,9 @@ void SetDecPolicy(void) if (ioctl(fd, SET_DEC_POLICY_CMD, g_decPolicyInfos) < 0) { APPSPAWN_LOGE("set sandbox policy failed."); } else { - APPSPAWN_LOGI("set SET_DEC_POLICY_CMD sandbox policy success. timestamp:%{public}" PRId64 "", timestamp); + APPSPAWN_LOGV("set SET_DEC_POLICY_CMD sandbox policy success. timestamp:%{public}" PRId64 "", timestamp); for (uint32_t i = 0; i < g_decPolicyInfos->pathNum; i++) { - APPSPAWN_LOGI("policy info: path %{public}s, mode 0x%{public}x", + APPSPAWN_DUMPI("path %{public}s, mode 0x%{public}x", g_decPolicyInfos->path[i].path, g_decPolicyInfos->path[i].mode); } } diff --git a/standard/appspawn_msgmgr.c b/standard/appspawn_msgmgr.c index 51d9f8df2540d36b707290d91a72e25df0868a08..48825be4e6c3be4f28d8266f674867eebd945488 100644 --- a/standard/appspawn_msgmgr.c +++ b/standard/appspawn_msgmgr.c @@ -349,7 +349,7 @@ int GetAppSpawnMsgFromBuffer(const uint8_t *buffer, uint32_t bufferLen, static inline void DumpMsgFlags(const char *processName, const char *info, const AppSpawnMsgFlags *msgFlags) { for (uint32_t i = 0; i < msgFlags->count; i++) { - APPSPAWN_DUMP("processName: %{public}s %{public}d %{public}s flags: 0x%{public}x", + APPSPAWN_DUMP("%{public}s %{public}d %{public}s flags: 0x%{public}x", processName, i, info, msgFlags->flags[i]); } } diff --git a/util/include/appspawn_utils.h b/util/include/appspawn_utils.h index 7ce58c6d08016ba393c05b5ef3c1a673960eb954..255b4c4182c7b58630d39cadd275ce0c0b57038c 100644 --- a/util/include/appspawn_utils.h +++ b/util/include/appspawn_utils.h @@ -182,7 +182,7 @@ int EnableNewNetNamespace(void); HILOG_WARN(LOG_CORE, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__) #define APPSPAWN_LOGF(fmt, ...) \ HILOG_FATAL(LOG_CORE, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__) -#define APPSPAWN_DUMP_LOGI(fmt, ...) \ +#define APPSPAWN_DUMPI(fmt, ...) \ HILOG_INFO(LOG_CORE, fmt, ##__VA_ARGS__) #define APPSPAWN_DUMP(fmt, ...) \ do { \ @@ -202,7 +202,7 @@ int EnableNewNetNamespace(void); HILOG_DEBUG(HILOG_MODULE_HIVIEW, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__) #define APPSPAWN_LOGW(fmt, ...) \ HILOG_FATAL(HILOG_MODULE_HIVIEW, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__) -#define APPSPAWN_DUMP_LOGI(fmt, ...) \ +#define APPSPAWN_DUMPI(fmt, ...) \ HILOG_INFO(HILOG_MODULE_HIVIEW, fmt, ##__VA_ARGS__) #define APPSPAWN_KLOGI(fmt, ...) \ HILOG_INFO(HILOG_MODULE_HIVIEW, "[%{public}s:%{public}d]" fmt, (APP_FILE_NAME), (__LINE__), ##__VA_ARGS__)