①Issueで報告されたテストプログラムによる確認
$ mcexec ./test_mck -s getrusage -n 0
TEST_SUITE: getrusage
TEST_NUMBER: 0
ARGS:
------------------------------
show_rusage():
  ru_utime=0s + 565us
  ru_stime=0s + 14923us
  ru_maxrss=6088
------------------------------
allocation memory 16777216 byte(16384 KiB)
alarm 2 seconds wait.
sleep 2 seconds wait.
------------------------------
show_rusage():
  ru_utime=1s + 998545us
  ru_stime=2s + 17802us
  ru_maxrss=22492
------------------------------
free memory 16777216 byte(16384 KiB)
------------------------------
show_rusage():
  ru_utime=1s + 998554us
  ru_stime=2s + 17932us
  ru_maxrss=22492
------------------------------
RESULT: you need check rusage value

$ mcexec ./test_mck -s getrusage -n 1
TEST_SUITE: getrusage
TEST_NUMBER: 1
ARGS:
------------------------------
show_rusage():
  ru_utime=0s + 0us
  ru_stime=0s + 0us
  ru_maxrss=0
------------------------------
allocation memory 16777216 byte(16384 KiB)
alarm 2 seconds wait.
sleep 2 seconds wait.
free memory 16777216 byte(16384 KiB)
------------------------------
show_rusage():
  ru_utime=1s + 998065us
  ru_stime=2s + 2942us
  ru_maxrss=21828
------------------------------
RESULT: you need check rusage value

$ mcexec ./test_mck -s getrusage -n 2
TEST_SUITE: getrusage
TEST_NUMBER: 2
ARGS:
[parent before]
------------------------------
show_rusage():
  ru_utime=0s + 563us
  ru_stime=0s + 10281us
  ru_maxrss=6096
------------------------------
[child before]
------------------------------
show_rusage():
  ru_utime=0s + 7us
  ru_stime=0s + 30us
  ru_maxrss=14304
------------------------------
allocation memory 16777216 byte(16384 KiB)
alarm 2 seconds wait.
sleep 2 seconds wait.
free memory 16777216 byte(16384 KiB)
[child after]
------------------------------
show_rusage():
  ru_utime=1s + 997905us
  ru_stime=2s + 3090us
  ru_maxrss=30708
------------------------------
[parent after]
------------------------------
show_rusage():
  ru_utime=0s + 580us
  ru_stime=4s + 12829us
  ru_maxrss=30712
------------------------------
RESULT: you need check rusage value

②McKernelでのgetrusage()の基本動作確認
/home/satoken/ppos/bin/mcexec ./CT_001
----  just started ----
[ RUSAGE_SELF ]
 [OK]   utime: 0.000529 s (+ 0.000529 s)
 [OK]   stime: 0.024795 s (+ 0.024795 s)
----  add utime 2sec ----
[ RUSAGE_SELF ]
 [OK]   utime: 1.997453 s (+ 1.996924 s)
 [OK]   stime: 0.024974 s (+ 0.000179 s)
----  add stime 1sec ----
[ RUSAGE_SELF ]
 [OK]   utime: 1.997461 s (+ 0.000008 s)
 [OK]   stime: 1.023560 s (+ 0.998586 s)
*** CT_001 PASS

/home/satoken/ppos/bin/mcexec ./CT_002
----  just started ----
[ RUSAGE_SELF ]
 [OK]   maxrss: 6012 KB (+ 6012 KB)
----  mmap and access 12MB (12288 KB)  ----
[ RUSAGE_SELF ]
 [OK]   maxrss: 18352 KB (+ 12340 KB)
----  munmap 12MB (12288 KB)  ----
[ RUSAGE_SELF ]
 [OK]   maxrss: 18352 KB (+ 0 KB)
----  mmap and access 16MB (16384 KB)  ----
[ RUSAGE_SELF ]
 [OK]   maxrss: 22448 KB (+ 4096 KB)
*** CT_002 PASS

/home/satoken/ppos/bin/mcexec ./CT_003
----  just started ----
[ RUSAGE_SELF ]
 [OK]   utime: 0.000531 s (+ 0.000531 s)
 [OK]   stime: 0.009804 s (+ 0.009804 s)
----  create thread and join  ----
    ----  add utime 2sec in sub thread  ----
    ----  add stime 1sec in sub thread  ----
    ----  sub thread exit ----
[ RUSAGE_SELF ]
 [OK]   utime: 1.997496 s (+ 1.996965 s)  <- サブスレッド増分2秒
 [OK]   stime: 4.005407 s (+ 3.995603 s)  <- サブスレッド増分1秒 + メインスレッドjoin待ち3秒
*** CT_003 PASS

/home/satoken/ppos/bin/mcexec ./CT_004
----  just started ----
[ RUSAGE_SELF ]
 [OK]   maxrss: 6008 KB (+ 6008 KB)
----  create thread and join  ----
    ----  mmap and access 16MB (16384 KB) in sub thread  ----
    ----  munmap 16MB (16384 KB) in sub thread ----
    ----  sub thread exit  ----
[ RUSAGE_SELF ]
 [OK]   maxrss: 30652 KB (+ 24644 KB)
*** CT_004 PASS

/home/satoken/ppos/bin/mcexec ./CT_005
----  just started ----
[ RUSAGE_SELF ]
 [OK]   utime: 0.000523 s (+ 0.000523 s)
 [OK]   stime: 0.009879 s (+ 0.009879 s)
 [OK]   maxrss: 6012 KB (+ 6012 KB)
