From 9bfb4755f9ba3f47a8dc7e3f96cfffb8619aec65 Mon Sep 17 00:00:00 2001 From: fanxiaoyu Date: Fri, 24 Jun 2022 07:20:02 +0000 Subject: [PATCH] Description:add log for ipc object destory Feature or Bugfix:Feature Binary Source: No Signed-off-by: fanxiaoyu --- ipc/native/src/core/source/ipc_object_proxy.cpp | 7 ++++--- ipc/native/src/core/source/ipc_object_stub.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ipc/native/src/core/source/ipc_object_proxy.cpp b/ipc/native/src/core/source/ipc_object_proxy.cpp index f4f5fe5..ab403c9 100644 --- a/ipc/native/src/core/source/ipc_object_proxy.cpp +++ b/ipc/native/src/core/source/ipc_object_proxy.cpp @@ -37,12 +37,13 @@ using namespace IPC_SINGLE; static constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_ID_IPC, "IPCObjectProxy" }; IPCObjectProxy::IPCObjectProxy(int handle, std::u16string descriptor, int proto) : IRemoteObject(std::move(descriptor)), handle_(handle), proto_(proto), isFinishInit_(false), isRemoteDead_(false) -{} +{ + ZLOGW(LABEL, "create, desc: %{public}s", Str16ToStr8(descriptor).c_str()); +} IPCObjectProxy::~IPCObjectProxy() { - ZLOGW(LABEL, "handle: %{public}u, desc: %{public}s destroyed", - handle_, Str16ToStr8(descriptor_).c_str()); + ZLOGW(LABEL, "destroy, desc: %{public}s", Str16ToStr8(descriptor_).c_str()); } int32_t IPCObjectProxy::GetObjectRefCount() diff --git a/ipc/native/src/core/source/ipc_object_stub.cpp b/ipc/native/src/core/source/ipc_object_stub.cpp index 3d67b9b..6f39f83 100644 --- a/ipc/native/src/core/source/ipc_object_stub.cpp +++ b/ipc/native/src/core/source/ipc_object_stub.cpp @@ -48,11 +48,14 @@ static const std::string SAMGR_PROCESS_NAME = "samgr"; static constexpr pid_t HIDUMPER_SERVICE_UID = 1212; static constexpr pid_t SHELL_UID = 2000; -IPCObjectStub::IPCObjectStub(std::u16string descriptor) : IRemoteObject(descriptor) {} +IPCObjectStub::IPCObjectStub(std::u16string descriptor) : IRemoteObject(descriptor) +{ + ZLOGW(LABEL, "create, desc: %{public}s", Str16ToStr8(descriptor).c_str()); +} IPCObjectStub::~IPCObjectStub() { - ZLOGW(LABEL, "IPCObjectStub destroyed, desc: %{public}s", Str16ToStr8(descriptor_).c_str()); + ZLOGW(LABEL, "destroy, desc: %{public}s", Str16ToStr8(descriptor_).c_str()); } bool IPCObjectStub::IsDeviceIdIllegal(const std::string &deviceID) -- GitLab