vfprintf(target->data.file.fp, format, args);
break;
default:
- LOGE("unexpected 'which' %d", target->which);
+ ALOGE("unexpected 'which' %d", target->which);
break;
}
*/
bool dvmIterativeSleep(int iteration, int maxTotalSleep, u8 relStartTime)
{
- const int minSleep = 10000;
+ /*
+ * Minimum sleep is one millisecond, it is important to keep this value
+ * low to ensure short GC pauses since dvmSuspendAllThreads() uses this
+ * function.
+ */
+ const int minSleep = 1000;
u8 curTime;
int curDelay;
*/
flags = fcntl(fd, F_GETFD);
if (flags < 0) {
- LOGW("Unable to get fd flags for fd %d", fd);
+ ALOGW("Unable to get fd flags for fd %d", fd);
return false;
}
if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) {
- LOGW("Unable to set close-on-exec for fd %d", fd);
+ ALOGW("Unable to set close-on-exec for fd %d", fd);
return false;
}
return true;
return NULL;
}
if (ret == -1) {
+ munmap(base, byteCount);
return NULL;
}
return base;
int cc = read(fd, lineBuf, sizeof(lineBuf)-1);
if (cc <= 0) {
const char* msg = (cc == 0) ? "unexpected EOF" : strerror(errno);
- LOGI("Unable to read '%s': %s", nameBuf, msg);
+ ALOGI("Unable to read '%s': %s", nameBuf, msg);
close(fd);
return false;
}
char* cp = strchr(lineBuf, ')');
if (cp == NULL)
goto parse_fail;
- cp++;
- for (i = 2; i < 13; i++) {
+ cp += 2;
+ pData->state = *cp++;
+
+ for (i = 3; i < 13; i++) {
cp = strchr(cp+1, ' ');
if (cp == NULL)
goto parse_fail;
char* endp;
pData->utime = strtoul(cp+1, &endp, 10);
if (endp == cp+1)
- LOGI("Warning: strtoul failed on utime ('%.30s...')", cp);
+ ALOGI("Warning: strtoul failed on utime ('%.30s...')", cp);
cp = strchr(cp+1, ' ');
if (cp == NULL)
pData->stime = strtoul(cp+1, &endp, 10);
if (endp == cp+1)
- LOGI("Warning: strtoul failed on stime ('%.30s...')", cp);
+ ALOGI("Warning: strtoul failed on stime ('%.30s...')", cp);
/*
* Skip more stuff we don't care about.
*/
pData->processor = strtol(cp+1, &endp, 10);
if (endp == cp+1)
- LOGI("Warning: strtoul failed on processor ('%.30s...')", cp);
+ ALOGI("Warning: strtoul failed on processor ('%.30s...')", cp);
return true;
parse_fail:
- LOGI("stat parse failed (%s)", lineBuf);
+ ALOGI("stat parse failed (%s)", lineBuf);
return false;
}