Merge commit '574b99bfcd743d35c2d7e656ce46e282c784168e' into eclair-mr2-plus-aosp * commit '574b99bfcd743d35c2d7e656ce46e282c784168e': process: Add debug code to log process group transitions
This commit is contained in:
@@ -51,6 +51,8 @@ pid_t gettid() { return syscall(__NR_gettid);}
|
|||||||
#undef __KERNEL__
|
#undef __KERNEL__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define POLICY_DEBUG 1
|
||||||
|
|
||||||
using namespace android;
|
using namespace android;
|
||||||
|
|
||||||
static void signalExceptionForPriorityError(JNIEnv* env, jobject obj, int err)
|
static void signalExceptionForPriorityError(JNIEnv* env, jobject obj, int err)
|
||||||
@@ -212,6 +214,26 @@ void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if POLICY_DEBUG
|
||||||
|
char cmdline[32];
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
strcpy(cmdline, "unknown");
|
||||||
|
|
||||||
|
sprintf(proc_path, "/proc/%d/cmdline", pid);
|
||||||
|
fd = open(proc_path, O_RDONLY);
|
||||||
|
if (fd >= 0) {
|
||||||
|
int rc = read(fd, cmdline, sizeof(cmdline)-1);
|
||||||
|
cmdline[rc] = 0;
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (grp == ANDROID_TGROUP_BG_NONINTERACT) {
|
||||||
|
LOGD("setProcessGroup: vvv pid %d (%s)", pid, cmdline);
|
||||||
|
} else {
|
||||||
|
LOGD("setProcessGroup: ^^^ pid %d (%s)", pid, cmdline);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
sprintf(proc_path, "/proc/%d/task", pid);
|
sprintf(proc_path, "/proc/%d/task", pid);
|
||||||
if (!(d = opendir(proc_path))) {
|
if (!(d = opendir(proc_path))) {
|
||||||
// If the process exited on us, don't generate an exception
|
// If the process exited on us, don't generate an exception
|
||||||
|
|||||||
Reference in New Issue
Block a user