OSDN Git Service
(root)
/
android-x86
/
dalvik.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge in klp-release history after reset to klp-dev
[android-x86/dalvik.git]
/
vm
/
Misc.cpp
diff --git
a/vm/Misc.cpp
b/vm/Misc.cpp
index
d13a9e5
..
057b90d
100644
(file)
--- a/
vm/Misc.cpp
+++ b/
vm/Misc.cpp
@@
-184,7
+184,7
@@
void dvmPrintDebugMessage(const DebugOutputTarget* target, const char* format,
vfprintf(target->data.file.fp, format, args);
break;
default:
vfprintf(target->data.file.fp, format, args);
break;
default:
- LOGE("unexpected 'which' %d", target->which);
+
A
LOGE("unexpected 'which' %d", target->which);
break;
}
break;
}
@@
-512,7
+512,12
@@
u8 dvmGetOtherThreadCpuTimeNsec(pthread_t thread)
*/
bool dvmIterativeSleep(int iteration, int maxTotalSleep, u8 relStartTime)
{
*/
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;
u8 curTime;
int curDelay;
@@
-570,11
+575,11
@@
bool dvmSetCloseOnExec(int fd)
*/
flags = fcntl(fd, F_GETFD);
if (flags < 0) {
*/
flags = fcntl(fd, F_GETFD);
if (flags < 0) {
- LOGW("Unable to get fd flags for fd %d", fd);
+
A
LOGW("Unable to get fd flags for fd %d", fd);
return false;
}
if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) {
return false;
}
if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) {
- LOGW("Unable to set close-on-exec for fd %d", fd);
+
A
LOGW("Unable to set close-on-exec for fd %d", fd);
return false;
}
return true;
return false;
}
return true;
@@
-619,6
+624,7
@@
void *dvmAllocRegion(size_t byteCount, int prot, const char *name) {
return NULL;
}
if (ret == -1) {
return NULL;
}
if (ret == -1) {
+ munmap(base, byteCount);
return NULL;
}
return base;
return NULL;
}
return base;
@@
-678,7
+684,7
@@
bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
int cc = read(fd, lineBuf, sizeof(lineBuf)-1);
if (cc <= 0) {
const char* msg = (cc == 0) ? "unexpected EOF" : strerror(errno);
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);
+
A
LOGI("Unable to read '%s': %s", nameBuf, msg);
close(fd);
return false;
}
close(fd);
return false;
}
@@
-694,8
+700,10
@@
bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
char* cp = strchr(lineBuf, ')');
if (cp == NULL)
goto parse_fail;
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;
cp = strchr(cp+1, ' ');
if (cp == NULL)
goto parse_fail;
@@
-707,7
+715,7
@@
bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
char* endp;
pData->utime = strtoul(cp+1, &endp, 10);
if (endp == cp+1)
char* endp;
pData->utime = strtoul(cp+1, &endp, 10);
if (endp == cp+1)
- LOGI("Warning: strtoul failed on utime ('%.30s...')", cp);
+
A
LOGI("Warning: strtoul failed on utime ('%.30s...')", cp);
cp = strchr(cp+1, ' ');
if (cp == NULL)
cp = strchr(cp+1, ' ');
if (cp == NULL)
@@
-715,7
+723,7
@@
bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
pData->stime = strtoul(cp+1, &endp, 10);
if (endp == cp+1)
pData->stime = strtoul(cp+1, &endp, 10);
if (endp == cp+1)
- LOGI("Warning: strtoul failed on stime ('%.30s...')", cp);
+
A
LOGI("Warning: strtoul failed on stime ('%.30s...')", cp);
/*
* Skip more stuff we don't care about.
/*
* Skip more stuff we don't care about.
@@
-731,12
+739,12
@@
bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
*/
pData->processor = strtol(cp+1, &endp, 10);
if (endp == cp+1)
*/
pData->processor = strtol(cp+1, &endp, 10);
if (endp == cp+1)
- LOGI("Warning: strtoul failed on processor ('%.30s...')", cp);
+
A
LOGI("Warning: strtoul failed on processor ('%.30s...')", cp);
return true;
parse_fail:
return true;
parse_fail:
- LOGI("stat parse failed (%s)", lineBuf);
+
A
LOGI("stat parse failed (%s)", lineBuf);
return false;
}
return false;
}