----  fork child process  ----
----  add utime 3sec in parent  ----
    ----  add utime 1sec in child  ----
    ----  add stime 1sec in child  ----
    ----  mmap and access 16MB (16384 KB) in child  ----
    ----  munmap 16MB (16384 KB) in child  ----
    ----  child process exit  ----
----  wait child's exit  ----
[ RUSAGE_SELF ]
 [OK]   utime: 2.995900 s (+ 2.995377 s)
 [OK]   stime: 0.015519 s (+ 0.005640 s)
 [OK]   maxrss: 6084 KB (+ 72 KB)
*** CT_005 PASS

/home/satoken/ppos/bin/mcexec ./CT_006
----  just started ----
[ RUSAGE_CHILDREN ]
 [OK]   utime: 0.000000 s (+ 0.000000 s)
 [OK]   stime: 0.000000 s (+ 0.000000 s)
----  fork child process  ----
----  add utime 1sec in parent  ----
    ----  add utime 2sec in child  ----
[ RUSAGE_CHILDREN ]
 [OK]   utime: 0.000000 s (+ 0.000000 s)  <- 子プロセスが未終了のため、0
 [OK]   stime: 0.000000 s (+ 0.000000 s)  <- 子プロセスが未終了のため、0
----  wait child's exit  ----
    ----  add stime 1sec in child  ----
    ----  child process exit  ----
[ RUSAGE_CHILDREN ]
 [OK]   utime: 1.996949 s (+ 1.996949 s)
 [OK]   stime: 0.998664 s (+ 0.998664 s)
*** CT_006 PASS

/home/satoken/ppos/bin/mcexec ./CT_007
----  just started ----
[ RUSAGE_CHILDREN ]
 [OK]   maxrss: 0 KB (+ 0 KB)
----  fork child process  ----
----  mmap and access 32MB (32768 KB) in parent  ----
    ----  add utime 1sec in child  ----
----  munmap 32MB (32768 KB) in parent  ----
----  wait child's exit  ----
    ----  mmap and access 16MB (16384 KB) in child  ----
    ----  munmap 16MB (16384 KB) in child  ----
    ----  child process exit ----
[ RUSAGE_CHILDREN ]
 [OK]   maxrss: 21516 KB (+ 21516 KB)  <- 子プロセス終了後に更新 (プロセス生成時の5～6M + mmapでの16M)
*** CT_007 PASS

/home/satoken/ppos/bin/mcexec ./CT_008
----  just started ----
[ RUSAGE_CHILDREN ]
 [OK]   utime: 0.000000 s (+ 0.000000 s)
 [OK]   stime: 0.000000 s (+ 0.000000 s)
 [OK]   maxrss: 0 KB (+ 0 KB)
----  fork child process  ----
----  wait child's exit  ----
    ----  fork grand_child process  ----
    ----  add utime 2sec in child  ----
        ----  add utime 1sec in grand_child  ----
        ----  add stime 1sec in grand_child  ----
    ----  add stime 1sec in child  ----
        ----  mmap and access 32MB (32768 KB) in grand_child  ----
        ----  munmap 32MB (32768 KB) in grand_child  ----
        ----  grand_child process exit  ----
    ----  mmap and access 8MB (8192 KB) in child  ----
    ----  munmap 8MB (8192 KB) in child  ----
    ----  wait grand_child's exit  ----
    ----  child process exit  ----
[ RUSAGE_CHILDREN ]
 [OK]   utime: 2.999773 s (+ 2.999773 s)  <- 子プロセス2秒、孫プロセス1秒の和
 [OK]   stime: 2.009370 s (+ 2.009370 s)  <- 子プロセス1秒、孫プロセス1秒の和
 [OK]   maxrss: 37896 KB (+ 37896 KB)  <- 子、孫のmaxrssの最大値
*** CT_008 PASS

/home/satoken/ppos/bin/mcexec ./CT_009
----  just started ----
 [OK]   utime: 0.000533 s (+ 0.000533 s)
 [OK]   stime: 0.009959 s (+ 0.009959 s)
----  add utime 1sec in main thread  ----
----  create thread and join  ----
    [ RUSAGE_THREAD ]
 [OK]       utime: 0.000005 s (+ 0.000005 s)
 [OK]       stime: 0.000013 s (+ 0.000013 s)
    ----  add utime 2sec in sub thread  ----
    ----  add stime 1sec in sub thread  ----
    [ RUSAGE_THREAD ]
 [OK]       utime: 1.996928 s (+ 1.996928 s)
 [OK]       stime: 0.998632 s (+ 0.998632 s)
    ----  sub thread exit  ----
[ RUSAGE_THREAD ]
 [OK]   utime: 0.999024 s (+ 0.998491 s)
 [OK]   stime: 3.006973 s (+ 2.997014 s)  <- join待ち3秒
*** CT_009 PASS

/home/satoken/ppos/bin/mcexec ./CT_010
----  just started ----
[ RUSAGE_THREAD ]
 [OK]   maxrss: 6008 KB (+ 6008 KB)
----  mmap and access 8MB (8192 KB) in main thread  ----
----  munmap 8MB (8192 KB) in main thread ----
----  create and join thread  ----
    [ RUSAGE_THREAD ]
 [OK]       maxrss: 14264 KB
    ----  mmap and access 16MB (16384 KB) in sub thread  ----
    ----  munmap 16MB (16384 KB) in sub thread ----
    ----  sub thread exit  ----
[ RUSAGE_THREAD ]
 [OK]   maxrss: 30652 KB (+ 24644 KB)
*** CT_010 PASS
