From 3bba94a45fcca64b57d3dfa158b18b6da720a074 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 18 Apr 2024 12:50:27 -0700 Subject: [PATCH] Suppress in-actionable warnings in the iOS profiler. (flutter/engine#52227) 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 --- .../ios/framework/Source/profiler_metrics_ios.mm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm index 01bb213d12..ad97326d11 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/profiler_metrics_ios.mm @@ -23,9 +23,9 @@ class MachThreads { 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_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 @@ std::optional ProfilerMetricsIOS::CpuUsage() { 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 @@ std::optional ProfilerMetricsIOS::CpuUsage() { num_threads--; break; default: - FML_LOG(ERROR) << "Error retrieving thread information: " - << mach_error_string(kernel_return_code); return std::nullopt; } } @@ -223,8 +219,6 @@ std::optional ProfilerMetricsIOS::MemoryUsage() { 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; }