summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-04-28 16:07:23 -0500
committerJP Abgrall2014-04-28 19:37:37 -0500
commit8daa9af02dc0e63ce220e3fa95bf5fe4d6b7a99a (patch)
treea9777346b5a82e54c698f895271a99e6364c1df6 /logd/LogReader.cpp
parentab3d49b03527d5fc65664f66ddb78c98450c8c84 (diff)
downloadplatform-system-core-8daa9af02dc0e63ce220e3fa95bf5fe4d6b7a99a.tar.gz
platform-system-core-8daa9af02dc0e63ce220e3fa95bf5fe4d6b7a99a.tar.xz
platform-system-core-8daa9af02dc0e63ce220e3fa95bf5fe4d6b7a99a.zip
logd: add thread setname
- permits easier determination of logd thread at fault in a stack trace from debuggerd. Bug: 14275676 Change-Id: Iac2c523147e2bcce34ab7ddcecd02582c5fa7cc0
Diffstat (limited to 'logd/LogReader.cpp')
-rw-r--r--logd/LogReader.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/logd/LogReader.cpp b/logd/LogReader.cpp
index 51aa2ad2b..8458c19e9 100644
--- a/logd/LogReader.cpp
+++ b/logd/LogReader.cpp
@@ -16,6 +16,7 @@
16 16
17#include <ctype.h> 17#include <ctype.h>
18#include <poll.h> 18#include <poll.h>
19#include <sys/prctl.h>
19#include <sys/socket.h> 20#include <sys/socket.h>
20 21
21#include <cutils/sockets.h> 22#include <cutils/sockets.h>
@@ -36,6 +37,8 @@ void LogReader::notifyNewLog() {
36} 37}
37 38
38bool LogReader::onDataAvailable(SocketClient *cli) { 39bool LogReader::onDataAvailable(SocketClient *cli) {
40 prctl(PR_SET_NAME, "logd.reader");
41
39 char buffer[255]; 42 char buffer[255];
40 43
41 int len = read(cli->getSocket(), buffer, sizeof(buffer) - 1); 44 int len = read(cli->getSocket(), buffer, sizeof(buffer) - 1);