From: Steve Block Date: Wed, 12 Oct 2011 16:24:48 +0000 (+0100) Subject: Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGE X-Git-Tag: android-x86-4.4-r1~440 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1663a6c12fdf4732d7ea0a0406af6085b3c408e4;p=android-x86%2Fdalvik.git Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGE See https://android-git.corp.google.com/g/#/c/141576 Bug: 5449033 Change-Id: Ie3bc0d5436218ea05f98cb0373ecf5924f78db05 --- diff --git a/libnativehelper/include/nativehelper/JNIHelp.h b/libnativehelper/include/nativehelper/JNIHelp.h index aa98c2c95..f5666f2a3 100644 --- a/libnativehelper/include/nativehelper/JNIHelp.h +++ b/libnativehelper/include/nativehelper/JNIHelp.h @@ -167,7 +167,7 @@ inline void jniLogException(JNIEnv* env, int priority, const char* tag, jthrowab * 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__) diff --git a/vm/StdioConverter.cpp b/vm/StdioConverter.cpp index c2ddc79de..ffb1d0ef7 100644 --- a/vm/StdioConverter.cpp +++ b/vm/StdioConverter.cpp @@ -232,7 +232,7 @@ static bool readAndLog(int fd, BufferedData* data, const char* tag) 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; } } @@ -242,7 +242,7 @@ static bool readAndLog(int fd, BufferedData* data, const char* tag) */ 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; } diff --git a/vm/alloc/HeapInternal.h b/vm/alloc/HeapInternal.h index a893bb259..60233809b 100644 --- a/vm/alloc/HeapInternal.h +++ b/vm/alloc/HeapInternal.h @@ -77,16 +77,16 @@ void dvmUnlockHeap(void); #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 diff --git a/vm/interp/Interp.cpp b/vm/interp/Interp.cpp index 85d06db13..8ab8d8acf 100644 --- a/vm/interp/Interp.cpp +++ b/vm/interp/Interp.cpp @@ -952,14 +952,14 @@ void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly) 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 = ""; @@ -976,7 +976,7 @@ void dvmDumpRegs(const Method* method, const u4* framePtr, bool inOnly) } } #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); } } diff --git a/vm/jdwp/JdwpHandler.cpp b/vm/jdwp/JdwpHandler.cpp index 02958e932..53eebbe4f 100644 --- a/vm/jdwp/JdwpHandler.cpp +++ b/vm/jdwp/JdwpHandler.cpp @@ -1950,7 +1950,7 @@ void dvmJdwpProcessRequest(JdwpState* state, const JdwpReqHeader* pHeader, 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**" : ""); diff --git a/vm/mterp/c/header.cpp b/vm/mterp/c/header.cpp index c7e727ebe..c7bd4a05b 100644 --- a/vm/mterp/c/header.cpp +++ b/vm/mterp/c/header.cpp @@ -121,10 +121,10 @@ 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); diff --git a/vm/mterp/out/InterpC-allstubs.cpp b/vm/mterp/out/InterpC-allstubs.cpp index 49a67bb6e..a7635af5b 100644 --- a/vm/mterp/out/InterpC-allstubs.cpp +++ b/vm/mterp/out/InterpC-allstubs.cpp @@ -128,10 +128,10 @@ 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); diff --git a/vm/mterp/out/InterpC-armv5te-vfp.cpp b/vm/mterp/out/InterpC-armv5te-vfp.cpp index 24fbfdc00..f26b62450 100644 --- a/vm/mterp/out/InterpC-armv5te-vfp.cpp +++ b/vm/mterp/out/InterpC-armv5te-vfp.cpp @@ -128,10 +128,10 @@ 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); diff --git a/vm/mterp/out/InterpC-armv5te.cpp b/vm/mterp/out/InterpC-armv5te.cpp index b750929bd..07f016b89 100644 --- a/vm/mterp/out/InterpC-armv5te.cpp +++ b/vm/mterp/out/InterpC-armv5te.cpp @@ -128,10 +128,10 @@ 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); diff --git a/vm/mterp/out/InterpC-armv7-a-neon.cpp b/vm/mterp/out/InterpC-armv7-a-neon.cpp index 69bf46960..8316a5caf 100644 --- a/vm/mterp/out/InterpC-armv7-a-neon.cpp +++ b/vm/mterp/out/InterpC-armv7-a-neon.cpp @@ -128,10 +128,10 @@ 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); diff --git a/vm/mterp/out/InterpC-armv7-a.cpp b/vm/mterp/out/InterpC-armv7-a.cpp index 4ca2a1c13..93184bb14 100644 --- a/vm/mterp/out/InterpC-armv7-a.cpp +++ b/vm/mterp/out/InterpC-armv7-a.cpp @@ -128,10 +128,10 @@ 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); diff --git a/vm/mterp/out/InterpC-portable.cpp b/vm/mterp/out/InterpC-portable.cpp index d6a23c0c5..f67d6bc5a 100644 --- a/vm/mterp/out/InterpC-portable.cpp +++ b/vm/mterp/out/InterpC-portable.cpp @@ -128,10 +128,10 @@ 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); diff --git a/vm/mterp/out/InterpC-x86-atom.cpp b/vm/mterp/out/InterpC-x86-atom.cpp index 5648affa5..935586930 100644 --- a/vm/mterp/out/InterpC-x86-atom.cpp +++ b/vm/mterp/out/InterpC-x86-atom.cpp @@ -128,10 +128,10 @@ 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); diff --git a/vm/mterp/out/InterpC-x86.cpp b/vm/mterp/out/InterpC-x86.cpp index 16237208a..1d9380a49 100644 --- a/vm/mterp/out/InterpC-x86.cpp +++ b/vm/mterp/out/InterpC-x86.cpp @@ -128,10 +128,10 @@ 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); diff --git a/vm/native/dalvik_system_Zygote.cpp b/vm/native/dalvik_system_Zygote.cpp index 31fecfd2d..7a8a5f833 100644 --- a/vm/native/dalvik_system_Zygote.cpp +++ b/vm/native/dalvik_system_Zygote.cpp @@ -53,38 +53,38 @@ static void sigchldHandler(int s) 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 */ @@ -96,7 +96,7 @@ static void sigchldHandler(int s) * 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); @@ -104,7 +104,7 @@ static void sigchldHandler(int s) } if (pid < 0) { - LOG(LOG_WARN, ZYGOTE_LOG_TAG, + ALOG(LOG_WARN, ZYGOTE_LOG_TAG, "Zygote SIGCHLD error in waitpid: %s",strerror(errno)); } } diff --git a/vm/oo/Class.cpp b/vm/oo/Class.cpp index 85a3bbd15..40da022da 100644 --- a/vm/oo/Class.cpp +++ b/vm/oo/Class.cpp @@ -205,7 +205,7 @@ static void logClassLoadWithTime(char type, ClassObject* clazz, u8 time) { 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); } @@ -1604,7 +1604,7 @@ static ClassObject* findClassNoInit(const char* descriptor, Object* loader, 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()); /*