Skip to content

Commit 79c1cf5

Browse files
[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>
1 parent 3d75573 commit 79c1cf5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm

+9
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ - (BOOL)_startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParam
327327
error:(NSError * __autoreleasing *)error
328328
{
329329
[self _assertCurrentQueueIsNotMatterQueue];
330+
[self _maybeLogBacktrace:@"Controller Factory Start"];
330331

331332
__block CHIP_ERROR err = CHIP_ERROR_INTERNAL;
332333
dispatch_sync(_chipWorkQueue, ^{
@@ -418,6 +419,7 @@ - (BOOL)_startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParam
418419
- (void)stopControllerFactory
419420
{
420421
[self _assertCurrentQueueIsNotMatterQueue];
422+
[self _maybeLogBacktrace:@"Controller Factory Stop"];
421423

422424
for (MTRDeviceController * controller in [_controllers copy]) {
423425
[controller shutdown];
@@ -1245,6 +1247,13 @@ - (FabricTable * _Nullable)fabricTable
12451247
return systemState->Fabrics();
12461248
}
12471249

1250+
- (void)_maybeLogBacktrace:(NSString *)message
1251+
{
1252+
@autoreleasepool {
1253+
MTR_LOG("[%@]: %@", message, [NSThread callStackSymbols]);
1254+
}
1255+
}
1256+
12481257
@end
12491258

12501259
@interface MTRDummyStorage : NSObject <MTRStorage>

0 commit comments

Comments
 (0)