support getrusage (work in progress)

This commit is contained in:
Tomoki Shirasawa
2016-03-07 17:06:44 +09:00
parent 7fac03d4de
commit dbc778e4fa
6 changed files with 112 additions and 3 deletions

View File

@@ -439,6 +439,9 @@ struct process {
// cpu time (children)
struct timespec stime_children;
struct timespec utime_children;
long maxrss;
long maxrss_children;
};
void hold_thread(struct thread *ftn);
@@ -560,6 +563,8 @@ struct process_vm {
ihk_atomic_t refcount;
int exiting;
long currss;
};

View File

@@ -326,6 +326,29 @@ struct procfs_file {
char fname[PROCFS_NAME_MAX]; /* procfs filename (request) */
};
#define RUSAGE_SELF 0
#define RUSAGE_CHILDREN -1
#define RUSAGE_THREAD 1
struct rusage {
struct timeval ru_utime;
struct timeval ru_stime;
long ru_maxrss;
long ru_ixrss;
long ru_idrss;
long ru_isrss;
long ru_minflt;
long ru_majflt;
long ru_nswap;
long ru_inblock;
long ru_oublock;
long ru_msgsnd;
long ru_msgrcv;
long ru_nsignals;
long ru_nvcsw;
long ru_nivcsw;
};
extern void terminate(int, int);
struct tod_data_s {