Skip to content

Commit 918320e

Browse files
authored
[Darwin] Subscription pool logging should note associated device (#36787)
1 parent f6163e4 commit 918320e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/darwin/Framework/CHIP/MTRDevice_Concrete.mm

+6-3
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,7 @@ - (void)_ensureSubscriptionForExistingDelegates:(NSString *)reason
814814
if ([self _deviceUsesThread]) {
815815
MTR_LOG(" => %@ - device is a thread device, scheduling in pool", self);
816816
mtr_weakify(self);
817+
NSString * description = [NSString stringWithFormat:@"MTRDevice setDelegate first subscription / controller resume (%p)", self];
817818
[self _scheduleSubscriptionPoolWork:^{
818819
mtr_strongify(self);
819820
VerifyOrReturn(self);
@@ -827,7 +828,7 @@ - (void)_ensureSubscriptionForExistingDelegates:(NSString *)reason
827828
std::lock_guard lock(self->_lock);
828829
[self _clearSubscriptionPoolWork];
829830
}];
830-
} inNanoseconds:0 description:@"MTRDevice setDelegate first subscription"];
831+
} inNanoseconds:0 description:description];
831832
} else {
832833
[_deviceController asyncDispatchToMatterQueue:^{
833834
std::lock_guard lock(self->_lock);
@@ -1350,7 +1351,8 @@ - (void)_handleResubscriptionNeededWithDelayOnDeviceQueue:(NSNumber *)resubscrip
13501351
if (deviceUsesThread) {
13511352
std::lock_guard lock(_lock);
13521353
// For Thread-enabled devices, schedule the _triggerResubscribeWithReason call to run in the subscription pool
1353-
[self _scheduleSubscriptionPoolWork:resubscriptionBlock inNanoseconds:resubscriptionDelayNs description:@"ReadClient resubscription"];
1354+
NSString * description = [NSString stringWithFormat:@"ReadClient resubscription (%p)", self];
1355+
[self _scheduleSubscriptionPoolWork:resubscriptionBlock inNanoseconds:resubscriptionDelayNs description:description];
13541356
} else {
13551357
// For non-Thread-enabled devices, just call the resubscription block after the specified time
13561358
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, resubscriptionDelayNs), self.queue, resubscriptionBlock);
@@ -1467,7 +1469,8 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay
14671469
int64_t resubscriptionDelayNs = static_cast<int64_t>(secondsToWait * NSEC_PER_SEC);
14681470
if ([self _deviceUsesThread]) {
14691471
// For Thread-enabled devices, schedule the _reattemptSubscriptionNowIfNeededWithReason call to run in the subscription pool
1470-
[self _scheduleSubscriptionPoolWork:resubscriptionBlock inNanoseconds:resubscriptionDelayNs description:@"MTRDevice resubscription"];
1472+
NSString * description = [NSString stringWithFormat:@"MTRDevice resubscription (%p)", self];
1473+
[self _scheduleSubscriptionPoolWork:resubscriptionBlock inNanoseconds:resubscriptionDelayNs description:description];
14711474
} else {
14721475
// For non-Thread-enabled devices, just call the resubscription block after the specified time
14731476
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, resubscriptionDelayNs), self.queue, resubscriptionBlock);

0 commit comments

Comments
 (0)