[Matter.framework] Backtrace logging for MTRDeviceControllerFactory::… (#36113)

* [Matter.framework] Backtrace logging for MTRDeviceControllerFactory::startControllerFactory/stopControllerFactory

* Update src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm

---------

Co-authored-by: Justin Wood <woody@apple.com>
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
index 750ab64..8ab6a7d 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
@@ -327,6 +327,7 @@
                           error:(NSError * __autoreleasing *)error
 {
     [self _assertCurrentQueueIsNotMatterQueue];
+    [self _maybeLogBacktrace:@"Controller Factory Start"];
 
     __block CHIP_ERROR err = CHIP_ERROR_INTERNAL;
     dispatch_sync(_chipWorkQueue, ^{
@@ -418,6 +419,7 @@
 - (void)stopControllerFactory
 {
     [self _assertCurrentQueueIsNotMatterQueue];
+    [self _maybeLogBacktrace:@"Controller Factory Stop"];
 
     for (MTRDeviceController * controller in [_controllers copy]) {
         [controller shutdown];
@@ -1245,6 +1247,13 @@
     return systemState->Fabrics();
 }
 
+- (void)_maybeLogBacktrace:(NSString *)message
+{
+    @autoreleasepool {
+        MTR_LOG("[%@]: %@", message, [NSThread callStackSymbols]);
+    }
+}
+
 @end
 
 @interface MTRDummyStorage : NSObject <MTRStorage>