Revert "procfs: add '/proc/pid/stat' to mckernel side and fix its comm"
This reverts commit b70d470e20.
That commit had been landed too fast after a mistake during migration
from old to new gerrit that didn't keep -1 vote ; it needs some fix
Change-Id: Ifc8a23e42449dfe471049270b4706e9b137e096e
This commit is contained in:
@ -1112,7 +1112,7 @@ static const struct procfs_entry pid_entry_stuff[] = {
|
|||||||
PROC_REG("mem", 0600, NULL),
|
PROC_REG("mem", 0600, NULL),
|
||||||
PROC_REG("pagemap", 0444, NULL),
|
PROC_REG("pagemap", 0444, NULL),
|
||||||
// PROC_REG("smaps", S_IRUGO, NULL),
|
// PROC_REG("smaps", S_IRUGO, NULL),
|
||||||
PROC_REG("stat", 0444, &mckernel_buff_io),
|
// PROC_REG("stat", 0444, &mckernel_buff_io),
|
||||||
// PROC_REG("statm", S_IRUGO, NULL),
|
// PROC_REG("statm", S_IRUGO, NULL),
|
||||||
PROC_REG("status", 0444, &mckernel_buff_io),
|
PROC_REG("status", 0444, &mckernel_buff_io),
|
||||||
// PROC_REG("syscall", S_IRUGO, NULL),
|
// PROC_REG("syscall", S_IRUGO, NULL),
|
||||||
|
|||||||
@ -522,10 +522,9 @@ struct process {
|
|||||||
int egid;
|
int egid;
|
||||||
int sgid;
|
int sgid;
|
||||||
int fsgid;
|
int fsgid;
|
||||||
int execed:1;
|
int execed;
|
||||||
int nohost:1;
|
int nohost;
|
||||||
int nowait:1;
|
int nowait;
|
||||||
int forwarding:1;
|
|
||||||
struct rlimit rlimit[MCK_RLIM_MAX];
|
struct rlimit rlimit[MCK_RLIM_MAX];
|
||||||
unsigned long saved_auxv[AUXV_LEN];
|
unsigned long saved_auxv[AUXV_LEN];
|
||||||
char *saved_cmdline;
|
char *saved_cmdline;
|
||||||
|
|||||||
@ -653,41 +653,6 @@ int process_procfs_request(struct ikc_scd_packet *rpacket)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(p, "stat")) {
|
if (!strcmp(p, "stat")) {
|
||||||
const char *comm = "exe";
|
|
||||||
char state;
|
|
||||||
|
|
||||||
if (proc->saved_cmdline) {
|
|
||||||
comm = strrchr(proc->saved_cmdline, '/');
|
|
||||||
if (comm)
|
|
||||||
comm++;
|
|
||||||
else
|
|
||||||
comm = proc->saved_cmdline;
|
|
||||||
}
|
|
||||||
switch (proc->status & (0x3f)) {
|
|
||||||
case PS_INTERRUPTIBLE:
|
|
||||||
state = 'S';
|
|
||||||
break;
|
|
||||||
case PS_UNINTERRUPTIBLE:
|
|
||||||
state = 'D';
|
|
||||||
break;
|
|
||||||
case PS_ZOMBIE:
|
|
||||||
state = 'Z';
|
|
||||||
break;
|
|
||||||
case PS_EXITED:
|
|
||||||
state = 'X';
|
|
||||||
break;
|
|
||||||
case PS_STOPPED:
|
|
||||||
state = 'T';
|
|
||||||
break;
|
|
||||||
case PS_RUNNING:
|
|
||||||
default:
|
|
||||||
if (proc->forwarding)
|
|
||||||
state = 'S';
|
|
||||||
else
|
|
||||||
state = 'R';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pid (comm) state ppid
|
* pid (comm) state ppid
|
||||||
@ -714,7 +679,7 @@ int process_procfs_request(struct ikc_scd_packet *rpacket)
|
|||||||
"%lu %lu %lu %lu " // sigignore...
|
"%lu %lu %lu %lu " // sigignore...
|
||||||
"%lu %d %d %u " // cnswap...
|
"%lu %d %d %u " // cnswap...
|
||||||
"%u %llu %lu %ld\n", // policy...
|
"%u %llu %lu %ld\n", // policy...
|
||||||
0, comm, state, 0, // pid...
|
0, "exe", 'R', 0, // pid...
|
||||||
0, 0, 0, 0, // pgrp...
|
0, 0, 0, 0, // pgrp...
|
||||||
0, 0L, 0L, 0L, // flags...
|
0, 0L, 0L, 0L, // flags...
|
||||||
0L, 0L, 0L, 0L, // cmajflt...
|
0L, 0L, 0L, 0L, // cmajflt...
|
||||||
|
|||||||
@ -237,7 +237,6 @@ long do_syscall(struct syscall_request *req, int cpu)
|
|||||||
|
|
||||||
dkprintf("%s: syscall num: %d waiting for Linux.. \n",
|
dkprintf("%s: syscall num: %d waiting for Linux.. \n",
|
||||||
__FUNCTION__, req->number);
|
__FUNCTION__, req->number);
|
||||||
proc->forwarding = 1;
|
|
||||||
|
|
||||||
#define STATUS_IN_PROGRESS 0
|
#define STATUS_IN_PROGRESS 0
|
||||||
#define STATUS_COMPLETED 1
|
#define STATUS_COMPLETED 1
|
||||||
@ -399,7 +398,6 @@ long do_syscall(struct syscall_request *req, int cpu)
|
|||||||
send_syscall(&req2, cpu, &res);
|
send_syscall(&req2, cpu, &res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proc->forwarding = 0;
|
|
||||||
if (req->rtid == -1) {
|
if (req->rtid == -1) {
|
||||||
preempt_enable();
|
preempt_enable();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user