mirror of
https://gitee.com/openharmony/communication_ipc
synced 2024-11-26 17:41:17 +00:00
!1513 Log modification 合入5.0.1
Merge pull request !1513 from weimengxue/OpenHarmony-5.0.1-Release
This commit is contained in:
commit
978624a2fe
@ -80,7 +80,7 @@ void IPCThreadSkeleton::MakeTlsKey()
|
||||
ZLOGE(LOG_LABEL, "pthread_key_create fail, ret:%{public}d", ret);
|
||||
return;
|
||||
}
|
||||
ZLOGI(LOG_LABEL, "key:%{public}d", TLSKey_);
|
||||
ZLOGD(LOG_LABEL, "key:%{public}d", TLSKey_);
|
||||
}
|
||||
|
||||
void IPCThreadSkeleton::GetVaildInstance(IPCThreadSkeleton *&instance)
|
||||
|
@ -112,6 +112,7 @@ void *IPCWorkThread::ThreadHandler(void *args)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IRemoteInvoker *invoker = IPCThreadSkeleton::GetRemoteInvoker(param->proto);
|
||||
std::string basicName = MakeBasicThreadName(param->proto, param->index);
|
||||
std::string threadName = basicName + "_" + std::to_string(syscall(SYS_gettid));
|
||||
int32_t ret = prctl(PR_SET_NAME, threadName.c_str());
|
||||
@ -129,8 +130,8 @@ void *IPCWorkThread::ThreadHandler(void *args)
|
||||
if (current != nullptr) {
|
||||
current->OnThreadTerminated(basicName);
|
||||
}
|
||||
ZLOGW(LOG_LABEL, "exit, proto:%{public}d policy:%{public}d name:%{public}s",
|
||||
param->proto, param->policy, threadName.c_str());
|
||||
ZLOGI(LOG_LABEL, "exit, proto:%{public}d policy:%{public}d name:%{public}s invoker:%{public}u",
|
||||
param->proto, param->policy, threadName.c_str(), ProcessSkeleton::ConvertAddr(invoker));
|
||||
delete param;
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -558,7 +558,7 @@ bool MessageParcel::Append(MessageParcel &data)
|
||||
{
|
||||
size_t dataSize = data.GetDataSize();
|
||||
if (dataSize == 0) {
|
||||
ZLOGE(LOG_LABEL, "no data to append");
|
||||
ZLOGI(LOG_LABEL, "no data to append");
|
||||
return true;
|
||||
}
|
||||
uintptr_t dataPtr = data.GetData();
|
||||
|
@ -135,7 +135,7 @@ bool ProcessSkeleton::DetachObject(IRemoteObject *object, const std::u16string &
|
||||
}
|
||||
|
||||
if (iterator->second.GetRefPtr() != object) {
|
||||
ZLOGD(LOG_LABEL, "can not erase it because addr if different, "
|
||||
ZLOGI(LOG_LABEL, "can not erase it because addr if different, "
|
||||
"desc:%{public}s, recorded object:%{public}u, detach object:%{public}u",
|
||||
ConvertToSecureDesc(Str16ToStr8(descriptor)).c_str(), ConvertAddr(iterator->second.GetRefPtr()),
|
||||
ConvertAddr(object));
|
||||
@ -172,13 +172,8 @@ bool ProcessSkeleton::AttachObject(IRemoteObject *object, const std::u16string &
|
||||
}
|
||||
}
|
||||
auto result = objects_.insert_or_assign(descriptor, wp);
|
||||
if (result.second) {
|
||||
ZLOGD(LOG_LABEL, "attach %{public}d desc:%{public}s inserted",
|
||||
ConvertAddr(object), ConvertToSecureDesc(Str16ToStr8(descriptor)).c_str());
|
||||
} else {
|
||||
ZLOGW(LOG_LABEL, "attach %{public}d desc:%{public}s assign",
|
||||
ConvertAddr(object), ConvertToSecureDesc(Str16ToStr8(descriptor)).c_str());
|
||||
}
|
||||
ZLOGD(LOG_LABEL, "attach %{public}u desc:%{public}s type:%{public}s",
|
||||
ConvertAddr(object), ConvertToSecureDesc(Str16ToStr8(descriptor)).c_str(), result.second ? "insert" : "assign");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -211,12 +206,12 @@ sptr<IRemoteObject> ProcessSkeleton::QueryObject(const std::u16string &descripto
|
||||
}
|
||||
std::u16string desc;
|
||||
if (!IsValidObject(remoteObject, desc)) {
|
||||
ZLOGD(LOG_LABEL, "object %{public}d is inValid", ConvertAddr(remoteObject));
|
||||
ZLOGD(LOG_LABEL, "object %{public}u is inValid", ConvertAddr(remoteObject));
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!remoteObject->AttemptIncStrong(this)) {
|
||||
ZLOGD(LOG_LABEL, "object %{public}d AttemptIncStrong failed", ConvertAddr(remoteObject));
|
||||
ZLOGD(LOG_LABEL, "object %{public}u AttemptIncStrong failed", ConvertAddr(remoteObject));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -90,12 +90,12 @@ BinderInvoker::BinderInvoker()
|
||||
reinterpret_cast<uintptr_t>(this) };
|
||||
input_.SetDataCapacity(IPC_DEFAULT_PARCEL_SIZE);
|
||||
binderConnector_ = BinderConnector::GetInstance();
|
||||
ZLOGI(LABEL, "created invoker %{public}u", ProcessSkeleton::ConvertAddr(this));
|
||||
ZLOGD(LABEL, ":%{public}u", ProcessSkeleton::ConvertAddr(this));
|
||||
}
|
||||
|
||||
BinderInvoker::~BinderInvoker()
|
||||
{
|
||||
ZLOGI(LABEL, "destroyed invoker %{public}u", ProcessSkeleton::ConvertAddr(this));
|
||||
ZLOGD(LABEL, ":%{public}u", ProcessSkeleton::ConvertAddr(this));
|
||||
auto current = ProcessSkeleton::GetInstance();
|
||||
if (current != nullptr) {
|
||||
current->DetachInvokerProcInfo(true);
|
||||
@ -1012,7 +1012,7 @@ int BinderInvoker::HandleCommands(uint32_t cmd)
|
||||
{
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
int error = HandleCommandsInner(cmd);
|
||||
if (error != ERR_NONE) {
|
||||
if (error != ERR_NONE && error != -ERR_TIMED_OUT) {
|
||||
if (ProcessSkeleton::IsPrint(error, lastErr_, lastErrCnt_)) {
|
||||
ZLOGE(LABEL, "HandleCommands cmd:%{public}u error:%{public}d", cmd, error);
|
||||
PrintParcelData(input_, "input_");
|
||||
|
@ -418,7 +418,6 @@ napi_value NAPI_RemoteProxy_checkRegisterDeathRecipientArgs(napi_env env, size_t
|
||||
|
||||
napi_value NAPI_RemoteProxy_registerDeathRecipient(napi_env env, napi_callback_info info)
|
||||
{
|
||||
ZLOGI(LOG_LABEL, "register death recipient");
|
||||
size_t argc = 2;
|
||||
napi_value argv[ARGV_LENGTH_2] = { 0 };
|
||||
napi_value thisVar = nullptr;
|
||||
@ -453,20 +452,19 @@ napi_value NAPI_RemoteProxy_registerDeathRecipient(napi_env env, napi_callback_i
|
||||
}
|
||||
|
||||
sptr<NAPIDeathRecipient> nativeRecipient = new NAPIDeathRecipient(env, argv[ARGV_INDEX_0]);
|
||||
if (target->AddDeathRecipient(nativeRecipient)) {
|
||||
bool ret = target->AddDeathRecipient(nativeRecipient);
|
||||
if (ret) {
|
||||
NAPIDeathRecipientList *list = proxyHolder->list_;
|
||||
if (list->Add(nativeRecipient)) {
|
||||
ZLOGD(LOG_LABEL, "register recipient success");
|
||||
}
|
||||
list->Add(nativeRecipient);
|
||||
}
|
||||
napi_value result = nullptr;
|
||||
napi_get_undefined(env, &result);
|
||||
ZLOGI(LOG_LABEL, "%{public}s", ret ? "succ" : "fail");
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value NAPI_RemoteProxy_removeDeathRecipient(napi_env env, napi_callback_info info)
|
||||
{
|
||||
ZLOGI(LOG_LABEL, "remove death recipient");
|
||||
size_t argc = 2;
|
||||
napi_value argv[ARGV_LENGTH_2] = { 0 };
|
||||
napi_value thisVar = nullptr;
|
||||
@ -507,14 +505,14 @@ napi_value NAPI_RemoteProxy_removeDeathRecipient(napi_env env, napi_callback_inf
|
||||
napi_get_boolean(env, false, &result);
|
||||
return result;
|
||||
}
|
||||
target->RemoveDeathRecipient(nativeRecipient);
|
||||
bool ret = target->RemoveDeathRecipient(nativeRecipient);
|
||||
if (list->Remove(nativeRecipient)) {
|
||||
napi_get_boolean(env, true, &result);
|
||||
return result;
|
||||
} else {
|
||||
napi_get_boolean(env, false, &result);
|
||||
return result;
|
||||
}
|
||||
ZLOGI(LOG_LABEL, "%{public}s", ret ? "succ" : "fail");
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value NAPI_RemoteProxy_checkUnregisterDeathRecipientArgs(napi_env env, size_t argc, napi_value* argv)
|
||||
@ -646,7 +644,7 @@ napi_value NAPI_RemoteProxy_getDescriptor(napi_env env, napi_callback_info info)
|
||||
|
||||
napi_value NAPI_RemoteProxy_isObjectDead(napi_env env, napi_callback_info info)
|
||||
{
|
||||
ZLOGI(LOG_LABEL, "call isObjectDead");
|
||||
ZLOGD(LOG_LABEL, "call isObjectDead");
|
||||
napi_value thisVar = nullptr;
|
||||
napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr);
|
||||
NAPIRemoteProxyHolder *holder = nullptr;
|
||||
|
@ -956,7 +956,7 @@ napi_value NAPIAshmem::Ashmem_JS_Constructor(napi_env env, napi_callback_info in
|
||||
napi_status status = napi_wrap(
|
||||
env, thisVar, napiAshmem,
|
||||
[](napi_env env, void *data, void *hint) {
|
||||
ZLOGI(LOG_LABEL, "Ashmem destructed by js callback");
|
||||
ZLOGD(LOG_LABEL, "Ashmem destructed by js callback");
|
||||
delete (reinterpret_cast<NAPIAshmem *>(data));
|
||||
},
|
||||
nullptr, nullptr);
|
||||
|
@ -37,7 +37,7 @@ void NAPIDeathRecipient::AfterWorkCallback(uv_work_t *work, int status)
|
||||
ZLOGE(LOG_LABEL, "work or work->data is nullptr");
|
||||
return;
|
||||
}
|
||||
ZLOGI(LOG_LABEL, "start to call onRemoteDied");
|
||||
ZLOGD(LOG_LABEL, "start to call onRemoteDied");
|
||||
OnRemoteDiedParam *param = reinterpret_cast<OnRemoteDiedParam *>(work->data);
|
||||
napi_handle_scope scope = nullptr;
|
||||
napi_open_handle_scope(param->env, &scope);
|
||||
|
Loading…
Reference in New Issue
Block a user