* from the JNI environment, if any.
*/
#define LOG_EX(env, priority, tag, ...) \
- IF_LOG(priority, tag) jniLogException(env, ANDROID_##priority, tag, ##__VA_ARGS__)
+ IF_ALOG(priority, tag) jniLogException(env, ANDROID_##priority, tag, ##__VA_ARGS__)
#define LOGV_EX(env, ...) LOG_EX(env, LOG_VERBOSE, LOG_TAG, ##__VA_ARGS__)
#define LOGD_EX(env, ...) LOG_EX(env, LOG_DEBUG, LOG_TAG, ##__VA_ARGS__)
#define LOGI_EX(env, ...) LOG_EX(env, LOG_INFO, LOG_TAG, ##__VA_ARGS__)
if (*cp == '\n' || (*cp == '\r' && i != 0 && *(cp+1) != '\n')) {
*cp = '\0';
//LOGW("GOT %d at %d '%s'", cp - start, start - data->buf, start);
- LOG(LOG_INFO, tag, "%s", start);
+ ALOG(LOG_INFO, tag, "%s", start);
start = cp+1;
}
}
*/
if (start == data->buf && data->count == kMaxLine) {
data->buf[kMaxLine] = '\0';
- LOG(LOG_INFO, tag, "%s!", start);
+ ALOG(LOG_INFO, tag, "%s!", start);
start = cp + kMaxLine;
}
#define LOGV_HEAP(...) ((void)0)
#define LOGD_HEAP(...) ((void)0)
#else
-#define LOGV_HEAP(...) LOG(LOG_VERBOSE, HEAP_LOG_TAG, __VA_ARGS__)
-#define LOGD_HEAP(...) LOG(LOG_DEBUG, HEAP_LOG_TAG, __VA_ARGS__)
+#define LOGV_HEAP(...) ALOG(LOG_VERBOSE, HEAP_LOG_TAG, __VA_ARGS__)
+#define LOGD_HEAP(...) ALOG(LOG_DEBUG, HEAP_LOG_TAG, __VA_ARGS__)
#endif
#define LOGI_HEAP(...) \
do { \
- if (!gDvm.zygote) { LOG(LOG_INFO, HEAP_LOG_TAG, __VA_ARGS__); } \
+ if (!gDvm.zygote) { ALOG(LOG_INFO, HEAP_LOG_TAG, __VA_ARGS__); } \
} while (0)
-#define LOGW_HEAP(...) LOG(LOG_WARN, HEAP_LOG_TAG, __VA_ARGS__)
-#define LOGE_HEAP(...) LOG(LOG_ERROR, HEAP_LOG_TAG, __VA_ARGS__)
+#define LOGW_HEAP(...) ALOG(LOG_WARN, HEAP_LOG_TAG, __VA_ARGS__)
+#define LOGE_HEAP(...) ALOG(LOG_ERROR, HEAP_LOG_TAG, __VA_ARGS__)
#define FRACTIONAL_MB(n) (n) / (1024 * 1024), \
((((n) % (1024 * 1024)) / 1024) * 1000) / 1024
localCount = method->registersSize - method->insSize;
- LOG(LOG_VERBOSE, LOG_TAG"i", "Registers (fp=%p):", framePtr);
+ ALOG(LOG_VERBOSE, LOG_TAG"i", "Registers (fp=%p):", framePtr);
for (i = method->registersSize-1; i >= 0; i--) {
if (i >= localCount) {
- LOG(LOG_VERBOSE, LOG_TAG"i", " v%-2d in%-2d : 0x%08x",
+ ALOG(LOG_VERBOSE, LOG_TAG"i", " v%-2d in%-2d : 0x%08x",
i, i-localCount, framePtr[i]);
} else {
if (inOnly) {
- LOG(LOG_VERBOSE, LOG_TAG"i", " [...]");
+ ALOG(LOG_VERBOSE, LOG_TAG"i", " [...]");
break;
}
const char* name = "";
}
}
#endif
- LOG(LOG_VERBOSE, LOG_TAG"i", " v%-2d : 0x%08x %s",
+ ALOG(LOG_VERBOSE, LOG_TAG"i", " v%-2d : 0x%08x %s",
i, framePtr[i], name);
}
}
set4BE(replyBuf + 0, kJDWPHeaderLen);
respLen = expandBufGetLength(pReply) - kJDWPHeaderLen;
- IF_LOG(LOG_VERBOSE, LOG_TAG) {
+ IF_ALOG(LOG_VERBOSE, LOG_TAG) {
LOGV("reply: dataLen=%d err=%s(%d)%s", respLen,
dvmJdwpErrorStr(result), result,
result != ERR_NONE ? " **FAILED**" : "");
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
char debugStrBuf[128]; \
snprintf(debugStrBuf, sizeof(debugStrBuf), __VA_ARGS__); \
if (curMethod != NULL) \
- LOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|%04x%s", \
self->threadId, (int)(pc - curMethod->insns), debugStrBuf); \
else \
- LOG(_level, LOG_TAG"i", "%-2d|####%s", \
+ ALOG(_level, LOG_TAG"i", "%-2d|####%s", \
self->threadId, debugStrBuf); \
} while(false)
void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly);
while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
/* Log process-death status that we care about. In general it is not
- safe to call LOG(...) from a signal handler because of possible
+ safe to call ALOG(...) from a signal handler because of possible
reentrancy. However, we know a priori that the current implementation
- of LOG() is safe to call from a SIGCHLD handler in the zygote process.
- If the LOG() implementation changes its locking strategy or its use
+ of ALOG() is safe to call from a SIGCHLD handler in the zygote process.
+ If the ALOG() implementation changes its locking strategy or its use
of syscalls within the lazy-init critical section, its use here may
become unsafe. */
if (WIFEXITED(status)) {
if (WEXITSTATUS(status)) {
- LOG(LOG_DEBUG, ZYGOTE_LOG_TAG, "Process %d exited cleanly (%d)",
+ ALOG(LOG_DEBUG, ZYGOTE_LOG_TAG, "Process %d exited cleanly (%d)",
(int) pid, WEXITSTATUS(status));
} else {
IF_LOGV(/*should use ZYGOTE_LOG_TAG*/) {
- LOG(LOG_VERBOSE, ZYGOTE_LOG_TAG,
+ ALOG(LOG_VERBOSE, ZYGOTE_LOG_TAG,
"Process %d exited cleanly (%d)",
(int) pid, WEXITSTATUS(status));
}
}
} else if (WIFSIGNALED(status)) {
if (WTERMSIG(status) != SIGKILL) {
- LOG(LOG_DEBUG, ZYGOTE_LOG_TAG,
+ ALOG(LOG_DEBUG, ZYGOTE_LOG_TAG,
"Process %d terminated by signal (%d)",
(int) pid, WTERMSIG(status));
} else {
IF_LOGV(/*should use ZYGOTE_LOG_TAG*/) {
- LOG(LOG_VERBOSE, ZYGOTE_LOG_TAG,
+ ALOG(LOG_VERBOSE, ZYGOTE_LOG_TAG,
"Process %d terminated by signal (%d)",
(int) pid, WTERMSIG(status));
}
}
#ifdef WCOREDUMP
if (WCOREDUMP(status)) {
- LOG(LOG_INFO, ZYGOTE_LOG_TAG, "Process %d dumped core",
+ ALOG(LOG_INFO, ZYGOTE_LOG_TAG, "Process %d dumped core",
(int) pid);
}
#endif /* ifdef WCOREDUMP */
* from there.
*/
if (pid == gDvm.systemServerPid) {
- LOG(LOG_INFO, ZYGOTE_LOG_TAG,
+ ALOG(LOG_INFO, ZYGOTE_LOG_TAG,
"Exit zygote because system server (%d) has terminated",
(int) pid);
kill(getpid(), SIGKILL);
}
if (pid < 0) {
- LOG(LOG_WARN, ZYGOTE_LOG_TAG,
+ ALOG(LOG_WARN, ZYGOTE_LOG_TAG,
"Zygote SIGCHLD error in waitpid: %s",strerror(errno));
}
}
pid_t pid = getpid();
unsigned int tid = (unsigned int) pthread_self();
- LOG(LOG_INFO, "PRELOAD", "%c%d:%d:%d:%s:%d:%s:%lld", type, ppid, pid, tid,
+ ALOG(LOG_INFO, "PRELOAD", "%c%d:%d:%d:%s:%d:%s:%lld", type, ppid, pid, tid,
get_process_name(), (int) clazz->classLoader, clazz->descriptor,
time);
}
dvmUnlockObject(self, (Object*) clazz);
#if LOG_CLASS_LOADING
- LOG(LOG_INFO, "DVMLINK FAILED FOR CLASS ", "%s in %s",
+ ALOG(LOG_INFO, "DVMLINK FAILED FOR CLASS ", "%s in %s",
clazz->descriptor, get_process_name());
/*