From d359ea58ac894527ff1e5f9560debd21aa1c8910 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 18 Apr 2024 10:11:51 -0700 Subject: [PATCH 1/2] Suppress in-actionable warnings in the iOS profiler. This is a benign log that is not actionable to the end user. The profiler checker for this and tries again anyway. Fixes https://github.com/flutter/flutter/issues/116193 --- .../darwin/ios/framework/Source/profiler_metrics_ios.mm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm b/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm index 01bb213d12275..a45f430077a40 100644 --- a/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm @@ -25,7 +25,7 @@ ~MachThreads() { kern_return_t kernel_return_code = vm_deallocate( mach_task_self(), reinterpret_cast(threads), thread_count * sizeof(thread_t)); - FML_CHECK(kernel_return_code == KERN_SUCCESS) << "Failed to deallocate thread infos."; + FML_DCHECK(kernel_return_code == KERN_SUCCESS) << "Failed to deallocate thread infos."; } private: @@ -165,8 +165,6 @@ void DeleteIO(io_object_t value) { kernel_return_code = task_threads(mach_task_self(), &mach_threads.threads, &mach_threads.thread_count); if (kernel_return_code != KERN_SUCCESS) { - FML_LOG(ERROR) << "Error retrieving task information: " - << mach_error_string(kernel_return_code); return std::nullopt; } @@ -203,8 +201,6 @@ void DeleteIO(io_object_t value) { num_threads--; break; default: - FML_LOG(ERROR) << "Error retrieving thread information: " - << mach_error_string(kernel_return_code); return std::nullopt; } } @@ -223,8 +219,6 @@ void DeleteIO(io_object_t value) { task_info(mach_task_self(), TASK_VM_INFO, reinterpret_cast(&task_memory_info), &task_memory_info_count); if (kernel_return_code != KERN_SUCCESS) { - FML_LOG(ERROR) << " Error retrieving task memory information: " - << mach_error_string(kernel_return_code); return std::nullopt; } From adf204a726d2d872145fe1d634bcd0217c4dbfd6 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 18 Apr 2024 11:48:40 -0700 Subject: [PATCH 2/2] Fix build. --- .../darwin/ios/framework/Source/profiler_metrics_ios.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm b/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm index a45f430077a40..ad97326d1116b 100644 --- a/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm @@ -23,7 +23,7 @@ MachThreads() = default; ~MachThreads() { - kern_return_t kernel_return_code = vm_deallocate( + [[maybe_unused]] kern_return_t kernel_return_code = vm_deallocate( mach_task_self(), reinterpret_cast(threads), thread_count * sizeof(thread_t)); FML_DCHECK(kernel_return_code == KERN_SUCCESS) << "Failed to deallocate thread infos."; }