diff options
author | San Mehat <san@google.com> | 2010-03-25 09:31:42 -0700 |
---|---|---|
committer | San Mehat <san@google.com> | 2010-03-25 09:31:42 -0700 |
commit | 7e8529a8b528fd30586aa037f15a31b29582c537 (patch) | |
tree | 850922c096dc45230da1047dc3372df428f21965 | |
parent | c741f22d8533226ce60903649a7a57b3f05a65af (diff) | |
download | system_core-7e8529a8b528fd30586aa037f15a31b29582c537.zip system_core-7e8529a8b528fd30586aa037f15a31b29582c537.tar.gz system_core-7e8529a8b528fd30586aa037f15a31b29582c537.tar.bz2 |
system/core: Switch libsysutils & sched_policy LOG -> SLOG
Change-Id: Id74c6895a8012c5915f2e259339101844de7c085
Signed-off-by: San Mehat <san@google.com>
-rw-r--r-- | libcutils/sched_policy.c | 14 | ||||
-rw-r--r-- | libsysutils/src/FrameworkClient.cpp | 2 | ||||
-rw-r--r-- | libsysutils/src/FrameworkCommand.cpp | 2 | ||||
-rw-r--r-- | libsysutils/src/FrameworkListener.cpp | 6 | ||||
-rw-r--r-- | libsysutils/src/NetlinkEvent.cpp | 4 | ||||
-rw-r--r-- | libsysutils/src/NetlinkListener.cpp | 4 | ||||
-rw-r--r-- | libsysutils/src/ServiceManager.cpp | 16 | ||||
-rw-r--r-- | libsysutils/src/SocketClient.cpp | 4 | ||||
-rw-r--r-- | libsysutils/src/SocketListener.cpp | 22 |
9 files changed, 37 insertions, 37 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c index 2333762..3a18b0b 100644 --- a/libcutils/sched_policy.c +++ b/libcutils/sched_policy.c @@ -53,7 +53,7 @@ static int add_tid_to_cgroup(int tid, const char *grp_name) sprintf(path, "/dev/cpuctl/%s/tasks", grp_name); if ((fd = open(path, O_WRONLY)) < 0) { - LOGE("add_tid_to_cgroup failed to open '%s' (%s)\n", path, + SLOGE("add_tid_to_cgroup failed to open '%s' (%s)\n", path, strerror(errno)); return -1; } @@ -67,7 +67,7 @@ static int add_tid_to_cgroup(int tid, const char *grp_name) */ if (errno == ESRCH) return 0; - LOGW("add_tid_to_cgroup failed to write '%s' (%s)\n", path, + SLOGW("add_tid_to_cgroup failed to write '%s' (%s)\n", path, strerror(errno)); return -1; } @@ -146,11 +146,11 @@ static int getSchedulerGroup(int tid, char* buf, size_t bufLen) return 0; } - LOGE("Failed to find cpu subsys"); + SLOGE("Failed to find cpu subsys"); fclose(fp); return -1; out_bad_data: - LOGE("Bad cgroup data {%s}", lineBuf); + SLOGE("Bad cgroup data {%s}", lineBuf); fclose(fp); return -1; #else @@ -219,11 +219,11 @@ int set_sched_policy(int tid, SchedPolicy policy) strncpy(thread_name, p, (q-p)); } if (policy == SP_BACKGROUND) { - LOGD("vvv tid %d (%s)", tid, thread_name); + SLOGD("vvv tid %d (%s)", tid, thread_name); } else if (policy == SP_FOREGROUND) { - LOGD("^^^ tid %d (%s)", tid, thread_name); + SLOGD("^^^ tid %d (%s)", tid, thread_name); } else { - LOGD("??? tid %d (%s)", tid, thread_name); + SLOGD("??? tid %d (%s)", tid, thread_name); } #endif diff --git a/libsysutils/src/FrameworkClient.cpp b/libsysutils/src/FrameworkClient.cpp index 1686996..562dd67 100644 --- a/libsysutils/src/FrameworkClient.cpp +++ b/libsysutils/src/FrameworkClient.cpp @@ -21,7 +21,7 @@ int FrameworkClient::sendMsg(const char *msg) { pthread_mutex_lock(&mWriteMutex); if (write(mSocket, msg, strlen(msg) +1) < 0) { - LOGW("Unable to send msg '%s' (%s)", msg, strerror(errno)); + SLOGW("Unable to send msg '%s' (%s)", msg, strerror(errno)); } pthread_mutex_unlock(&mWriteMutex); return 0; diff --git a/libsysutils/src/FrameworkCommand.cpp b/libsysutils/src/FrameworkCommand.cpp index c52eac7..038d87e 100644 --- a/libsysutils/src/FrameworkCommand.cpp +++ b/libsysutils/src/FrameworkCommand.cpp @@ -26,7 +26,7 @@ FrameworkCommand::FrameworkCommand(const char *cmd) { } int FrameworkCommand::runCommand(SocketClient *c, int argc, char **argv) { - LOGW("Command %s has no run handler!", getCommand()); + SLOGW("Command %s has no run handler!", getCommand()); errno = ENOSYS; return -1; } diff --git a/libsysutils/src/FrameworkListener.cpp b/libsysutils/src/FrameworkListener.cpp index 4c74765..80f678d 100644 --- a/libsysutils/src/FrameworkListener.cpp +++ b/libsysutils/src/FrameworkListener.cpp @@ -34,7 +34,7 @@ bool FrameworkListener::onDataAvailable(SocketClient *c) { int len; if ((len = read(c->getSocket(), buffer, sizeof(buffer) -1)) < 0) { - LOGE("read() failed (%s)", strerror(errno)); + SLOGE("read() failed (%s)", strerror(errno)); return errno; } else if (!len) return false; @@ -114,7 +114,7 @@ void FrameworkListener::dispatchCommand(SocketClient *cli, char *data) { argv[argc++] = strdup(tmp); #if 0 for (k = 0; k < argc; k++) { - LOGD("arg[%d] = '%s'", k, argv[k]); + SLOGD("arg[%d] = '%s'", k, argv[k]); } #endif @@ -128,7 +128,7 @@ void FrameworkListener::dispatchCommand(SocketClient *cli, char *data) { if (!strcmp(argv[0], c->getCommand())) { if (c->runCommand(cli, argc, argv)) { - LOGW("Handler '%s' error (%s)", c->getCommand(), strerror(errno)); + SLOGW("Handler '%s' error (%s)", c->getCommand(), strerror(errno)); } goto out; } diff --git a/libsysutils/src/NetlinkEvent.cpp b/libsysutils/src/NetlinkEvent.cpp index 1550d83..c2ba647 100644 --- a/libsysutils/src/NetlinkEvent.cpp +++ b/libsysutils/src/NetlinkEvent.cpp @@ -52,7 +52,7 @@ void NetlinkEvent::dump() { for (i = 0; i < NL_PARAMS_MAX; i++) { if (!mParams[i]) break; - LOGD("NL param '%s'\n", mParams[i]); + SLOGD("NL param '%s'\n", mParams[i]); } } @@ -102,6 +102,6 @@ const char *NetlinkEvent::findParam(const char *paramName) { return &mParams[i][strlen(paramName) + 1]; } - LOGE("NetlinkEvent::FindParam(): Parameter '%s' not found", paramName); + SLOGE("NetlinkEvent::FindParam(): Parameter '%s' not found", paramName); return NULL; } diff --git a/libsysutils/src/NetlinkListener.cpp b/libsysutils/src/NetlinkListener.cpp index 5586dcc..e2a354e 100644 --- a/libsysutils/src/NetlinkListener.cpp +++ b/libsysutils/src/NetlinkListener.cpp @@ -35,13 +35,13 @@ bool NetlinkListener::onDataAvailable(SocketClient *cli) int count; if ((count = recv(socket, mBuffer, sizeof(mBuffer), 0)) < 0) { - LOGE("recv failed (%s)", strerror(errno)); + SLOGE("recv failed (%s)", strerror(errno)); return false; } NetlinkEvent *evt = new NetlinkEvent(); if (!evt->decode(mBuffer, count)) { - LOGE("Error decoding NetlinkEvent"); + SLOGE("Error decoding NetlinkEvent"); goto out; } diff --git a/libsysutils/src/ServiceManager.cpp b/libsysutils/src/ServiceManager.cpp index 700ac91..60b161a 100644 --- a/libsysutils/src/ServiceManager.cpp +++ b/libsysutils/src/ServiceManager.cpp @@ -11,11 +11,11 @@ ServiceManager::ServiceManager() { int ServiceManager::start(const char *name) { if (isRunning(name)) { - LOGW("Service '%s' is already running", name); + SLOGW("Service '%s' is already running", name); return 0; } - LOGD("Starting service '%s'", name); + SLOGD("Starting service '%s'", name); property_set("ctl.start", name); int count = 200; @@ -25,21 +25,21 @@ int ServiceManager::start(const char *name) { break; } if (!count) { - LOGW("Timed out waiting for service '%s' to start", name); + SLOGW("Timed out waiting for service '%s' to start", name); errno = ETIMEDOUT; return -1; } - LOGD("Sucessfully started '%s'", name); + SLOGD("Sucessfully started '%s'", name); return 0; } int ServiceManager::stop(const char *name) { if (!isRunning(name)) { - LOGW("Service '%s' is already stopped", name); + SLOGW("Service '%s' is already stopped", name); return 0; } - LOGD("Stopping service '%s'", name); + SLOGD("Stopping service '%s'", name); property_set("ctl.stop", name); int count = 200; @@ -50,11 +50,11 @@ int ServiceManager::stop(const char *name) { } if (!count) { - LOGW("Timed out waiting for service '%s' to stop", name); + SLOGW("Timed out waiting for service '%s' to stop", name); errno = ETIMEDOUT; return -1; } - LOGD("Sucessfully stopped '%s'", name); + SLOGD("Sucessfully stopped '%s'", name); return 0; } diff --git a/libsysutils/src/SocketClient.cpp b/libsysutils/src/SocketClient.cpp index 857ed4d..e9ae23a 100644 --- a/libsysutils/src/SocketClient.cpp +++ b/libsysutils/src/SocketClient.cpp @@ -41,11 +41,11 @@ int SocketClient::sendMsg(const char *msg) { pthread_mutex_lock(&mWriteMutex); while(brtw) { if ((rc = write(mSocket,p, brtw)) < 0) { - LOGW("Unable to send msg '%s' (%s)", msg, strerror(errno)); + SLOGW("Unable to send msg '%s' (%s)", msg, strerror(errno)); pthread_mutex_unlock(&mWriteMutex); return -1; } else if (!rc) { - LOGW("0 length write :("); + SLOGW("0 length write :("); errno = EIO; pthread_mutex_unlock(&mWriteMutex); return -1; diff --git a/libsysutils/src/SocketListener.cpp b/libsysutils/src/SocketListener.cpp index 72e128d..7af221f 100644 --- a/libsysutils/src/SocketListener.cpp +++ b/libsysutils/src/SocketListener.cpp @@ -64,30 +64,30 @@ SocketListener::~SocketListener() { int SocketListener::startListener() { if (!mSocketName && mSock == -1) { - LOGE("Failed to start unbound listener"); + SLOGE("Failed to start unbound listener"); errno = EINVAL; return -1; } else if (mSocketName) { if ((mSock = android_get_control_socket(mSocketName)) < 0) { - LOGE("Obtaining file descriptor socket '%s' failed: %s", + SLOGE("Obtaining file descriptor socket '%s' failed: %s", mSocketName, strerror(errno)); return -1; } } if (mListen && listen(mSock, 4) < 0) { - LOGE("Unable to listen on socket (%s)", strerror(errno)); + SLOGE("Unable to listen on socket (%s)", strerror(errno)); return -1; } else if (!mListen) mClients->push_back(new SocketClient(mSock)); if (pipe(mCtrlPipe)) { - LOGE("pipe failed (%s)", strerror(errno)); + SLOGE("pipe failed (%s)", strerror(errno)); return -1; } if (pthread_create(&mThread, NULL, SocketListener::threadStart, this)) { - LOGE("pthread_create (%s)", strerror(errno)); + SLOGE("pthread_create (%s)", strerror(errno)); return -1; } @@ -98,13 +98,13 @@ int SocketListener::stopListener() { char c = 0; if (write(mCtrlPipe[1], &c, 1) != 1) { - LOGE("Error writing to control pipe (%s)", strerror(errno)); + SLOGE("Error writing to control pipe (%s)", strerror(errno)); return -1; } void *ret; if (pthread_join(mThread, &ret)) { - LOGE("Error joining to listener thread (%s)", strerror(errno)); + SLOGE("Error joining to listener thread (%s)", strerror(errno)); return -1; } close(mCtrlPipe[0]); @@ -161,7 +161,7 @@ void SocketListener::runListener() { pthread_mutex_unlock(&mClientsLock); if ((rc = select(max + 1, &read_fds, NULL, NULL, NULL)) < 0) { - LOGE("select failed (%s)", strerror(errno)); + SLOGE("select failed (%s)", strerror(errno)); sleep(1); continue; } else if (!rc) @@ -175,7 +175,7 @@ void SocketListener::runListener() { int c; if ((c = accept(mSock, &addr, &alen)) < 0) { - LOGE("accept failed (%s)", strerror(errno)); + SLOGE("accept failed (%s)", strerror(errno)); sleep(1); continue; } @@ -212,7 +212,7 @@ void SocketListener::sendBroadcast(int code, const char *msg, bool addErrno) { for (i = mClients->begin(); i != mClients->end(); ++i) { if ((*i)->sendMsg(code, msg, addErrno)) { - LOGW("Error sending broadcast (%s)", strerror(errno)); + SLOGW("Error sending broadcast (%s)", strerror(errno)); } } pthread_mutex_unlock(&mClientsLock); @@ -224,7 +224,7 @@ void SocketListener::sendBroadcast(const char *msg) { for (i = mClients->begin(); i != mClients->end(); ++i) { if ((*i)->sendMsg(msg)) { - LOGW("Error sending broadcast (%s)", strerror(errno)); + SLOGW("Error sending broadcast (%s)", strerror(errno)); } } pthread_mutex_unlock(&mClientsLock); |