summaryrefslogtreecommitdiffstats
path: root/vm/analysis/DexPrepare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vm/analysis/DexPrepare.cpp')
-rw-r--r--vm/analysis/DexPrepare.cpp186
1 files changed, 93 insertions, 93 deletions
diff --git a/vm/analysis/DexPrepare.cpp b/vm/analysis/DexPrepare.cpp
index 4337ffad9..1a817f575 100644
--- a/vm/analysis/DexPrepare.cpp
+++ b/vm/analysis/DexPrepare.cpp
@@ -98,7 +98,7 @@ retry:
fd = open(cacheFileName, O_RDONLY, 0);
if (fd < 0) {
if (createIfMissing) {
- LOGE("Can't open dex cache '%s': %s\n",
+ LOGE("Can't open dex cache '%s': %s",
cacheFileName, strerror(errno));
}
return fd;
@@ -113,21 +113,21 @@ retry:
* working on it, we'll block here until they complete. Because
* we're waiting on an external resource, we go into VMWAIT mode.
*/
- LOGV("DexOpt: locking cache file %s (fd=%d, boot=%d)\n",
+ LOGV("DexOpt: locking cache file %s (fd=%d, boot=%d)",
cacheFileName, fd, isBootstrap);
ThreadStatus oldStatus = dvmChangeStatus(NULL, THREAD_VMWAIT);
cc = flock(fd, LOCK_EX | LOCK_NB);
if (cc != 0) {
- LOGD("DexOpt: sleeping on flock(%s)\n", cacheFileName);
+ LOGD("DexOpt: sleeping on flock(%s)", cacheFileName);
cc = flock(fd, LOCK_EX);
}
dvmChangeStatus(NULL, oldStatus);
if (cc != 0) {
- LOGE("Can't lock dex cache '%s': %d\n", cacheFileName, cc);
+ LOGE("Can't lock dex cache '%s': %d", cacheFileName, cc);
close(fd);
return -1;
}
- LOGV("DexOpt: locked cache file\n");
+ LOGV("DexOpt: locked cache file");
/*
* Check to see if the fd we opened and locked matches the file in
@@ -138,16 +138,16 @@ retry:
*/
cc = fstat(fd, &fdStat);
if (cc != 0) {
- LOGE("Can't stat open file '%s'\n", cacheFileName);
- LOGVV("DexOpt: unlocking cache file %s\n", cacheFileName);
+ LOGE("Can't stat open file '%s'", cacheFileName);
+ LOGVV("DexOpt: unlocking cache file %s", cacheFileName);
goto close_fail;
}
cc = stat(cacheFileName, &fileStat);
if (cc != 0 ||
fdStat.st_dev != fileStat.st_dev || fdStat.st_ino != fileStat.st_ino)
{
- LOGD("DexOpt: our open cache file is stale; sleeping and retrying\n");
- LOGVV("DexOpt: unlocking cache file %s\n", cacheFileName);
+ LOGD("DexOpt: our open cache file is stale; sleeping and retrying");
+ LOGVV("DexOpt: unlocking cache file %s", cacheFileName);
flock(fd, LOCK_UN);
close(fd);
usleep(250 * 1000); /* if something is hosed, don't peg machine */
@@ -163,14 +163,14 @@ retry:
*/
if (fdStat.st_size == 0) {
if (readOnly) {
- LOGW("DexOpt: file has zero length and isn't writable\n");
+ LOGW("DexOpt: file has zero length and isn't writable");
goto close_fail;
}
cc = dexOptCreateEmptyHeader(fd);
if (cc != 0)
goto close_fail;
*pNewFile = true;
- LOGV("DexOpt: successfully initialized new cache file\n");
+ LOGV("DexOpt: successfully initialized new cache file");
} else {
bool expectVerify, expectOpt;
@@ -191,7 +191,7 @@ retry:
expectOpt = true;
}
- LOGV("checking deps, expecting vfy=%d opt=%d\n",
+ LOGV("checking deps, expecting vfy=%d opt=%d",
expectVerify, expectOpt);
if (!dvmCheckOptHeaderAndDependencies(fd, true, modWhen, crc,
@@ -205,7 +205,7 @@ retry:
* give up now.
*/
if (createIfMissing) {
- LOGW("Cached DEX '%s' (%s) is stale and not writable\n",
+ LOGW("Cached DEX '%s' (%s) is stale and not writable",
fileName, cacheFileName);
}
goto close_fail;
@@ -232,24 +232,24 @@ retry:
* changes doing anything" purposes its best if we just make
* everything crash when a DEX they're using gets updated.
*/
- LOGD("ODEX file is stale or bad; removing and retrying (%s)\n",
+ LOGD("ODEX file is stale or bad; removing and retrying (%s)",
cacheFileName);
if (ftruncate(fd, 0) != 0) {
- LOGW("Warning: unable to truncate cache file '%s': %s\n",
+ LOGW("Warning: unable to truncate cache file '%s': %s",
cacheFileName, strerror(errno));
/* keep going */
}
if (unlink(cacheFileName) != 0) {
- LOGW("Warning: unable to remove cache file '%s': %d %s\n",
+ LOGW("Warning: unable to remove cache file '%s': %d %s",
cacheFileName, errno, strerror(errno));
/* keep going; permission failure should probably be fatal */
}
- LOGVV("DexOpt: unlocking cache file %s\n", cacheFileName);
+ LOGVV("DexOpt: unlocking cache file %s", cacheFileName);
flock(fd, LOCK_UN);
close(fd);
goto retry;
} else {
- LOGV("DexOpt: good deps in cache file\n");
+ LOGV("DexOpt: good deps in cache file");
}
}
@@ -269,7 +269,7 @@ close_fail:
*/
bool dvmUnlockCachedDexFile(int fd)
{
- LOGVV("DexOpt: unlocking cache file fd=%d\n", fd);
+ LOGVV("DexOpt: unlocking cache file fd=%d", fd);
return (flock(fd, LOCK_UN) == 0);
}
@@ -307,7 +307,7 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
else
lastPart = fileName;
- LOGD("DexOpt: --- BEGIN '%s' (bootstrap=%d) ---\n", lastPart, isBootstrap);
+ LOGD("DexOpt: --- BEGIN '%s' (bootstrap=%d) ---", lastPart, isBootstrap);
pid_t pid;
@@ -316,7 +316,7 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
* was all optimized, got rejected.
*/
if (gDvm.optimizing) {
- LOGW("Rejecting recursive optimization attempt on '%s'\n", fileName);
+ LOGW("Rejecting recursive optimization attempt on '%s'", fileName);
return false;
}
@@ -343,7 +343,7 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
/* full path to optimizer */
androidRoot = getenv("ANDROID_ROOT");
if (androidRoot == NULL) {
- LOGW("ANDROID_ROOT not set, defaulting to /system\n");
+ LOGW("ANDROID_ROOT not set, defaulting to /system");
androidRoot = "/system";
}
execFile = (char*)malloc(strlen(androidRoot) + strlen(kDexOptBin) + 1);
@@ -422,11 +422,11 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
else
execv(execFile, const_cast<char**>(argv));
- LOGE("execv '%s'%s failed: %s\n", execFile,
+ LOGE("execv '%s'%s failed: %s", execFile,
kUseValgrind ? " [valgrind]" : "", strerror(errno));
exit(1);
} else {
- LOGV("DexOpt: waiting for verify+opt, pid=%d\n", (int) pid);
+ LOGV("DexOpt: waiting for verify+opt, pid=%d", (int) pid);
int status;
pid_t gotPid;
@@ -438,23 +438,23 @@ bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLength,
while (true) {
gotPid = waitpid(pid, &status, 0);
if (gotPid == -1 && errno == EINTR) {
- LOGD("waitpid interrupted, retrying\n");
+ LOGD("waitpid interrupted, retrying");
} else {
break;
}
}
dvmChangeStatus(NULL, oldStatus);
if (gotPid != pid) {
- LOGE("waitpid failed: wanted %d, got %d: %s\n",
+ LOGE("waitpid failed: wanted %d, got %d: %s",
(int) pid, (int) gotPid, strerror(errno));
return false;
}
if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
- LOGD("DexOpt: --- END '%s' (success) ---\n", lastPart);
+ LOGD("DexOpt: --- END '%s' (success) ---", lastPart);
return true;
} else {
- LOGW("DexOpt: --- END '%s' --- status=0x%04x, process failed\n",
+ LOGW("DexOpt: --- END '%s' --- status=0x%04x, process failed",
lastPart, status);
return false;
}
@@ -482,17 +482,17 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
assert(gDvm.optimizing);
- LOGV("Continuing optimization (%s, isb=%d)\n", fileName, isBootstrap);
+ LOGV("Continuing optimization (%s, isb=%d)", fileName, isBootstrap);
assert(dexOffset >= 0);
/* quick test so we don't blow up on empty file */
if (dexLength < (int) sizeof(DexHeader)) {
- LOGE("too small to be DEX\n");
+ LOGE("too small to be DEX");
return false;
}
if (dexOffset < (int) sizeof(DexOptHeader)) {
- LOGE("not enough room for opt header\n");
+ LOGE("not enough room for opt header");
return false;
}
@@ -516,7 +516,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
mapAddr = mmap(NULL, dexOffset + dexLength, PROT_READ|PROT_WRITE,
MAP_SHARED, fd, 0);
if (mapAddr == MAP_FAILED) {
- LOGE("unable to mmap DEX cache: %s\n", strerror(errno));
+ LOGE("unable to mmap DEX cache: %s", strerror(errno));
goto bail;
}
@@ -557,7 +557,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
u1* dexAddr = ((u1*) mapAddr) + dexOffset;
if (dvmDexFileOpenPartial(dexAddr, dexLength, &pDvmDex) != 0) {
- LOGE("Unable to create DexFile\n");
+ LOGE("Unable to create DexFile");
success = false;
} else {
/*
@@ -568,7 +568,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
if (gDvm.generateRegisterMaps) {
pRegMapBuilder = dvmGenerateRegisterMaps(pDvmDex);
if (pRegMapBuilder == NULL) {
- LOGE("Failed generating register maps\n");
+ LOGE("Failed generating register maps");
success = false;
}
}
@@ -582,7 +582,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
/* unmap the read-write version, forcing writes to disk */
if (msync(mapAddr, dexOffset + dexLength, MS_SYNC) != 0) {
- LOGW("msync failed: %s\n", strerror(errno));
+ LOGW("msync failed: %s", strerror(errno));
// weird, but keep going
}
#if 1
@@ -593,7 +593,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
* Exclude this code when doing clean shutdown for valgrind.
*/
if (munmap(mapAddr, dexOffset + dexLength) != 0) {
- LOGE("munmap failed: %s\n", strerror(errno));
+ LOGE("munmap failed: %s", strerror(errno));
goto bail;
}
#endif
@@ -609,12 +609,12 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
depsOffset = lseek(fd, 0, SEEK_END);
if (depsOffset < 0) {
- LOGE("lseek to EOF failed: %s\n", strerror(errno));
+ LOGE("lseek to EOF failed: %s", strerror(errno));
goto bail;
}
adjOffset = (depsOffset + 7) & ~(0x07);
if (adjOffset != depsOffset) {
- LOGV("Adjusting deps start from %d to %d\n",
+ LOGV("Adjusting deps start from %d to %d",
(int) depsOffset, (int) adjOffset);
depsOffset = adjOffset;
lseek(fd, depsOffset, SEEK_SET);
@@ -624,7 +624,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
* Append the dependency list.
*/
if (writeDependencies(fd, modWhen, crc) != 0) {
- LOGW("Failed writing dependencies\n");
+ LOGW("Failed writing dependencies");
goto bail;
}
@@ -634,7 +634,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
adjOffset = (optOffset + 7) & ~(0x07);
if (adjOffset != optOffset) {
- LOGV("Adjusting opt start from %d to %d\n",
+ LOGV("Adjusting opt start from %d to %d",
(int) optOffset, (int) adjOffset);
optOffset = adjOffset;
lseek(fd, optOffset, SEEK_SET);
@@ -644,7 +644,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
* Append any optimized pre-computed data structures.
*/
if (!writeOptData(fd, pClassLookup, pRegMapBuilder)) {
- LOGW("Failed writing opt data\n");
+ LOGW("Failed writing opt data");
goto bail;
}
@@ -685,7 +685,7 @@ bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,
if (sysWriteFully(fd, &optHdr, sizeof(optHdr), "DexOpt opt header") != 0)
goto bail;
- LOGV("Successfully wrote DEX header\n");
+ LOGV("Successfully wrote DEX header");
result = true;
//dvmRegisterMapDumpStats();
@@ -759,7 +759,7 @@ static bool rewriteDex(u1* addr, int len, bool doVerify, bool doOpt,
* for it.
*/
if (dvmDexFileOpenPartial(addr, len, &pDvmDex) != 0) {
- LOGE("Unable to create DexFile\n");
+ LOGE("Unable to create DexFile");
goto bail;
}
@@ -820,7 +820,7 @@ static bool rewriteDex(u1* addr, int len, bool doVerify, bool doOpt,
msgStr = "verify";
else if (doOpt)
msgStr = "opt";
- LOGD("DexOpt: load %dms, %s %dms\n",
+ LOGD("DexOpt: load %dms, %s %dms",
(int) (loadWhen - prepWhen) / 1000,
msgStr,
(int) (verifyOptWhen - loadWhen) / 1000);
@@ -873,7 +873,7 @@ static bool loadAllClasses(DvmDex* pDvmDex)
u4 idx;
int loaded = 0;
- LOGV("DexOpt: +++ trying to load %d classes\n", count);
+ LOGV("DexOpt: +++ trying to load %d classes", count);
dvmSetBootPathExtraDex(pDvmDex);
@@ -900,7 +900,7 @@ static bool loadAllClasses(DvmDex* pDvmDex)
* list, but it costs very little to do it in all cases.)
*/
if (!dvmInitClass(gDvm.classJavaLangClass)) {
- LOGE("ERROR: failed to initialize the class Class!\n");
+ LOGE("ERROR: failed to initialize the class Class!");
return false;
}
@@ -918,7 +918,7 @@ static bool loadAllClasses(DvmDex* pDvmDex)
// NULL);
newClass = dvmFindSystemClassNoInit(classDescriptor);
if (newClass == NULL) {
- LOGV("DexOpt: failed loading '%s'\n", classDescriptor);
+ LOGV("DexOpt: failed loading '%s'", classDescriptor);
dvmClearOptException(dvmThreadSelf());
} else if (newClass->pDvmDex != pDvmDex) {
/*
@@ -926,14 +926,14 @@ static bool loadAllClasses(DvmDex* pDvmDex)
* with the "multiple def" flag so the resolver doesn't try
* to make it available.
*/
- LOGD("DexOpt: '%s' has an earlier definition; blocking out\n",
+ LOGD("DexOpt: '%s' has an earlier definition; blocking out",
classDescriptor);
SET_CLASS_FLAG(newClass, CLASS_MULTIPLE_DEFS);
} else {
loaded++;
}
}
- LOGV("DexOpt: +++ successfully loaded %d classes\n", loaded);
+ LOGV("DexOpt: +++ successfully loaded %d classes", loaded);
dvmSetBootPathExtraDex(NULL);
return true;
@@ -964,22 +964,22 @@ static void verifyAndOptimizeClasses(DexFile* pDexFile, bool doVerify,
} else {
// TODO: log when in verbose mode
- LOGV("DexOpt: not optimizing unavailable class '%s'\n",
+ LOGV("DexOpt: not optimizing unavailable class '%s'",
classDescriptor);
}
}
#ifdef VERIFIER_STATS
- LOGI("Verifier stats:\n");
- LOGI(" methods examined : %u\n", gDvm.verifierStats.methodsExamined);
- LOGI(" monitor-enter methods : %u\n", gDvm.verifierStats.monEnterMethods);
- LOGI(" instructions examined : %u\n", gDvm.verifierStats.instrsExamined);
- LOGI(" instructions re-examined: %u\n", gDvm.verifierStats.instrsReexamined);
- LOGI(" copying of register sets: %u\n", gDvm.verifierStats.copyRegCount);
- LOGI(" merging of register sets: %u\n", gDvm.verifierStats.mergeRegCount);
- LOGI(" ...that caused changes : %u\n", gDvm.verifierStats.mergeRegChanged);
- LOGI(" uninit searches : %u\n", gDvm.verifierStats.uninitSearches);
- LOGI(" max memory required : %u\n", gDvm.verifierStats.biggestAlloc);
+ LOGI("Verifier stats:");
+ LOGI(" methods examined : %u", gDvm.verifierStats.methodsExamined);
+ LOGI(" monitor-enter methods : %u", gDvm.verifierStats.monEnterMethods);
+ LOGI(" instructions examined : %u", gDvm.verifierStats.instrsExamined);
+ LOGI(" instructions re-examined: %u", gDvm.verifierStats.instrsReexamined);
+ LOGI(" copying of register sets: %u", gDvm.verifierStats.copyRegCount);
+ LOGI(" merging of register sets: %u", gDvm.verifierStats.mergeRegCount);
+ LOGI(" ...that caused changes : %u", gDvm.verifierStats.mergeRegChanged);
+ LOGI(" uninit searches : %u", gDvm.verifierStats.uninitSearches);
+ LOGI(" max memory required : %u", gDvm.verifierStats.biggestAlloc);
#endif
}
@@ -1000,7 +1000,7 @@ static void verifyAndOptimizeClass(DexFile* pDexFile, ClassObject* clazz,
* (a) not the one we want to examine, and (b) mapped read-only,
* so we will seg fault if we try to rewrite instructions inside it.
*/
- LOGD("DexOpt: not verifying/optimizing '%s': multiple definitions\n",
+ LOGD("DexOpt: not verifying/optimizing '%s': multiple definitions",
clazz->descriptor);
return;
}
@@ -1023,7 +1023,7 @@ static void verifyAndOptimizeClass(DexFile* pDexFile, ClassObject* clazz,
verified = true;
} else {
// TODO: log when in verbose mode
- LOGV("DexOpt: '%s' failed verification\n", classDescriptor);
+ LOGV("DexOpt: '%s' failed verification", classDescriptor);
}
}
@@ -1031,7 +1031,7 @@ static void verifyAndOptimizeClass(DexFile* pDexFile, ClassObject* clazz,
bool needVerify = (gDvm.dexOptMode == OPTIMIZE_MODE_VERIFIED ||
gDvm.dexOptMode == OPTIMIZE_MODE_FULL);
if (!verified && needVerify) {
- LOGV("DexOpt: not optimizing '%s': not verified\n",
+ LOGV("DexOpt: not optimizing '%s': not verified",
classDescriptor);
} else {
dvmOptimizeClass(clazz, false);
@@ -1054,7 +1054,7 @@ static const char* getCacheFileName(const ClassPathEntry* cpe)
case kCpeDex:
return dvmGetRawDexFileCacheFileName((RawDexFile*) cpe->ptr);
default:
- LOGE("DexOpt: unexpected cpe kind %d\n", cpe->kind);
+ LOGE("DexOpt: unexpected cpe kind %d", cpe->kind);
dvmAbort();
return NULL;
}
@@ -1075,7 +1075,7 @@ static const u1* getSignature(const ClassPathEntry* cpe)
pDvmDex = dvmGetRawDexFileDex((RawDexFile*) cpe->ptr);
break;
default:
- LOGE("unexpected cpe kind %d\n", cpe->kind);
+ LOGE("unexpected cpe kind %d", cpe->kind);
dvmAbort();
pDvmDex = NULL; // make gcc happy
}
@@ -1128,7 +1128,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
* the first thing in the file.
*/
if (lseek(fd, 0, SEEK_SET) != 0) {
- LOGE("DexOpt: failed to seek to start of file: %s\n", strerror(errno));
+ LOGE("DexOpt: failed to seek to start of file: %s", strerror(errno));
goto bail;
}
@@ -1138,10 +1138,10 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
*/
actual = read(fd, &optHdr, sizeof(optHdr));
if (actual < 0) {
- LOGE("DexOpt: failed reading opt header: %s\n", strerror(errno));
+ LOGE("DexOpt: failed reading opt header: %s", strerror(errno));
goto bail;
} else if (actual != sizeof(optHdr)) {
- LOGE("DexOpt: failed reading opt header (got %d of %zd)\n",
+ LOGE("DexOpt: failed reading opt header (got %d of %zd)",
(int) actual, sizeof(optHdr));
goto bail;
}
@@ -1149,21 +1149,21 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
magic = optHdr.magic;
if (memcmp(magic, DEX_MAGIC, 4) == 0) {
/* somebody probably pointed us at the wrong file */
- LOGD("DexOpt: expected optimized DEX, found unoptimized\n");
+ LOGD("DexOpt: expected optimized DEX, found unoptimized");
goto bail;
} else if (memcmp(magic, DEX_OPT_MAGIC, 4) != 0) {
/* not a DEX file, or previous attempt was interrupted */
- LOGD("DexOpt: incorrect opt magic number (0x%02x %02x %02x %02x)\n",
+ LOGD("DexOpt: incorrect opt magic number (0x%02x %02x %02x %02x)",
magic[0], magic[1], magic[2], magic[3]);
goto bail;
}
if (memcmp(magic+4, DEX_OPT_MAGIC_VERS, 4) != 0) {
- LOGW("DexOpt: stale opt version (0x%02x %02x %02x %02x)\n",
+ LOGW("DexOpt: stale opt version (0x%02x %02x %02x %02x)",
magic[4], magic[5], magic[6], magic[7]);
goto bail;
}
if (optHdr.depsLength < kMinDepSize || optHdr.depsLength > kMaxDepSize) {
- LOGW("DexOpt: weird deps length %d, bailing\n", optHdr.depsLength);
+ LOGW("DexOpt: weird deps length %d, bailing", optHdr.depsLength);
goto bail;
}
@@ -1179,7 +1179,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
expectedFlags |= DEX_OPT_FLAG_BIG;
#endif
if ((expectedFlags & matchMask) != (optHdr.flags & matchMask)) {
- LOGI("DexOpt: header flag mismatch (0x%02x vs 0x%02x, mask=0x%02x)\n",
+ LOGI("DexOpt: header flag mismatch (0x%02x vs 0x%02x, mask=0x%02x)",
expectedFlags, optHdr.flags, matchMask);
goto bail;
}
@@ -1187,7 +1187,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
posn = lseek(fd, optHdr.depsOffset, SEEK_SET);
if (posn < 0) {
- LOGW("DexOpt: seek to deps failed: %s\n", strerror(errno));
+ LOGW("DexOpt: seek to deps failed: %s", strerror(errno));
goto bail;
}
@@ -1196,16 +1196,16 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
*/
depData = (u1*) malloc(optHdr.depsLength);
if (depData == NULL) {
- LOGW("DexOpt: unable to allocate %d bytes for deps\n",
+ LOGW("DexOpt: unable to allocate %d bytes for deps",
optHdr.depsLength);
goto bail;
}
actual = read(fd, depData, optHdr.depsLength);
if (actual < 0) {
- LOGW("DexOpt: failed reading deps: %s\n", strerror(errno));
+ LOGW("DexOpt: failed reading deps: %s", strerror(errno));
goto bail;
} else if (actual != (ssize_t) optHdr.depsLength) {
- LOGW("DexOpt: failed reading deps: got %d of %d\n",
+ LOGW("DexOpt: failed reading deps: got %d of %d",
(int) actual, optHdr.depsLength);
goto bail;
}
@@ -1219,18 +1219,18 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
ptr = depData;
val = read4LE(&ptr);
if (sourceAvail && val != modWhen) {
- LOGI("DexOpt: source file mod time mismatch (%08x vs %08x)\n",
+ LOGI("DexOpt: source file mod time mismatch (%08x vs %08x)",
val, modWhen);
goto bail;
}
val = read4LE(&ptr);
if (sourceAvail && val != crc) {
- LOGI("DexOpt: source file CRC mismatch (%08x vs %08x)\n", val, crc);
+ LOGI("DexOpt: source file CRC mismatch (%08x vs %08x)", val, crc);
goto bail;
}
val = read4LE(&ptr);
if (val != DALVIK_VM_BUILD) {
- LOGD("DexOpt: VM build version mismatch (%d vs %d)\n",
+ LOGD("DexOpt: VM build version mismatch (%d vs %d)",
val, DALVIK_VM_BUILD);
goto bail;
}
@@ -1243,7 +1243,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
u4 numDeps;
numDeps = read4LE(&ptr);
- LOGV("+++ DexOpt: numDeps = %d\n", numDeps);
+ LOGV("+++ DexOpt: numDeps = %d", numDeps);
for (cpe = gDvm.bootClassPath; cpe->ptr != NULL; cpe++) {
const char* cacheFileName =
dvmPathToAbsolutePortion(getCacheFileName(cpe));
@@ -1255,7 +1255,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
if (numDeps == 0) {
/* more entries in bootclasspath than in deps list */
- LOGI("DexOpt: not all deps represented\n");
+ LOGI("DexOpt: not all deps represented");
goto bail;
}
@@ -1263,7 +1263,7 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
if (len != storedStrLen ||
strcmp(cacheFileName, (const char*) ptr) != 0)
{
- LOGI("DexOpt: mismatch dep name: '%s' vs. '%s'\n",
+ LOGI("DexOpt: mismatch dep name: '%s' vs. '%s'",
cacheFileName, ptr);
goto bail;
}
@@ -1271,25 +1271,25 @@ bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
ptr += storedStrLen;
if (memcmp(signature, ptr, kSHA1DigestLen) != 0) {
- LOGI("DexOpt: mismatch dep signature for '%s'\n", cacheFileName);
+ LOGI("DexOpt: mismatch dep signature for '%s'", cacheFileName);
goto bail;
}
ptr += kSHA1DigestLen;
- LOGV("DexOpt: dep match on '%s'\n", cacheFileName);
+ LOGV("DexOpt: dep match on '%s'", cacheFileName);
numDeps--;
}
if (numDeps != 0) {
/* more entries in deps list than in classpath */
- LOGI("DexOpt: Some deps went away\n");
+ LOGI("DexOpt: Some deps went away");
goto bail;
}
// consumed all data and no more?
if (ptr != depData + optHdr.depsLength) {
- LOGW("DexOpt: Spurious dep data? %d vs %d\n",
+ LOGW("DexOpt: Spurious dep data? %d vs %d",
(int) (ptr - depData), optHdr.depsLength);
assert(false);
}
@@ -1322,7 +1322,7 @@ static int writeDependencies(int fd, u4 modWhen, u4 crc)
dvmPathToAbsolutePortion(getCacheFileName(cpe));
assert(cacheFileName != NULL); /* guaranteed by Class.c */
- LOGV("+++ DexOpt: found dep '%s'\n", cacheFileName);
+ LOGV("+++ DexOpt: found dep '%s'", cacheFileName);
numDeps++;
bufLen += strlen(cacheFileName) +1;
@@ -1351,7 +1351,7 @@ static int writeDependencies(int fd, u4 modWhen, u4 crc)
int len = strlen(cacheFileName) +1;
if (ptr + 4 + len + kSHA1DigestLen > buf + bufLen) {
- LOGE("DexOpt: overran buffer\n");
+ LOGE("DexOpt: overran buffer");
dvmAbort();
}
@@ -1390,7 +1390,7 @@ static bool writeChunk(int fd, u4 type, const void* data, size_t size)
assert(sizeof(header) == 8);
- LOGV("Writing chunk, type=%.4s size=%d\n", (char*) &type, size);
+ LOGV("Writing chunk, type=%.4s size=%d", (char*) &type, size);
header.ts.type = type;
header.ts.size = (u4) size;
@@ -1408,7 +1408,7 @@ static bool writeChunk(int fd, u4 type, const void* data, size_t size)
/* if necessary, pad to 64-bit alignment */
if ((size & 7) != 0) {
int padSize = 8 - (size & 7);
- LOGV("size was %d, inserting %d pad bytes\n", size, padSize);
+ LOGV("size was %d, inserting %d pad bytes", size, padSize);
lseek(fd, padSize, SEEK_CUR);
}
@@ -1466,7 +1466,7 @@ static bool computeFileChecksum(int fd, off_t start, size_t length, u4* pSum)
uLong adler;
if (lseek(fd, start, SEEK_SET) != start) {
- LOGE("Unable to seek to start of checksum area (%ld): %s\n",
+ LOGE("Unable to seek to start of checksum area (%ld): %s",
(long) start, strerror(errno));
return false;
}
@@ -1477,7 +1477,7 @@ static bool computeFileChecksum(int fd, off_t start, size_t length, u4* pSum)
size_t wanted = (length < sizeof(readBuf)) ? length : sizeof(readBuf);
actual = read(fd, readBuf, wanted);
if (actual <= 0) {
- LOGE("Read failed (%d) while computing checksum (len=%zu): %s\n",
+ LOGE("Read failed (%d) while computing checksum (len=%zu): %s",
(int) actual, length, strerror(errno));
return false;
}