summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kiryanov <rkir@google.com>2024-03-19 13:28:45 -0700
committerRoman Kiryanov <rkir@google.com>2024-03-19 15:06:49 -0700
commit0b14de6a5913440f2dd08f23a6f8e3944163412e (patch)
treed74652afe6281d96035f459f988e9510918b5a88
parentbb6a7e43137a9095aa71640271da8584b9ef58f3 (diff)
downloadgoldfish-0b14de6a5913440f2dd08f23a6f8e3944163412e.tar.gz
Add more details to LOG_ALWAYS_FATAL
Bug: 330377365 Test: presubmit Change-Id: I1b5a7fa21feda428337801fb960a947347226eab Signed-off-by: Roman Kiryanov <rkir@google.com>
-rw-r--r--fingerprint/session.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/fingerprint/session.cpp b/fingerprint/session.cpp
index ba3f025d..3539ed2c 100644
--- a/fingerprint/session.cpp
+++ b/fingerprint/session.cpp
@@ -121,7 +121,7 @@ Session::Session(const int32_t sensorId, const int32_t userId,
mSensorListener = std::thread(&Session::sensorListenerFunc, this);
} else {
mSensorListener = std::thread([](){});
- LOG_ALWAYS_FATAL("%p:%s: Socketpair failed", this, __func__);
+ LOG_ALWAYS_FATAL("%p:%s:%d: Socketpair failed", this, __func__, __LINE__);
}
}
@@ -428,7 +428,8 @@ void Session::onSensorEventOn(const int32_t enrollmentId) {
break;
default:
- LOG_ALWAYS_FATAL("Unexpected result from `mStorage.authenticate`");
+ LOG_ALWAYS_FATAL("%p:%s:%d: Unexpected result from `mStorage.authenticate`",
+ this, __func__, __LINE__);
break;
}
}
@@ -443,7 +444,7 @@ void Session::onSensorEventOn(const int32_t enrollmentId) {
break;
default:
- LOG_ALWAYS_FATAL("Unexpected session state");
+ LOG_ALWAYS_FATAL("%p:%s:%d: Unexpected session state", this, __func__, __LINE__);
break;
}
}
@@ -488,8 +489,9 @@ void Session::cancellDetectInteraction() {
bool Session::sensorListenerFuncImpl() {
unique_fd sensorFd(qemud_channel_open(kSensorServiceName));
- LOG_ALWAYS_FATAL_IF(!sensorFd.ok(), "Could not open the sensor service: '%s'",
- kSensorServiceName);
+ LOG_ALWAYS_FATAL_IF(!sensorFd.ok(),
+ "%p:%s:%d: Could not open the sensor service: '%s'",
+ this, __func__, __LINE__, kSensorServiceName);
const unique_fd epollFd(epoll_create1(EPOLL_CLOEXEC));
epollCtlAdd(epollFd.get(), sensorFd.get());
@@ -552,8 +554,8 @@ bool Session::sensorListenerFuncImpl() {
}
} else if (fd == mSensorThreadFd.get()) {
if (ev_events & (EPOLLERR | EPOLLHUP)) {
- LOG_ALWAYS_FATAL("%p:%s: epoll_wait: threadsFd has an error, ev_events=%x",
- this, __func__, ev_events);
+ LOG_ALWAYS_FATAL("%p:%s:%d: epoll_wait: threadsFd has an error, ev_events=%x",
+ this, __func__, __LINE__, ev_events);
} else if (ev_events & EPOLLIN) {
char cmd;
int n = TEMP_FAILURE_RETRY(read(fd, &cmd, sizeof(cmd)));
@@ -563,13 +565,13 @@ bool Session::sensorListenerFuncImpl() {
return false; // quit
default:
- LOG_ALWAYS_FATAL("%p:%s: unexpected command, cmd=%c",
- this, __func__, cmd);
+ LOG_ALWAYS_FATAL("%p:%s:%d: unexpected command, cmd=%c",
+ this, __func__, __LINE__, cmd);
break;
}
} else {
- LOG_ALWAYS_FATAL("%p:%s: error readind from mThreadsFd, errno=%d",
- this, __func__, errno);
+ LOG_ALWAYS_FATAL("%p:%s:%d: error readind from mThreadsFd, errno=%d",
+ this, __func__, __LINE__, errno);
}
}
} else {