有没有办法弄清楚一个块最初是从哪里排队的?特别是,我有一堆运行主线程检查器的块,但是没有显示我的哪个代码负责触发代码。通过许多网络请求之一调用该代码。
以下是示例输出:
Main Thread Checker: UI API called on a background thread: -[NSApplication applicationIconImage] PID: 17551, TID: 392092, Thread name: (none), Queue name: NSOperationQueue 0x7b5000004400 (QOS: UNSPECIFIED), QoS: 0 Backtrace: 4 USR ID Leash 0x0000000100455ee8 -[FABAppIconUtility mainAppIcon] + 63 5 USR ID Leash 0x0000000100455f1c -[FABAppIconUtility fetchApplicationIcon] + 20 6 USR ID Leash 0x0000000100455e86 -[FABAppIconUtility applicationIcon] + 42 7 USR ID Leash 0x0000000100457759 -[FABApplicationIdentifierModel icon] + 60 8 USR ID Leash 0x0000000100459c80 __43-[FABOnboardingOperation beginAppConfigure]_block_invoke + 905 9 USR ID Leash 0x00000001004563c9 -[FABMultipartMimeStreamEncoder encode:] + 61 10 USR ID Leash 0x00000001004596ad -[FABOnboardingOperation beginAppConfigure] + 238 11 USR ID Leash 0x0000000100451458 -[FABSettingsOnboardingManager beginOnboarding:endpointString:] + 389 12 USR ID Leash 0x0000000100451d8a -[FABSettingsOnboardingManager operation:didDownloadAndSaveSettingsWithError:] + 768 13 USR ID Leash 0x00000001004584a2 __43-[FABDownloadAndSaveSettingsOperation main]_block_invoke + 684 14 USR ID Leash 0x000000010045b473 __84-[FABNetworkClient startDownloadTaskWithRequest:retryLimit:tries:completionHandler:]_block_invoke_2 + 254 15 USR ID Leash 0x00000001004593b3 __84+[FABNetworkResponseHandler handleCompletedResponse:forOriginalRequest:error:block:]_block_invoke + 197 16 USR ID Leash 0x0000000100459165 +[FABNetworkResponseHandler clientResponseType:handler:] + 198 17 USR ID Leash 0x00000001004592a6 +[FABNetworkResponseHandler handleCompletedResponse:forOriginalRequest:error:block:] + 249 18 USR ID Leash 0x000000010045b331 __84-[FABNetworkClient startDownloadTaskWithRequest:retryLimit:tries:completionHandler:]_block_invoke + 227 19 CFNetwork 0x00007fff3966530f CFURLCredentialStorageCopyAllCredentials + 23762 20 CFNetwork 0x00007fff39676803 _CFHTTPMessageSetResponseProxyURL + 29358 21 Foundation 0x00007fff3d4ab8bd __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7 22 Foundation 0x00007fff3d4ab7b5 -[NSBlockOperation main] + 98 23 Foundation 0x00007fff3d61b560 __NSOPERATION_IS_INVOKING_MAIN__ + 17 24 Foundation 0x00007fff3d482544 -[NSOperation start] + 731 25 Foundation 0x00007fff3d61b96e __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 17 26 Foundation 0x00007fff3d4ab588 __NSOQSchedule_f + 182 27 libdispatch.dylib 0x000000010293286f _dispatch_client_callout + 8 28 libdispatch.dylib 0x00000001029360c3 _dispatch_block_invoke_direct + 289 29 libclang_rt.tsan_osx_dynamic.dylib 0x0000000100aef66c _ZN6__tsanL24invoke_and_release_blockEPv + 12 30 libclang_rt.tsan_osx_dynamic.dylib 0x0000000100aef3c2 _ZN6__tsanL22dispatch_callback_wrapEPv + 306 31 libdispatch.dylib 0x000000010293286f _dispatch_client_callout + 8 32 libdispatch.dylib 0x00000001029356c9 _dispatch_continuation_pop + 585 33 libdispatch.dylib 0x00000001029347bd _dispatch_async_redirect_invoke + 769 34 libdispatch.dylib 0x0000000102946431 _dispatch_root_queue_drain + 334 35 libdispatch.dylib 0x0000000102946ea3 _dispatch_worker_thread2 + 127 36 libsystem_pthread.dylib 0x00000001029be233 _pthread_wqthread + 495 37 libsystem_pthread.dylib 0x00000001029bdfcf start_wqthread + 15 2019/07/09 17:57:23:886 ¦ D ? ¦ subscribing to macOS notifications 2019-07-09 17:57:23.888406-0400 USR ID Leash[17551:392092] [reports] Main Thread Checker: UI API called on a background thread: -[NSApplication applicationIconImage] PID: 17551, TID: 392092, Thread name: (none), Queue name: NSOperationQueue 0x7b5000004400 (QOS: UNSPECIFIED), QoS: 0 Backtrace: 4 USR ID Leash 0x0000000100455ee8 -[FABAppIconUtility mainAppIcon] + 63 5 USR ID Leash 0x0000000100455f1c -[FABAppIconUtility fetchApplicationIcon] + 20 6 USR ID Leash 0x0000000100455e86 -[FABAppIconUtility applicationIcon] + 42 7 USR ID Leash 0x0000000100457759 -[FABApplicationIdentifierModel icon] + 60 8 USR ID Leash 0x0000000100459c80 __43-[FABOnboardingOperation beginAppConfigure]_block_invoke + 905 9 USR ID Leash 0x00000001004563c9 -[FABMultipartMimeStreamEncoder encode:] + 61 10 USR ID Leash 0x00000001004596ad -[FABOnboardingOperation beginAppConfigure] + 238 11 USR ID Leash 0x0000000100451458 -[FABSettingsOnboardingManager beginOnboarding:endpointString:] + 389 12 USR ID Leash 0x0000000100451d8a -[FABSettingsOnboardingManager operation:didDownloadAndSaveSettingsWithError:] + 768 13 USR ID Leash 0x00000001004584a2 __43-[FABDownloadAndSaveSettingsOperation main]_block_invoke + 684 14 USR ID Leash 0x000000010045b473 __84-[FABNetworkClient startDownloadTaskWithRequest:retryLimit:tries:completionHandler:]_block_invoke_2 + 254 15 USR ID Leash 0x00000001004593b3 __84+[FABNetworkResponseHandler handleCompletedResponse:forOriginalRequest:error:block:]_block_invoke + 197 16 USR ID Leash 0x0000000100459165 +[FABNetworkResponseHandler clientResponseType:handler:] + 198 17 USR ID Leash 0x00000001004592a6 +[FABNetworkResponseHandler handleCompletedResponse:forOriginalRequest:error:block:] + 249 18 USR ID Leash 0x000000010045b331 __84-[FABNetworkClient startDownloadTaskWithRequest:retryLimit:tries:completionHandler:]_block_invoke + 227 19 CFNetwork 0x00007fff3966530f CFURLCredentialStorageCopyAllCredentials + 23762 20 CFNetwork 0x00007fff39676803 _CFHTTPMessageSetResponseProxyURL + 29358 21 Foundation 0x00007fff3d4ab8bd __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7 22 Foundation 0x00007fff3d4ab7b5 -[NSBlockOperation main] + 98 23 Foundation 0x00007fff3d61b560 __NSOPERATION_IS_INVOKING_MAIN__ + 17 24 Foundation 0x00007fff3d482544 -[NSOperation start] + 731 25 Foundation 0x00007fff3d61b96e __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 17 26 Foundation 0x00007fff3d4ab588 __NSOQSchedule_f + 182 27 libdispatch.dylib 0x000000010293286f _dispatch_client_callout + 8 28 libdispatch.dylib 0x00000001029360c3 _dispatch_block_invoke_direct + 289 29 libclang_rt.tsan_osx_dynamic.dylib 0x0000000100aef66c _ZN6__tsanL24invoke_and_release_blockEPv + 12 30 libclang_rt.tsan_osx_dynamic.dylib 0x0000000100aef3c2 _ZN6__tsanL22dispatch_callback_wrapEPv + 306 31 libdispatch.dylib 0x000000010293286f _dispatch_client_callout + 8 32 libdispatch.dylib 0x00000001029356c9 _dispatch_continuation_pop + 585 33 libdispatch.dylib 0x00000001029347bd _dispatch_async_redirect_invoke + 769 34 libdispatch.dylib 0x0000000102946431 _dispatch_root_queue_drain + 334 35 libdispatch.dylib 0x0000000102946ea3 _dispatch_worker_thread2 + 127 36 libsystem_pthread.dylib 0x00000001029be233 _pthread_wqthread + 495 37 libsystem_pthread.dylib 0x00000001029bdfcf start_wqthread + 15 (lldb)