From b414a99d3996c36a4e89a7a2564de4ecc6ae9119 Mon Sep 17 00:00:00 2001 From: chenq Date: Fri, 18 Oct 2024 16:37:23 +0800 Subject: [PATCH] add cmdIndex Signed-off-by: chenq --- .../modules/render_service/core/pipeline/rs_main_thread.cpp | 6 +++--- .../include/command/rs_message_processor.h | 1 + .../src/command/rs_message_processor.cpp | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp b/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp index 403acded3a..0fbc741825 100644 --- a/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp +++ b/rosen/modules/render_service/core/pipeline/rs_main_thread.cpp @@ -3124,12 +3124,12 @@ void RSMainThread::SendCommands() auto& app = appIter->second; auto transactionPtr = transactionIter.second; if (transactionPtr != nullptr) { - dfxString += "[pid:" + std::to_string(pid) + ",cmdIndex:" + std::to_string(transactionPtr->GetIndex()) - + ",cmdCount:" + std::to_string(transactionPtr->GetCommandCount()) + "]"; + dfxString += "[pid:" + std::to_string(pid) + ",index:" + std::to_string(transactionPtr->GetIndex()) + + ",cnt:" + std::to_string(transactionPtr->GetCommandCount()) + "]"; } app->OnTransaction(transactionPtr); } - RS_LOGI("RSMainThread::SendCommand to %{public}s", dfxString.c_str()); + RS_LOGI("RS send to %{public}s", dfxString.c_str()); RS_TRACE_NAME_FMT("RSMainThread::SendCommand to %s", dfxString.c_str()); }); } diff --git a/rosen/modules/render_service_base/include/command/rs_message_processor.h b/rosen/modules/render_service_base/include/command/rs_message_processor.h index ff47769c6e..a3a0762d96 100644 --- a/rosen/modules/render_service_base/include/command/rs_message_processor.h +++ b/rosen/modules/render_service_base/include/command/rs_message_processor.h @@ -48,6 +48,7 @@ private: private: mutable std::mutex transactionMapMutex_; std::unordered_map> transactionMap_; + uint32_t transactionDataIndex_ = 0; }; } // namespace Rosen } // namespace OHOS diff --git a/rosen/modules/render_service_base/src/command/rs_message_processor.cpp b/rosen/modules/render_service_base/src/command/rs_message_processor.cpp index 5b6d89681e..593b389847 100644 --- a/rosen/modules/render_service_base/src/command/rs_message_processor.cpp +++ b/rosen/modules/render_service_base/src/command/rs_message_processor.cpp @@ -38,6 +38,8 @@ void RSMessageProcessor::AddUIMessage(uint32_t pid, std::unique_ptr& std::unique_lock lock(transactionMapMutex_); if (!transactionMap_.count(pid)) { std::shared_ptr transactionData = std::make_shared(); + transactionDataIndex_++; + transactionData->SetIndex(transactionDataIndex_); transactionMap_[pid] = transactionData; } transactionMap_[pid]->AddCommand(std::move(command), 0, FollowType::NONE); @@ -48,6 +50,8 @@ void RSMessageProcessor::AddUIMessage(uint32_t pid, std::unique_ptr&& std::unique_lock lock(transactionMapMutex_); if (!transactionMap_.count(pid)) { std::shared_ptr transactionData = std::make_shared(); + transactionDataIndex_++; + transactionData->SetIndex(transactionDataIndex_); transactionMap_[pid] = transactionData; } transactionMap_[pid]->AddCommand(std::move(command), 0, FollowType::NONE);