From 80844f7c91c43c3308d6710de4fa66f3a14adb27 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Sat, 12 Dec 2020 02:06:08 +0000 Subject: libbinder: Better oneway function logs. For manually written/some backends. At least the C++ backend doesn't pipe oneway errors into libbinder, so won't have the log there yet. Bug: 160191455 Test: binderLibTest Change-Id: I96c8b46044e5abc1a61812a998e5fabbb1859984 --- libs/binder/IPCThreadState.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'libs/binder/IPCThreadState.cpp') diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index d4c7acfdfd..7d01e0b1c3 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -1248,10 +1248,22 @@ status_t IPCThreadState::executeCommand(int32_t cmd) constexpr uint32_t kForwardReplyFlags = TF_CLEAR_BUF; sendReply(reply, (tr.flags & kForwardReplyFlags)); } else { - if (error != OK || reply.dataSize() != 0) { - alog << "oneway function results will be dropped but finished with status " - << statusToString(error) - << " and parcel size " << reply.dataSize() << endl; + if (error != OK) { + alog << "oneway function results for code " << tr.code + << " on binder at " + << reinterpret_cast(tr.target.ptr) + << " will be dropped but finished with status " + << statusToString(error); + + // ideally we could log this even when error == OK, but it + // causes too much logspam because some manually-written + // interfaces have clients that call methods which always + // write results, sometimes as oneway methods. + if (reply.dataSize() != 0) { + alog << " and reply parcel size " << reply.dataSize(); + } + + alog << endl; } LOG_ONEWAY("NOT sending reply to %d!", mCallingPid); } -- cgit v1.2.3-59-g8ed1b