diff --git a/frameworks/liteipc_linux/src/liteipc_adapter.c b/frameworks/liteipc_linux/src/liteipc_adapter.c index 3141362381e375d9007fefa8ddf2fb15556e8cea..e359a9974e58d41cad31380524f739621b7e5cc6 100644 --- a/frameworks/liteipc_linux/src/liteipc_adapter.c +++ b/frameworks/liteipc_linux/src/liteipc_adapter.c @@ -416,7 +416,8 @@ static void HandleTransaction(const IpcContext *context, const struct binder_tra { IpcMsg *data = (IpcMsg*)calloc(1, sizeof(IpcMsg)); if (data == NULL) { - LOG(ERROR, "HandleTransaction calloc failed!"); + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld data is null error\n", __FILE__, __func__, getpid(), (long int)syscall(224), txn->code); + // LOG(ERROR, "HandleTransaction calloc failed!"); return; } data->type = MT_REQUEST; @@ -426,9 +427,12 @@ static void HandleTransaction(const IpcContext *context, const struct binder_tra uint32_t token = IpcIoPopUint32(&io); SvcIdentity *remote = IpcIoPopSvc(&io); if (remote == NULL) { - LOG(ERROR, "HandleTransaction remote NULL!"); + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step0 get remote error, code is %u\n", __FILE__, __func__, getpid(), (long int)syscall(224), txn->code); + // LOG(ERROR, "HandleTransaction remote NULL!"); return; } + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step1 enter, code is %u\n", __FILE__, __func__, getpid(), (long int)syscall(224), txn->code); + g_handle = remote->handle; data->data = io.bufferCur; data->offsets = io.offsetsCur; @@ -436,6 +440,7 @@ static void HandleTransaction(const IpcContext *context, const struct binder_tra data->spObjNum = io.offsetsLeft; if (IsValidCB(data)) { TryCallBack(context, data, &io, NULL); + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step0 enter callback, code is %u\n", __FILE__, __func__, getpid(), (long int)syscall(224), txn->code); free(remote); return; } @@ -449,6 +454,7 @@ static void HandleTransaction(const IpcContext *context, const struct binder_tra } else { LOG(ERROR, "BR_TRANSACTION should not happen!"); } + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step2 out of handletransaction, code is %u\n", __FILE__, __func__, getpid(), (long int)syscall(224), txn->code); free(remote); } @@ -740,29 +746,34 @@ int32_t SendRequest(const IpcContext *context, SvcIdentity sid, uint32_t code, { const IpcContext *tmpContext = GetIpcContext(context, sid.ipcContext); if (tmpContext == NULL) { - LOG(ERROR, "Invalid parameter, null pointer."); + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step0 enter\n", __FILE__, __func__, getpid(), (long int)syscall(224)); + // LOG(ERROR, "Invalid parameter, null pointer."); return LITEIPC_EINVAL; } if ((flag > LITEIPC_FLAG_ONEWAY) || ((flag == LITEIPC_FLAG_DEFAULT) && (buffer == NULL))) { - LOG(ERROR, "Invalid parameter, null pointer."); + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step0 flag abnormal\n", __FILE__, __func__, getpid(), (long int)syscall(224)); + // LOG(ERROR, "Invalid parameter, null pointer."); return LITEIPC_EINVAL; } if (sid.handle == MIN_BINDER_HANDLE) { + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step1 handle %u\n", __FILE__, __func__, getpid(), (long int)syscall(224), sid.handle); return HandleInternelRequest(tmpContext, sid, code, data, reply, flag); } int ret; if (!g_isStartLoop) { ret = StartCallbackDispatch(tmpContext); if (ret != LITEIPC_OK) { - LOG(ERROR, "StartCallbackDispatch failed."); + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step0 StartCallbackDispatch error\n", __FILE__, __func__, getpid(), (long int)syscall(224)); + // LOG(ERROR, "StartCallbackDispatch failed."); } } struct TransactData buf; struct binder_write_read bwr; ret = CheckIpcIo(data); if (ret != LITEIPC_OK) { - LOG(ERROR, "CheckIpcIo failed."); + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step0 CheckIpcIo error\n", __FILE__, __func__, getpid(), (long int)syscall(224)); + // LOG(ERROR, "CheckIpcIo failed."); return ret; } buf.cmd = BC_TRANSACTION; @@ -778,16 +789,18 @@ int32_t SendRequest(const IpcContext *context, SvcIdentity sid, uint32_t code, bwr.write_buffer = (uintptr_t)&buf; uint32_t readbuf[READ_BUFFER_SIZE] = {0}; if (flag != LITEIPC_FLAG_ONEWAY) { + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step4 handle %u\n", __FILE__, __func__, getpid(), (long int)syscall(224), sid.handle); while (1) { bwr.read_size = sizeof(readbuf); bwr.read_consumed = 0; bwr.read_buffer = (uintptr_t)readbuf; ioctl(tmpContext->fd, BINDER_WRITE_READ, &bwr); ret = BinderParse(tmpContext, reply, (uintptr_t)readbuf, bwr.read_consumed, NULL, buffer); - if (ret == 0) { + if (ret == 0 || ret == LITEIPC_DEAD_OBJECT) { break; } } + printf("HUAWEI_LOG: ipc file: %s, func: %s, pid %d, tgid %ld step5 handle %u\n", __FILE__, __func__, getpid(), (long int)syscall(224), sid.handle); } else { bwr.read_size = sizeof(readbuf); bwr.read_consumed = 0;