OSDN Git Service

Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGE
authorSteve Block <steveblock@google.com>
Wed, 12 Oct 2011 16:24:48 +0000 (17:24 +0100)
committerSteve Block <steveblock@google.com>
Tue, 25 Oct 2011 15:28:17 +0000 (16:28 +0100)
See https://android-git.corp.google.com/g/#/c/141576

Bug: 5449033
Change-Id: Ie3bc0d5436218ea05f98cb0373ecf5924f78db05

16 files changed:
libnativehelper/include/nativehelper/JNIHelp.h
vm/StdioConverter.cpp
vm/alloc/HeapInternal.h
vm/interp/Interp.cpp
vm/jdwp/JdwpHandler.cpp
vm/mterp/c/header.cpp
vm/mterp/out/InterpC-allstubs.cpp
vm/mterp/out/InterpC-armv5te-vfp.cpp
vm/mterp/out/InterpC-armv5te.cpp
vm/mterp/out/InterpC-armv7-a-neon.cpp
vm/mterp/out/InterpC-armv7-a.cpp
vm/mterp/out/InterpC-portable.cpp
vm/mterp/out/InterpC-x86-atom.cpp
vm/mterp/out/InterpC-x86.cpp
vm/native/dalvik_system_Zygote.cpp
vm/oo/Class.cpp

index aa98c2c..f5666f2 100644 (file)
@@ -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__)
index c2ddc79..ffb1d0e 100644 (file)
@@ -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;
     }
 
index a893bb2..6023380 100644 (file)
@@ -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
index 85d06db..8ab8d8a 100644 (file)
@@ -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);
         }
     }
index 02958e9..53eebbe 100644 (file)
@@ -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**" : "");
index c7e727e..c7bd4a0 100644 (file)
         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);
index 49a67bb..a7635af 100644 (file)
         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);
index 24fbfdc..f26b624 100644 (file)
         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);
index b750929..07f016b 100644 (file)
         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);
index 69bf469..8316a5c 100644 (file)
         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);
index 4ca2a1c..93184bb 100644 (file)
         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);
index d6a23c0..f67d6bc 100644 (file)
         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);
index 5648aff..9355869 100644 (file)
         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);
index 1623720..1d9380a 100644 (file)
         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);
index 31fecfd..7a8a5f8 100644 (file)
@@ -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));
     }
 }
index 85a3bbd..40da022 100644 (file)
@@ -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());
 
             /*