From 64f1a231d14d75ac2167486a0bd00c165acb15a7 Mon Sep 17 00:00:00 2001 From: lixiang Date: Fri, 29 Nov 2024 20:34:35 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lixiang --- .../storage_daemon/mtpfs/test/mtpfs_tmp_files_pool_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/storage_daemon/mtpfs/test/mtpfs_tmp_files_pool_test.cpp b/services/storage_daemon/mtpfs/test/mtpfs_tmp_files_pool_test.cpp index ea621f66..b80ccb61 100644 --- a/services/storage_daemon/mtpfs/test/mtpfs_tmp_files_pool_test.cpp +++ b/services/storage_daemon/mtpfs/test/mtpfs_tmp_files_pool_test.cpp @@ -48,7 +48,7 @@ public: HWTEST_F(MtpfsTmpFilesPoolTest, MtpfsTmpFilesPoolTest_CreateTmpDir_001, TestSize.Level1) { GTEST_LOG_(INFO) << "MtpfsTmpFilesPoolTest_CreateTmpDir_001 start"; - auto mtptmpfilespool = std::make_shared(); + auto mtptmpfilespool = std::make_shared(); mtptmpfilespool->tmpDir_ = ""; bool result = mtptmpfilespool->CreateTmpDir(); EXPECT_EQ(result, false); @@ -63,7 +63,7 @@ HWTEST_F(MtpfsTmpFilesPoolTest, MtpfsTmpFilesPoolTest_CreateTmpDir_001, TestSize HWTEST_F(MtpfsTmpFilesPoolTest, MtpfsTmpFilesPoolTest_RemoveTmpDir_001, TestSize.Level1) { GTEST_LOG_(INFO) << "MtpfsTmpFilesPoolTest_RemoveTmpDir_001 start"; - auto mtptmpfilespool = std::make_shared(); + auto mtptmpfilespool = std::make_shared(); mtptmpfilespool->tmpDir_ = ""; bool result = mtptmpfilespool->RemoveTmpDir(); EXPECT_EQ(result, false); -- Gitee From 2c28f9e045d9bf3004903a3d783e59301a2809ab Mon Sep 17 00:00:00 2001 From: lixiang Date: Mon, 2 Dec 2024 11:00:03 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lixiang --- services/storage_daemon/quota/quota_manager.cpp | 6 ++++++ .../storage/src/storage_status_service.cpp | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/services/storage_daemon/quota/quota_manager.cpp b/services/storage_daemon/quota/quota_manager.cpp index 69a44c37..9a507146 100644 --- a/services/storage_daemon/quota/quota_manager.cpp +++ b/services/storage_daemon/quota/quota_manager.cpp @@ -108,6 +108,7 @@ static std::string GetQuotaSrcMountPath(const std::string &target) static int64_t GetOccupiedSpaceForUid(int32_t uid, int64_t &size) { + LOGE("GetOccupiedSpaceForUid uid:%{public}d", uid); if (InitialiseQuotaMounts() != true) { LOGE("Failed to initialise quota mounts"); return E_SYS_ERR; @@ -127,11 +128,13 @@ static int64_t GetOccupiedSpaceForUid(int32_t uid, int64_t &size) } size = static_cast(dq.dqb_curspace); + LOGE("GetOccupiedSpaceForUid size:%{public}ld", size); return E_OK; } static int64_t GetOccupiedSpaceForGid(int32_t gid, int64_t &size) { + LOGE("GetOccupiedSpaceForGid gid:%{public}d", gid); if (InitialiseQuotaMounts() != true) { LOGE("Failed to initialise quota mounts"); return E_SYS_ERR; @@ -151,12 +154,14 @@ static int64_t GetOccupiedSpaceForGid(int32_t gid, int64_t &size) } size = static_cast(dq.dqb_curspace); + LOGE("GetOccupiedSpaceForGid size:%{public}ld", size); return E_OK; } static int64_t GetOccupiedSpaceForPrjId(int32_t prjId, int64_t &size) { + LOGE("GetOccupiedSpaceForPrjId prjId:%{public}d", prjId); if (InitialiseQuotaMounts() != true) { LOGE("Failed to initialise quota mounts"); return E_SYS_ERR; @@ -176,6 +181,7 @@ static int64_t GetOccupiedSpaceForPrjId(int32_t prjId, int64_t &size) } size = static_cast(dq.dqb_curspace); + LOGE("GetOccupiedSpaceForPrjId size:%{public}ld", size); return E_OK; } diff --git a/services/storage_manager/storage/src/storage_status_service.cpp b/services/storage_manager/storage/src/storage_status_service.cpp index a475bfbd..e6ab7d9e 100644 --- a/services/storage_manager/storage/src/storage_status_service.cpp +++ b/services/storage_manager/storage/src/storage_status_service.cpp @@ -94,7 +94,7 @@ void GetMediaTypeAndSize(const std::shared_ptr &r int32_t GetMediaStorageStats(StorageStats &storageStats) { HITRACE_METER_NAME(HITRACE_TAG_FILEMANAGEMENT, __PRETTY_FUNCTION__); - LOGI("GetMediaStorageStats start"); + LOGE("GetMediaStorageStats start"); #ifdef STORAGE_SERVICE_GRAPHIC auto sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (sam == nullptr) { @@ -107,6 +107,7 @@ int32_t GetMediaStorageStats(StorageStats &storageStats) return E_REMOTE_IS_NULLPTR; } int32_t tryCount = 1; + LOGE("GetMediaStorageStats start Creator"); auto dataShareHelper = DataShare::DataShareHelper::Creator(remoteObj, MEDIALIBRARY_DATA_URI); while (dataShareHelper == nullptr && tryCount < GET_DATA_SHARE_HELPER_TIMES) { LOGW("dataShareHelper is retrying, attempt %{public}d", tryCount); @@ -120,6 +121,7 @@ int32_t GetMediaStorageStats(StorageStats &storageStats) vector columns; Uri uri(MEDIALIBRARY_DATA_URI + "/" + MEDIA_QUERYOPRN_QUERYVOLUME + "/" + MEDIA_QUERYOPRN_QUERYVOLUME); DataShare::DataSharePredicates predicates; + LOGE("GetMediaStorageStats start Query"); auto queryResultSet = dataShareHelper->Query(uri, predicates, columns); if (queryResultSet == nullptr) { LOGE("queryResultSet is null!"); @@ -134,20 +136,20 @@ int32_t GetMediaStorageStats(StorageStats &storageStats) GetMediaTypeAndSize(queryResultSet, storageStats); dataShareHelper->Release(); #endif - LOGI("GetMediaStorageStats end"); + LOGE("GetMediaStorageStats end"); return E_OK; } int32_t GetFileStorageStats(int32_t userId, StorageStats &storageStats) { HITRACE_METER_NAME(HITRACE_TAG_FILEMANAGEMENT, __PRETTY_FUNCTION__); - LOGI("GetFileStorageStats start"); + LOGE("GetFileStorageStats start"); int32_t err = E_OK; int32_t prjId = userId * USER_ID_BASE + UID_FILE_MANAGER; std::shared_ptr sdCommunication; sdCommunication = DelayedSingleton::GetInstance(); err = sdCommunication->GetOccupiedSpace(StorageDaemon::USRID, prjId, storageStats.file_); - LOGI("GetFileStorageStats end"); + LOGE("GetFileStorageStats end"); return err; } -- Gitee From f9f3bf50101d3ba7328e2876da142638fe83d6ea Mon Sep 17 00:00:00 2001 From: lixiang Date: Mon, 2 Dec 2024 12:02:54 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lixiang --- services/storage_daemon/quota/quota_manager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/storage_daemon/quota/quota_manager.cpp b/services/storage_daemon/quota/quota_manager.cpp index 9a507146..a793e791 100644 --- a/services/storage_daemon/quota/quota_manager.cpp +++ b/services/storage_daemon/quota/quota_manager.cpp @@ -128,7 +128,7 @@ static int64_t GetOccupiedSpaceForUid(int32_t uid, int64_t &size) } size = static_cast(dq.dqb_curspace); - LOGE("GetOccupiedSpaceForUid size:%{public}ld", size); + LOGE("GetOccupiedSpaceForUid size:%{public}s", size.c_str()); return E_OK; } @@ -154,7 +154,7 @@ static int64_t GetOccupiedSpaceForGid(int32_t gid, int64_t &size) } size = static_cast(dq.dqb_curspace); - LOGE("GetOccupiedSpaceForGid size:%{public}ld", size); + LOGE("GetOccupiedSpaceForGid size:%{public}s", size.c_str()); return E_OK; } @@ -181,7 +181,7 @@ static int64_t GetOccupiedSpaceForPrjId(int32_t prjId, int64_t &size) } size = static_cast(dq.dqb_curspace); - LOGE("GetOccupiedSpaceForPrjId size:%{public}ld", size); + LOGE("GetOccupiedSpaceForPrjId size:%{public}s", size.c_str()); return E_OK; } -- Gitee From b2f9e692c291af49d2471127327a3347eba40901 Mon Sep 17 00:00:00 2001 From: lixiang Date: Mon, 2 Dec 2024 17:23:44 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lixiang --- services/storage_daemon/quota/quota_manager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/storage_daemon/quota/quota_manager.cpp b/services/storage_daemon/quota/quota_manager.cpp index a793e791..1c788369 100644 --- a/services/storage_daemon/quota/quota_manager.cpp +++ b/services/storage_daemon/quota/quota_manager.cpp @@ -128,7 +128,7 @@ static int64_t GetOccupiedSpaceForUid(int32_t uid, int64_t &size) } size = static_cast(dq.dqb_curspace); - LOGE("GetOccupiedSpaceForUid size:%{public}s", size.c_str()); + LOGE("GetOccupiedSpaceForUid size:%{public}s", std::to_string(size).c_str()); return E_OK; } @@ -154,7 +154,7 @@ static int64_t GetOccupiedSpaceForGid(int32_t gid, int64_t &size) } size = static_cast(dq.dqb_curspace); - LOGE("GetOccupiedSpaceForGid size:%{public}s", size.c_str()); + LOGE("GetOccupiedSpaceForGid size:%{public}s", std::to_string(size).c_str()); return E_OK; } @@ -181,7 +181,7 @@ static int64_t GetOccupiedSpaceForPrjId(int32_t prjId, int64_t &size) } size = static_cast(dq.dqb_curspace); - LOGE("GetOccupiedSpaceForPrjId size:%{public}s", size.c_str()); + LOGE("GetOccupiedSpaceForPrjId size:%{public}s", std::to_string(size).c_str()); return E_OK; } -- Gitee