diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 11935f85c0ce31..8d54480789d9de 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -253,6 +253,7 @@ target_compile_options(${COMPONENT_LIB} PRIVATE "-DPW_RPC_LIGHTING_SERVICE=1" "-DPW_RPC_LOCKING_SERVICE=1" "-DPW_RPC_TRACING_SERVICE=1" - "-DPW_RPC_WIFI_SERVICE=1") + "-DPW_RPC_WIFI_SERVICE=1" + "-DPW_TRACE_BACKEND_SET=1") endif (CONFIG_ENABLE_PW_RPC) diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index 4755a2b9ec961b..1656937b0b050a 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -235,7 +235,8 @@ target_compile_options(app PRIVATE "-DPW_RPC_DEVICE_SERVICE=1" "-DPW_RPC_LIGHTING_SERVICE=1" "-DPW_RPC_THREAD_SERVICE=1" - "-DPW_RPC_TRACING_SERVICE=1") + "-DPW_RPC_TRACING_SERVICE=1" + "-DPW_TRACE_BACKEND_SET=1") target_link_libraries(app PRIVATE attributes_service.nanopb_rpc diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 6001f601142487..c46cfdd603fe21 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -32,6 +32,7 @@ #include #include #include +#include using namespace chip; using namespace chip::app; @@ -131,6 +132,7 @@ bool emberAfGeneralCommissioningClusterArmFailSafeCallback(app::CommandHandler * const app::ConcreteCommandPath & commandPath, const Commands::ArmFailSafe::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("ArmFailSafe", "GeneralCommissioning"); FailSafeContext & failSafeContext = DeviceLayer::DeviceControlServer::DeviceControlSvr().GetFailSafeContext(); Commands::ArmFailSafeResponse::Type response; @@ -162,6 +164,7 @@ bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback( app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::CommissioningComplete::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("CommissioningComplete", "GeneralCommissioning"); DeviceControlServer * server = &DeviceLayer::DeviceControlServer::DeviceControlSvr(); /* @@ -184,6 +187,7 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(app::CommandH const app::ConcreteCommandPath & commandPath, const Commands::SetRegulatoryConfig::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("SetRegulatoryConfig", "GeneralCommissioning"); DeviceControlServer * server = &DeviceLayer::DeviceControlServer::DeviceControlSvr(); CheckSuccess(server->SetRegulatoryConfig(to_underlying(commandData.location), commandData.countryCode, commandData.breadcrumb), diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index 3ae06ed65a1aad..fb3ff2b8a63246 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -27,6 +27,7 @@ #include #include #include +#include using namespace chip; using namespace chip::app; @@ -269,7 +270,7 @@ void Instance::OnNetworkingStatusChange(DeviceLayer::NetworkCommissioning::Statu void Instance::HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetworks::DecodableType & req) { - + MATTER_TRACE_EVENT_SCOPE("HandleScanNetwork", "NetworkCommissioning"); if (mFeatureFlags.Has(NetworkCommissioningFeature::kWiFiNetworkInterface)) { mAsyncCommandHandle = CommandHandler::Handle(&ctx.mCommandHandler); @@ -288,6 +289,7 @@ void Instance::HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetw void Instance::HandleAddOrUpdateWiFiNetwork(HandlerContext & ctx, const Commands::AddOrUpdateWiFiNetwork::DecodableType & req) { + MATTER_TRACE_EVENT_SCOPE("HandleAddOrUpdateWiFiNetwork", "NetworkCommissioning"); Commands::NetworkConfigResponse::Type response; response.networkingStatus = ToClusterObjectEnum(mpDriver.Get()->AddOrUpdateNetwork(req.ssid, req.credentials)); ctx.mCommandHandler.AddResponseData(ctx.mRequestPath, response); @@ -295,6 +297,7 @@ void Instance::HandleAddOrUpdateWiFiNetwork(HandlerContext & ctx, const Commands void Instance::HandleAddOrUpdateThreadNetwork(HandlerContext & ctx, const Commands::AddOrUpdateThreadNetwork::DecodableType & req) { + MATTER_TRACE_EVENT_SCOPE("HandleAddOrUpdateThreadNetwork", "NetworkCommissioning"); Commands::NetworkConfigResponse::Type response; response.networkingStatus = ToClusterObjectEnum(mpDriver.Get()->AddOrUpdateNetwork(req.operationalDataset)); ctx.mCommandHandler.AddResponseData(ctx.mRequestPath, response); @@ -302,6 +305,7 @@ void Instance::HandleAddOrUpdateThreadNetwork(HandlerContext & ctx, const Comman void Instance::HandleRemoveNetwork(HandlerContext & ctx, const Commands::RemoveNetwork::DecodableType & req) { + MATTER_TRACE_EVENT_SCOPE("HandleRemoveNetwork", "NetworkCommissioning"); Commands::NetworkConfigResponse::Type response; response.networkingStatus = ToClusterObjectEnum(mpWirelessDriver->RemoveNetwork(req.networkID)); ctx.mCommandHandler.AddResponseData(ctx.mRequestPath, response); @@ -309,6 +313,7 @@ void Instance::HandleRemoveNetwork(HandlerContext & ctx, const Commands::RemoveN void Instance::HandleConnectNetwork(HandlerContext & ctx, const Commands::ConnectNetwork::DecodableType & req) { + MATTER_TRACE_EVENT_SCOPE("HandleConnectNetwork", "NetworkCommissioning"); if (req.networkID.size() > DeviceLayer::NetworkCommissioning::kMaxNetworkIDLen) { ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::InvalidValue); @@ -324,6 +329,7 @@ void Instance::HandleConnectNetwork(HandlerContext & ctx, const Commands::Connec void Instance::HandleReorderNetwork(HandlerContext & ctx, const Commands::ReorderNetwork::DecodableType & req) { + MATTER_TRACE_EVENT_SCOPE("HandleReorderNetwork", "NetworkCommissioning"); Commands::NetworkConfigResponse::Type response; response.networkingStatus = ToClusterObjectEnum(mpWirelessDriver->ReorderNetwork(req.networkID, req.networkIndex)); ctx.mCommandHandler.AddResponseData(ctx.mRequestPath, response); diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 9ef192c645c184..ed0e2a878fc9c2 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -49,6 +49,7 @@ #include #include #include +#include using namespace chip; using namespace ::chip::DeviceLayer; @@ -368,6 +369,7 @@ bool emberAfOperationalCredentialsClusterRemoveFabricCallback(app::CommandHandle const app::ConcreteCommandPath & commandPath, const Commands::RemoveFabric::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("RemoveFabric", "OperationalCredentials"); auto & fabricBeingRemoved = commandData.fabricIndex; emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: RemoveFabric"); // TODO: Generate emberAfFabricClusterPrintln @@ -425,6 +427,7 @@ bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(app::CommandH const app::ConcreteCommandPath & commandPath, const Commands::UpdateFabricLabel::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("UpdateFabricLabel", "OperationalCredentials"); auto & Label = commandData.label; auto ourFabricIndex = commandObj->GetAccessingFabricIndex(); @@ -521,6 +524,7 @@ bool emberAfOperationalCredentialsClusterAddNOCCallback(app::CommandHandler * co const app::ConcreteCommandPath & commandPath, const Commands::AddNOC::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("AddNOC", "OperationalCredentials"); auto & NOCValue = commandData.NOCValue; auto & ICACValue = commandData.ICACValue; auto & adminVendorId = commandData.adminVendorId; @@ -618,6 +622,7 @@ bool emberAfOperationalCredentialsClusterUpdateNOCCallback(app::CommandHandler * const app::ConcreteCommandPath & commandPath, const Commands::UpdateNOC::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("UpdateNOC", "OperationalCredentials"); auto & NOCValue = commandData.NOCValue; auto & ICACValue = commandData.ICACValue; @@ -683,6 +688,7 @@ bool emberAfOperationalCredentialsClusterCertificateChainRequestCallback( app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::CertificateChainRequest::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("CertificateChainRequest", "OperationalCredentials"); auto & certificateType = commandData.certificateType; CHIP_ERROR err = CHIP_NO_ERROR; @@ -730,6 +736,7 @@ bool emberAfOperationalCredentialsClusterAttestationRequestCallback(app::Command const app::ConcreteCommandPath & commandPath, const Commands::AttestationRequest::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("AttestationRequest", "OperationalCredentials"); auto & attestationNonce = commandData.attestationNonce; CHIP_ERROR err = CHIP_NO_ERROR; @@ -790,6 +797,7 @@ bool emberAfOperationalCredentialsClusterCSRRequestCallback(app::CommandHandler const app::ConcreteCommandPath & commandPath, const Commands::CSRRequest::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("CSRRequest", "OperationalCredentials"); emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: commissioner has requested a CSR"); CHIP_ERROR err = CHIP_NO_ERROR; @@ -879,6 +887,7 @@ bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::AddTrustedRootCertificate::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("AddTrustedRootCertificate", "OperationalCredentials"); auto & RootCertificate = commandData.rootCertificate; EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; @@ -917,6 +926,7 @@ bool emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::RemoveTrustedRootCertificate::DecodableType & commandData) { + MATTER_TRACE_EVENT_SCOPE("RemoveTrustedRootCertificate", "OperationalCredentials"); // TODO: Implement the logic for RemoveTrustedRootCertificate EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); diff --git a/src/controller/BUILD.gn b/src/controller/BUILD.gn index f9e1a31eee6e32..013f2101c457e1 100644 --- a/src/controller/BUILD.gn +++ b/src/controller/BUILD.gn @@ -68,6 +68,7 @@ static_library("controller") { "${chip_root}/src/platform", "${chip_root}/src/protocols", "${chip_root}/src/setup_payload", + "${chip_root}/src/trace", "${chip_root}/src/transport", ] diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index c7553ba8a668bd..2c4502f224e55d 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -73,6 +73,7 @@ #include #include #include +#include #if CONFIG_NETWORK_LAYER_BLE #include @@ -688,6 +689,7 @@ CHIP_ERROR DeviceCommissioner::Shutdown() CommissioneeDeviceProxy * DeviceCommissioner::FindCommissioneeDevice(const SessionHandle & session) { + MATTER_TRACE_EVENT_SCOPE("FindCommissioneeDevice", "DeviceCommissioner"); CommissioneeDeviceProxy * foundDevice = nullptr; mCommissioneeDevicePool.ForEachActiveObject([&](auto * deviceProxy) { if (deviceProxy->MatchesSession(session)) @@ -703,6 +705,7 @@ CommissioneeDeviceProxy * DeviceCommissioner::FindCommissioneeDevice(const Sessi CommissioneeDeviceProxy * DeviceCommissioner::FindCommissioneeDevice(NodeId id) { + MATTER_TRACE_EVENT_SCOPE("FindCommissioneeDevice", "DeviceCommissioner"); CommissioneeDeviceProxy * foundDevice = nullptr; mCommissioneeDevicePool.ForEachActiveObject([&](auto * deviceProxy) { if (deviceProxy->GetDeviceId() == id) @@ -740,17 +743,20 @@ CHIP_ERROR DeviceCommissioner::GetDeviceBeingCommissioned(NodeId deviceId, Commi CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, const char * setUpCode, const CommissioningParameters & params) { + MATTER_TRACE_EVENT_SCOPE("PairDevice", "DeviceCommissioner"); ReturnErrorOnFailure(mAutoCommissioner.SetCommissioningParameters(params)); return mSetUpCodePairer.PairDevice(remoteDeviceId, setUpCode, SetupCodePairerBehaviour::kCommission); } CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, const char * setUpCode) { + MATTER_TRACE_EVENT_SCOPE("PairDevice", "DeviceCommissioner"); return mSetUpCodePairer.PairDevice(remoteDeviceId, setUpCode, SetupCodePairerBehaviour::kCommission); } CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParameters & params) { + MATTER_TRACE_EVENT_SCOPE("PairDevice", "DeviceCommissioner"); ReturnErrorOnFailure(EstablishPASEConnection(remoteDeviceId, params)); return Commission(remoteDeviceId); } @@ -758,17 +764,20 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParam CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParameters & rendezvousParams, CommissioningParameters & commissioningParams) { + MATTER_TRACE_EVENT_SCOPE("PairDevice", "DeviceCommissioner"); ReturnErrorOnFailure(EstablishPASEConnection(remoteDeviceId, rendezvousParams)); return Commission(remoteDeviceId, commissioningParams); } CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, const char * setUpCode) { + MATTER_TRACE_EVENT_SCOPE("EstablishPASEConnection", "DeviceCommissioner"); return mSetUpCodePairer.PairDevice(remoteDeviceId, setUpCode, SetupCodePairerBehaviour::kPaseOnly); } CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, RendezvousParameters & params) { + MATTER_TRACE_EVENT_SCOPE("EstablishPASEConnection", "DeviceCommissioner"); CHIP_ERROR err = CHIP_NO_ERROR; CommissioneeDeviceProxy * device = nullptr; Transport::PeerAddress peerAddress = Transport::PeerAddress::UDP(Inet::IPAddress::Any); @@ -880,6 +889,7 @@ CHIP_ERROR DeviceCommissioner::Commission(NodeId remoteDeviceId, CommissioningPa CHIP_ERROR DeviceCommissioner::Commission(NodeId remoteDeviceId) { + MATTER_TRACE_EVENT_SCOPE("Commission", "DeviceCommissioner"); // TODO(cecille): Can we get rid of mDeviceBeingCommissioned and use the remote id instead? Would require storing the // commissioning stage in the device. CommissioneeDeviceProxy * device = mDeviceBeingCommissioned; @@ -1008,6 +1018,7 @@ void DeviceCommissioner::OnSessionEstablished() CHIP_ERROR DeviceCommissioner::SendCertificateChainRequestCommand(DeviceProxy * device, Credentials::CertificateType certificateType) { + MATTER_TRACE_EVENT_SCOPE("SendCertificateChainRequestCommand", "DeviceCommissioner"); ChipLogDetail(Controller, "Sending Certificate Chain request to %p device", device); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); @@ -1021,6 +1032,7 @@ CHIP_ERROR DeviceCommissioner::SendCertificateChainRequestCommand(DeviceProxy * void DeviceCommissioner::OnCertificateChainFailureResponse(void * context, CHIP_ERROR error) { + MATTER_TRACE_EVENT_SCOPE("OnCertificateChainFailureResponse", "DeviceCommissioner"); ChipLogProgress(Controller, "Device failed to receive the Certificate Chain request Response: %s", chip::ErrorStr(error)); DeviceCommissioner * commissioner = reinterpret_cast(context); commissioner->CommissioningStageComplete(error); @@ -1029,6 +1041,7 @@ void DeviceCommissioner::OnCertificateChainFailureResponse(void * context, CHIP_ void DeviceCommissioner::OnCertificateChainResponse( void * context, const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType & response) { + MATTER_TRACE_EVENT_SCOPE("OnCertificateChainResponse", "DeviceCommissioner"); ChipLogProgress(Controller, "Received certificate chain from the device"); DeviceCommissioner * commissioner = reinterpret_cast(context); @@ -1040,6 +1053,7 @@ void DeviceCommissioner::OnCertificateChainResponse( CHIP_ERROR DeviceCommissioner::SendAttestationRequestCommand(DeviceProxy * device, const ByteSpan & attestationNonce) { + MATTER_TRACE_EVENT_SCOPE("SendAttestationRequestCommand", "DeviceCommissioner"); ChipLogDetail(Controller, "Sending Attestation request to %p device", device); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); @@ -1054,6 +1068,7 @@ CHIP_ERROR DeviceCommissioner::SendAttestationRequestCommand(DeviceProxy * devic void DeviceCommissioner::OnAttestationFailureResponse(void * context, CHIP_ERROR error) { + MATTER_TRACE_EVENT_SCOPE("OnAttestationFailureResponse", "DeviceCommissioner"); ChipLogProgress(Controller, "Device failed to receive the Attestation Information Response: %s", chip::ErrorStr(error)); DeviceCommissioner * commissioner = reinterpret_cast(context); commissioner->CommissioningStageComplete(error); @@ -1062,6 +1077,7 @@ void DeviceCommissioner::OnAttestationFailureResponse(void * context, CHIP_ERROR void DeviceCommissioner::OnAttestationResponse(void * context, const OperationalCredentials::Commands::AttestationResponse::DecodableType & data) { + MATTER_TRACE_EVENT_SCOPE("OnAttestationResponse", "DeviceCommissioner"); ChipLogProgress(Controller, "Received Attestation Information from the device"); DeviceCommissioner * commissioner = reinterpret_cast(context); @@ -1072,6 +1088,7 @@ void DeviceCommissioner::OnAttestationResponse(void * context, void DeviceCommissioner::OnDeviceAttestationInformationVerification(void * context, AttestationVerificationResult result) { + MATTER_TRACE_EVENT_SCOPE("OnDeviceAttestationInformationVerification", "DeviceCommissioner"); DeviceCommissioner * commissioner = reinterpret_cast(context); if (result != AttestationVerificationResult::kSuccess) @@ -1103,6 +1120,7 @@ void DeviceCommissioner::OnDeviceAttestationInformationVerification(void * conte CHIP_ERROR DeviceCommissioner::ValidateAttestationInfo(const Credentials::DeviceAttestationVerifier::AttestationInfo & info) { + MATTER_TRACE_EVENT_SCOPE("ValidateAttestationInfo", "DeviceCommissioner"); VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE); DeviceAttestationVerifier * dac_verifier = GetDeviceAttestationVerifier(); @@ -1116,6 +1134,7 @@ CHIP_ERROR DeviceCommissioner::ValidateAttestationInfo(const Credentials::Device CHIP_ERROR DeviceCommissioner::SendOperationalCertificateSigningRequestCommand(DeviceProxy * device, const ByteSpan & csrNonce) { + MATTER_TRACE_EVENT_SCOPE("SendOperationalCertificateSigningRequestCommand", "DeviceCommissioner"); ChipLogDetail(Controller, "Sending CSR request to %p device", device); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); @@ -1130,6 +1149,7 @@ CHIP_ERROR DeviceCommissioner::SendOperationalCertificateSigningRequestCommand(D void DeviceCommissioner::OnCSRFailureResponse(void * context, CHIP_ERROR error) { + MATTER_TRACE_EVENT_SCOPE("OnCSRFailureResponse", "DeviceCommissioner"); ChipLogProgress(Controller, "Device failed to receive the CSR request Response: %s", chip::ErrorStr(error)); DeviceCommissioner * commissioner = static_cast(context); commissioner->CommissioningStageComplete(error); @@ -1138,6 +1158,7 @@ void DeviceCommissioner::OnCSRFailureResponse(void * context, CHIP_ERROR error) void DeviceCommissioner::OnOperationalCertificateSigningRequest( void * context, const OperationalCredentials::Commands::CSRResponse::DecodableType & data) { + MATTER_TRACE_EVENT_SCOPE("OnOperationalCertificateSigningRequest", "DeviceCommissioner"); ChipLogProgress(Controller, "Received certificate signing request from the device"); DeviceCommissioner * commissioner = static_cast(context); @@ -1150,6 +1171,7 @@ void DeviceCommissioner::OnDeviceNOCChainGeneration(void * context, CHIP_ERROR s const ByteSpan & rcac, Optional ipk, Optional adminSubject) { + MATTER_TRACE_EVENT_SCOPE("OnDeviceNOCChainGeneration", "DeviceCommissioner"); DeviceCommissioner * commissioner = static_cast(context); // TODO(#13825): If not passed by the signer, the commissioner should @@ -1177,6 +1199,7 @@ void DeviceCommissioner::OnDeviceNOCChainGeneration(void * context, CHIP_ERROR s CHIP_ERROR DeviceCommissioner::ProcessCSR(DeviceProxy * proxy, const ByteSpan & NOCSRElements, const ByteSpan & AttestationSignature, ByteSpan dac, ByteSpan csrNonce) { + MATTER_TRACE_EVENT_SCOPE("ProcessOpCSR", "DeviceCommissioner"); VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE); ChipLogProgress(Controller, "Getting certificate chain for the device from the issuer"); @@ -1209,6 +1232,7 @@ CHIP_ERROR DeviceCommissioner::SendOperationalCertificate(DeviceProxy * device, const ByteSpan & icaCertBuf, const AesCcm128KeySpan ipk, const NodeId adminSubject) { + MATTER_TRACE_EVENT_SCOPE("SendOperationalCertificate", "DeviceCommissioner"); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); OperationalCredentials::Commands::AddNOC::Type request; @@ -1256,6 +1280,7 @@ CHIP_ERROR DeviceCommissioner::ConvertFromOperationalCertStatus(OperationalCrede void DeviceCommissioner::OnAddNOCFailureResponse(void * context, CHIP_ERROR error) { + MATTER_TRACE_EVENT_SCOPE("OnAddNOCFailureResponse", "DeviceCommissioner"); ChipLogProgress(Controller, "Device failed to receive the operational certificate Response: %s", chip::ErrorStr(error)); DeviceCommissioner * commissioner = static_cast(context); commissioner->CommissioningStageComplete(error); @@ -1264,6 +1289,7 @@ void DeviceCommissioner::OnAddNOCFailureResponse(void * context, CHIP_ERROR erro void DeviceCommissioner::OnOperationalCertificateAddResponse( void * context, const OperationalCredentials::Commands::NOCResponse::DecodableType & data) { + MATTER_TRACE_EVENT_SCOPE("OnOperationalCertificateAddResponse", "DeviceCommissioner"); ChipLogProgress(Controller, "Device returned status %d on receiving the NOC", to_underlying(data.statusCode)); DeviceCommissioner * commissioner = static_cast(context); @@ -1291,6 +1317,7 @@ void DeviceCommissioner::OnOperationalCertificateAddResponse( CHIP_ERROR DeviceCommissioner::SendTrustedRootCertificate(DeviceProxy * device, const ByteSpan & rcac) { + MATTER_TRACE_EVENT_SCOPE("SendTrustedRootCertificate", "DeviceCommissioner"); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); ChipLogProgress(Controller, "Sending root certificate to the device"); @@ -1307,6 +1334,7 @@ CHIP_ERROR DeviceCommissioner::SendTrustedRootCertificate(DeviceProxy * device, void DeviceCommissioner::OnRootCertSuccessResponse(void * context, const chip::app::DataModel::NullObjectType &) { + MATTER_TRACE_EVENT_SCOPE("OnRootCertSuccessResponse", "DeviceCommissioner"); ChipLogProgress(Controller, "Device confirmed that it has received the root certificate"); DeviceCommissioner * commissioner = static_cast(context); commissioner->CommissioningStageComplete(CHIP_NO_ERROR); @@ -1314,6 +1342,7 @@ void DeviceCommissioner::OnRootCertSuccessResponse(void * context, const chip::a void DeviceCommissioner::OnRootCertFailureResponse(void * context, CHIP_ERROR error) { + MATTER_TRACE_EVENT_SCOPE("OnRootCertFailureResponse", "DeviceCommissioner"); ChipLogProgress(Controller, "Device failed to receive the root certificate Response: %s", chip::ErrorStr(error)); DeviceCommissioner * commissioner = static_cast(context); commissioner->CommissioningStageComplete(error); @@ -1321,6 +1350,7 @@ void DeviceCommissioner::OnRootCertFailureResponse(void * context, CHIP_ERROR er CHIP_ERROR DeviceCommissioner::OnOperationalCredentialsProvisioningCompletion(CommissioneeDeviceProxy * device) { + MATTER_TRACE_EVENT_SCOPE("OnOperationalCredentialsProvisioningCompletion", "DeviceCommissioner"); ChipLogProgress(Controller, "Operational credentials provisioned on device %p", device); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); @@ -1431,6 +1461,7 @@ void OnBasicFailure(void * context, CHIP_ERROR error) void DeviceCommissioner::CommissioningStageComplete(CHIP_ERROR err, CommissioningDelegate::CommissioningReport report) { + MATTER_TRACE_EVENT_SCOPE("CommissioningStageComplete", "DeviceCommissioner"); if (mCommissioningDelegate == nullptr) { return;