include interrupt handling time into system time
Change-Id: If2ed2d488b4040d288d712f0a244505adbcec6f5 Refs: #1221
This commit is contained in:
committed by
Masamichi Takagi
parent
ba80dd8650
commit
f115bae8a7
@ -9526,12 +9526,7 @@ set_cputime(enum set_cputime_mode mode)
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == CPUTIME_MODE_K2K_IN) {
|
||||
thread->base_tsc = 0;
|
||||
}
|
||||
else{
|
||||
thread->base_tsc = tsc;
|
||||
}
|
||||
|
||||
thread->times_update = 1;
|
||||
thread->in_kernel = (int)mode;
|
||||
|
||||
74
test/issues/1221/C1221.patch
Normal file
74
test/issues/1221/C1221.patch
Normal file
@ -0,0 +1,74 @@
|
||||
diff --git a/arch/arm64/kernel/include/syscall_list.h b/arch/arm64/kernel/include/syscall_list.h
|
||||
index 5dd6243..0f172a3 100644
|
||||
--- a/arch/arm64/kernel/include/syscall_list.h
|
||||
+++ b/arch/arm64/kernel/include/syscall_list.h
|
||||
@@ -128,6 +128,8 @@ SYSCALL_HANDLED(731, util_indicate_clone)
|
||||
SYSCALL_HANDLED(732, get_system)
|
||||
SYSCALL_HANDLED(733, util_register_desc)
|
||||
|
||||
+SYSCALL_HANDLED(750, int_and_sleep)
|
||||
+
|
||||
/* McKernel Specific */
|
||||
SYSCALL_HANDLED(801, swapout)
|
||||
SYSCALL_HANDLED(802, linux_mlock)
|
||||
diff --git a/arch/x86_64/kernel/include/syscall_list.h b/arch/x86_64/kernel/include/syscall_list.h
|
||||
index 8ef9bd0..2134212 100644
|
||||
--- a/arch/x86_64/kernel/include/syscall_list.h
|
||||
+++ b/arch/x86_64/kernel/include/syscall_list.h
|
||||
@@ -170,6 +170,8 @@ SYSCALL_HANDLED(731, util_indicate_clone)
|
||||
SYSCALL_HANDLED(732, get_system)
|
||||
SYSCALL_HANDLED(733, util_register_desc)
|
||||
|
||||
+SYSCALL_HANDLED(750, int_and_sleep)
|
||||
+
|
||||
/* McKernel Specific */
|
||||
SYSCALL_HANDLED(801, swapout)
|
||||
SYSCALL_HANDLED(802, linux_mlock)
|
||||
diff --git a/kernel/syscall.c b/kernel/syscall.c
|
||||
index 97935a7..a603791 100644
|
||||
--- a/kernel/syscall.c
|
||||
+++ b/kernel/syscall.c
|
||||
@@ -9429,6 +9429,43 @@ SYSCALL_DECLARE(util_register_desc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+volatile long wk;
|
||||
+volatile long x;
|
||||
+volatile long y;
|
||||
+volatile long z;
|
||||
+
|
||||
+static void int_func(void *arg)
|
||||
+{
|
||||
+ long i;
|
||||
+
|
||||
+ kprintf("int_func start\n");
|
||||
+ for (i = 0; i < 100000000L; i++)
|
||||
+ wk += x * y + z;
|
||||
+ kprintf("int_func end\n");
|
||||
+}
|
||||
+
|
||||
+SYSCALL_DECLARE(int_and_sleep)
|
||||
+{
|
||||
+ struct ihk_mc_interrupt_handler *int_handler;
|
||||
+ long flag;
|
||||
+
|
||||
+ int_handler = kmalloc(sizeof(struct ihk_mc_interrupt_handler), IHK_MC_AP_NOWAIT);
|
||||
+ memset(int_handler, '\0', sizeof(struct ihk_mc_interrupt_handler));
|
||||
+ INIT_LIST_HEAD(&int_handler->list);
|
||||
+ int_handler->func = int_func;
|
||||
+ int_handler->priv = NULL;
|
||||
+ kprintf("ihk_mc_register_interrupt_handler\n");
|
||||
+ ihk_mc_register_interrupt_handler(140, int_handler);
|
||||
+ kprintf("ihk_mc_interrupt_cpu\n");
|
||||
+ flag = cpu_disable_interrupt_save();
|
||||
+ ihk_mc_interrupt_cpu(ihk_mc_get_processor_id(), 140);
|
||||
+ cpu_restore_interrupt(flag);
|
||||
+ kprintf("ihk_mc_unregister_interrupt_handler\n");
|
||||
+ ihk_mc_unregister_interrupt_handler(140, int_handler);
|
||||
+ kfree(int_handler);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
void
|
||||
reset_cputime()
|
||||
{
|
||||
21
test/issues/1221/C1221.sh
Normal file
21
test/issues/1221/C1221.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
USELTP=1
|
||||
USEOSTEST=0
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
################################################################################
|
||||
$MCEXEC ./C1221T01
|
||||
|
||||
for i in getrusage01:02 getrusage02:03 getrusage03:04 getrusage04:05; do
|
||||
tp=`echo $i|sed 's/:.*//'`
|
||||
id=`echo $i|sed 's/.*://'`
|
||||
PATH=$PATH:$LTPBIN $MCEXEC $LTPBIN/$tp 2>&1 | tee $tp.txt
|
||||
ok=`grep TPASS $tp.txt | wc -l`
|
||||
ng=`grep TFAIL $tp.txt | wc -l`
|
||||
if [ $ng = 0 ]; then
|
||||
echo "*** C1221T$id: $tp PASS ($ok)"
|
||||
else
|
||||
echo "*** C1221T$id: $tp FAIL (ok=$ok ng=%ng)"
|
||||
fi
|
||||
done
|
||||
56
test/issues/1221/C1221T01.c
Normal file
56
test/issues/1221/C1221T01.c
Normal file
@ -0,0 +1,56 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <errno.h>
|
||||
|
||||
void tv_sub(struct timeval *t1, struct timeval *t2)
|
||||
{
|
||||
t2->tv_sec -= t1->tv_sec;
|
||||
t2->tv_usec -= t1->tv_usec;
|
||||
if (t2->tv_usec < 0) {
|
||||
t2->tv_usec += 1000000;
|
||||
t2->tv_sec--;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct timeval t1;
|
||||
struct timeval t2;
|
||||
struct rusage ru0;
|
||||
struct rusage ru;
|
||||
long xe;
|
||||
long xs;
|
||||
|
||||
fprintf(stderr, "*** C1221T01 test start\n");
|
||||
gettimeofday(&t1, NULL);
|
||||
getrusage(RUSAGE_SELF, &ru0);
|
||||
if (syscall(750, 1) == -1) {
|
||||
fprintf(stderr, "*** C1221T01 FAIL no patched kernel\n");
|
||||
exit(1);
|
||||
}
|
||||
getrusage(RUSAGE_SELF, &ru);
|
||||
gettimeofday(&t2, NULL);
|
||||
tv_sub(&t1, &t2);
|
||||
tv_sub(&ru0.ru_utime, &ru.ru_utime);
|
||||
tv_sub(&ru0.ru_stime, &ru.ru_stime);
|
||||
fprintf(stderr, "etime=%d.%06d\n", (int)t2.tv_sec, (int)t2.tv_usec);
|
||||
fprintf(stderr, "utime=%d.%06d\n", (int)ru.ru_utime.tv_sec,
|
||||
(int)ru.ru_utime.tv_usec);
|
||||
fprintf(stderr, "stime=%d.%06d\n", (int)ru.ru_stime.tv_sec,
|
||||
(int)ru.ru_stime.tv_usec);
|
||||
xe = t2.tv_sec * 1000000L + t2.tv_usec;
|
||||
xs = ru.ru_stime.tv_sec * 1000000L + ru.ru_stime.tv_usec;
|
||||
if (xs > (xe * 100 / 95)) {
|
||||
fprintf(stderr, "*** C1221T01 FAIL\n");
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "*** C1221T01 PASS\n");
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
128
test/issues/1221/C1221_arm64.txt
Normal file
128
test/issues/1221/C1221_arm64.txt
Normal file
@ -0,0 +1,128 @@
|
||||
Script started on Thu 26 Sep 2019 10:37:38 AM JST
|
||||
gcc -g -Wall -o C1221T01 C1221T01.c
|
||||
sh ./C1221.sh
|
||||
mcstop+release.sh ... done
|
||||
mcreboot.sh -c 1-6,29-34 -m 50G@0,50G@1 -r 1-6:0+29-34:28 -O ... done
|
||||
*** C1221T01 test start
|
||||
etime=0.000017
|
||||
utime=0.000001
|
||||
stime=0.000011
|
||||
*** C1221T01 PASS
|
||||
getrusage01 1 TPASS : getrusage passed
|
||||
getrusage01 2 TPASS : getrusage passed
|
||||
*** C1221T02: getrusage01 PASS (2)
|
||||
getrusage02 1 TPASS : getrusage failed as expected: TEST_ERRNO=EINVAL(22): Invalid argument
|
||||
getrusage02 2 TPASS : getrusage failed as expected: TEST_ERRNO=EFAULT(14): Bad address
|
||||
*** C1221T03: getrusage02 PASS (2)
|
||||
getrusage03 0 TINFO : allocate 100MB
|
||||
getrusage03 0 TINFO : Testcase #01: fork inherit
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 0 TINFO : child.self = 106880
|
||||
getrusage03 0 TINFO : allocate 100MB
|
||||
getrusage03 0 TINFO : Testcase #01: fork inherit
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 1 TPASS : initial.self ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #02: fork inherit(cont.)
|
||||
getrusage03 0 TINFO : initial.children = 106880
|
||||
getrusage03 2 TPASS : initial.children ~= 100MB
|
||||
getrusage03 0 TINFO : child.children = 0
|
||||
getrusage03 0 TINFO : allocate 100MB
|
||||
getrusage03 0 TINFO : Testcase #01: fork inherit
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 1 TPASS : initial.self ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #02: fork inherit(cont.)
|
||||
getrusage03 0 TINFO : initial.children = 106880
|
||||
getrusage03 2 TPASS : initial.children ~= 100MB
|
||||
getrusage03 3 TPASS : child.children == 0
|
||||
getrusage03 0 TINFO : Testcase #03: fork + malloc
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 0 TINFO : child allocate +50MB
|
||||
getrusage03 0 TINFO : child.self = 158144
|
||||
getrusage03_child 0 TINFO : grandchild allocate 300MB
|
||||
getrusage03_child 0 TINFO : grandchild allocate 300MB
|
||||
getrusage03 0 TINFO : allocate 100MB
|
||||
getrusage03 0 TINFO : Testcase #01: fork inherit
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 1 TPASS : initial.self ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #02: fork inherit(cont.)
|
||||
getrusage03 0 TINFO : initial.children = 106880
|
||||
getrusage03 2 TPASS : initial.children ~= 100MB
|
||||
getrusage03 3 TPASS : child.children == 0
|
||||
getrusage03 0 TINFO : Testcase #03: fork + malloc
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 4 TPASS : initial.self + 50MB ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #04: grandchild maxrss
|
||||
getrusage03 0 TINFO : initial.children = 158144
|
||||
getrusage03_child 0 TINFO : child allocate 400MB
|
||||
getrusage03 0 TINFO : allocate 100MB
|
||||
getrusage03 0 TINFO : Testcase #01: fork inherit
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 1 TPASS : initial.self ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #02: fork inherit(cont.)
|
||||
getrusage03 0 TINFO : initial.children = 106880
|
||||
getrusage03 2 TPASS : initial.children ~= 100MB
|
||||
getrusage03 3 TPASS : child.children == 0
|
||||
getrusage03 0 TINFO : Testcase #03: fork + malloc
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 4 TPASS : initial.self + 50MB ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #04: grandchild maxrss
|
||||
getrusage03 0 TINFO : initial.children = 158144
|
||||
getrusage03 0 TINFO : post_wait.children = 311616
|
||||
getrusage03 5 TPASS : child.children ~= 300MB
|
||||
getrusage03 0 TINFO : Testcase #05: zombie
|
||||
getrusage03 0 TINFO : initial.children = 311616
|
||||
getrusage03_child 0 TINFO : child allocate 500MB
|
||||
getrusage03 0 TINFO : allocate 100MB
|
||||
getrusage03 0 TINFO : Testcase #01: fork inherit
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 1 TPASS : initial.self ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #02: fork inherit(cont.)
|
||||
getrusage03 0 TINFO : initial.children = 106880
|
||||
getrusage03 2 TPASS : initial.children ~= 100MB
|
||||
getrusage03 3 TPASS : child.children == 0
|
||||
getrusage03 0 TINFO : Testcase #03: fork + malloc
|
||||
getrusage03 0 TINFO : initial.self = 104576
|
||||
getrusage03 4 TPASS : initial.self + 50MB ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #04: grandchild maxrss
|
||||
getrusage03 0 TINFO : initial.children = 158144
|
||||
getrusage03 0 TINFO : post_wait.children = 311616
|
||||
getrusage03 5 TPASS : child.children ~= 300MB
|
||||
getrusage03 0 TINFO : Testcase #05: zombie
|
||||
getrusage03 0 TINFO : initial.children = 311616
|
||||
getrusage03 0 TINFO : pre_wait.children = 311616
|
||||
getrusage03 6 TPASS : initial.children ~= pre_wait.children
|
||||
getrusage03 0 TINFO : post_wait.children = 412800
|
||||
getrusage03 7 TPASS : post_wait.children ~= 400MB
|
||||
getrusage03 0 TINFO : Testcase #06: SIG_IGN
|
||||
getrusage03 0 TINFO : initial.children = 412800
|
||||
getrusage03_child 0 TINFO : exec.self = 104576, exec.children = 412800
|
||||
getrusage03_child 1 TPASS : initial.self ~= exec.self
|
||||
getrusage03_child 2 TPASS : initial.children ~= exec.children
|
||||
*** C1221T04: getrusage03 PASS (23)
|
||||
getrusage04 0 TINFO : Expected timers granularity is 10000 us
|
||||
getrusage04 0 TINFO : Using 1 as multiply factor for max [us]time increment (1000+10000us)!
|
||||
getrusage04 0 TINFO : utime: 540us; stime: 42257us
|
||||
getrusage04 0 TINFO : utime: 544us; stime: 42260us
|
||||
getrusage04 0 TINFO : utime: 547us; stime: 42260us
|
||||
getrusage04 0 TINFO : utime: 549us; stime: 42261us
|
||||
getrusage04 0 TINFO : utime: 551us; stime: 42262us
|
||||
getrusage04 0 TINFO : utime: 553us; stime: 42262us
|
||||
getrusage04 0 TINFO : utime: 555us; stime: 42263us
|
||||
getrusage04 0 TINFO : utime: 557us; stime: 42263us
|
||||
getrusage04 0 TINFO : utime: 559us; stime: 42264us
|
||||
getrusage04 0 TINFO : utime: 561us; stime: 42264us
|
||||
getrusage04 0 TINFO : utime: 563us; stime: 42265us
|
||||
getrusage04 0 TINFO : utime: 565us; stime: 42265us
|
||||
getrusage04 0 TINFO : utime: 567us; stime: 42266us
|
||||
getrusage04 0 TINFO : utime: 569us; stime: 42266us
|
||||
getrusage04 0 TINFO : utime: 571us; stime: 42267us
|
||||
getrusage04 0 TINFO : utime: 573us; stime: 42267us
|
||||
getrusage04 0 TINFO : utime: 575us; stime: 42268us
|
||||
getrusage04 0 TINFO : utime: 577us; stime: 42268us
|
||||
getrusage04 0 TINFO : utime: 578us; stime: 42269us
|
||||
getrusage04 0 TINFO : utime: 580us; stime: 42270us
|
||||
getrusage04 0 TINFO : utime: 582us; stime: 42270us
|
||||
getrusage04 1 TPASS : Test Passed
|
||||
*** C1221T05: getrusage04 PASS (1)
|
||||
|
||||
Script done on Thu 26 Sep 2019 10:38:13 AM JST
|
||||
84
test/issues/1221/C1221_x86_64.txt
Normal file
84
test/issues/1221/C1221_x86_64.txt
Normal file
@ -0,0 +1,84 @@
|
||||
Script started on Sun Sep 22 15:25:54 2019
|
||||
bash-4.2$ make test
|
||||
gcc -g -Wall -o C1221T01 C1221T01.c
|
||||
sh ./C1221.sh
|
||||
mcstop+release.sh ... done
|
||||
mcreboot.sh -c 1-7,9-15,17-23,25-31 -m 10G@0,10G@1 -r 1-7:0+9-15:8+17-23:16+25-31:24 ... done
|
||||
*** C1221T01 test start
|
||||
etime=0.230807
|
||||
utime=0.000001
|
||||
stime=0.230427
|
||||
*** C1221T01 PASS
|
||||
getrusage01 1 TPASS : getrusage passed
|
||||
getrusage01 2 TPASS : getrusage passed
|
||||
*** C1221T02: getrusage01 PASS (2)
|
||||
getrusage02 1 TPASS : getrusage failed as expected: TEST_ERRNO=EINVAL(22): Invalid argument
|
||||
getrusage02 2 TPASS : getrusage failed as expected: TEST_ERRNO=EFAULT(14): Bad address
|
||||
*** C1221T03: getrusage02 PASS (2)
|
||||
getrusage03 0 TINFO : allocate 100MB
|
||||
getrusage03 0 TINFO : Testcase #01: fork inherit
|
||||
getrusage03 0 TINFO : initial.self = 103340
|
||||
getrusage03 0 TINFO : child.self = 105372
|
||||
getrusage03 1 TPASS : initial.self ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #02: fork inherit(cont.)
|
||||
getrusage03 0 TINFO : initial.children = 105376
|
||||
getrusage03 2 TPASS : initial.children ~= 100MB
|
||||
getrusage03 0 TINFO : child.children = 0
|
||||
getrusage03 3 TPASS : child.children == 0
|
||||
getrusage03 0 TINFO : Testcase #03: fork + malloc
|
||||
getrusage03 0 TINFO : initial.self = 103340
|
||||
getrusage03 0 TINFO : child allocate +50MB
|
||||
getrusage03 0 TINFO : child.self = 156576
|
||||
getrusage03 4 TPASS : initial.self + 50MB ~= child.self
|
||||
getrusage03 0 TINFO : Testcase #04: grandchild maxrss
|
||||
getrusage03 0 TINFO : initial.children = 156576
|
||||
getrusage03_child 0 TINFO : grandchild allocate 300MB
|
||||
getrusage03 0 TINFO : post_wait.children = 310120
|
||||
getrusage03 5 TPASS : child.children ~= 300MB
|
||||
getrusage03 0 TINFO : Testcase #05: zombie
|
||||
getrusage03 0 TINFO : initial.children = 310120
|
||||
getrusage03_child 0 TINFO : child allocate 400MB
|
||||
getrusage03 0 TINFO : pre_wait.children = 310120
|
||||
getrusage03 6 TPASS : initial.children ~= pre_wait.children
|
||||
getrusage03 0 TINFO : post_wait.children = 412092
|
||||
getrusage03 7 TPASS : post_wait.children ~= 400MB
|
||||
getrusage03 0 TINFO : Testcase #06: SIG_IGN
|
||||
getrusage03 0 TINFO : initial.children = 412092
|
||||
getrusage03_child 0 TINFO : child allocate 500MB
|
||||
getrusage03 0 TINFO : after_zombie.children = 412092
|
||||
getrusage03 8 TPASS : initial.children ~= after_zombie.children
|
||||
getrusage03 0 TINFO : Testcase #07: exec without fork
|
||||
getrusage03 0 TINFO : initial.self = 103340, initial.children = 412092
|
||||
getrusage03_child 0 TINFO : exec.self = 103340, exec.children = 412092
|
||||
getrusage03_child 1 TPASS : initial.self ~= exec.self
|
||||
getrusage03_child 2 TPASS : initial.children ~= exec.children
|
||||
*** C1221T04: getrusage03 PASS (10)
|
||||
getrusage04 0 TINFO : Expected timers granularity is 1000 us
|
||||
getrusage04 0 TINFO : Using 1 as multiply factor for max [us]time increment (1000+1000us)!
|
||||
getrusage04 0 TINFO : utime: 377us; stime: 4205us
|
||||
getrusage04 0 TINFO : utime: 379us; stime: 4218us
|
||||
getrusage04 0 TINFO : utime: 381us; stime: 4302us
|
||||
getrusage04 0 TINFO : utime: 383us; stime: 4314us
|
||||
getrusage04 0 TINFO : utime: 385us; stime: 4325us
|
||||
getrusage04 0 TINFO : utime: 387us; stime: 4358us
|
||||
getrusage04 0 TINFO : utime: 388us; stime: 4416us
|
||||
getrusage04 0 TINFO : utime: 390us; stime: 4428us
|
||||
getrusage04 0 TINFO : utime: 392us; stime: 4440us
|
||||
getrusage04 0 TINFO : utime: 393us; stime: 4451us
|
||||
getrusage04 0 TINFO : utime: 395us; stime: 4467us
|
||||
getrusage04 0 TINFO : utime: 397us; stime: 4525us
|
||||
getrusage04 0 TINFO : utime: 399us; stime: 4537us
|
||||
getrusage04 0 TINFO : utime: 400us; stime: 4549us
|
||||
getrusage04 0 TINFO : utime: 402us; stime: 4563us
|
||||
getrusage04 0 TINFO : utime: 404us; stime: 4579us
|
||||
getrusage04 0 TINFO : utime: 405us; stime: 4600us
|
||||
getrusage04 0 TINFO : utime: 407us; stime: 4630us
|
||||
getrusage04 0 TINFO : utime: 409us; stime: 4646us
|
||||
getrusage04 0 TINFO : utime: 410us; stime: 4661us
|
||||
getrusage04 0 TINFO : utime: 412us; stime: 4688us
|
||||
getrusage04 1 TPASS : Test Passed
|
||||
*** C1221T05: getrusage04 PASS (1)
|
||||
bash-4.2$ exit
|
||||
exit
|
||||
|
||||
Script done on Sun Sep 22 15:26:13 2019
|
||||
13
test/issues/1221/Makefile
Normal file
13
test/issues/1221/Makefile
Normal file
@ -0,0 +1,13 @@
|
||||
CC = gcc
|
||||
TARGET = C1221T01
|
||||
|
||||
all:: $(TARGET)
|
||||
|
||||
C1221T01: C1221T01.c
|
||||
$(CC) -g -Wall -o $@ $^
|
||||
|
||||
test:: all
|
||||
sh ./C1221.sh
|
||||
|
||||
clean::
|
||||
rm -f $(TARGET) *.o
|
||||
35
test/issues/1221/README
Normal file
35
test/issues/1221/README
Normal file
@ -0,0 +1,35 @@
|
||||
【Issue#1221 動作確認】
|
||||
□ テスト内容
|
||||
1. Issue 指摘事項の再現確認
|
||||
以下のパッチ (C1221.patch) を McKernel に適用し、システムコール中に時間が
|
||||
掛かる割り込み処理を起動することでシステム時間に割り込み処理の時間が加算
|
||||
されていることを確認する。
|
||||
* 以下の処理を行うテスト用システムコールを追加する
|
||||
- 特定の割り込みベクタに対して起動する割り込みハンドラを登録する
|
||||
- 自CPUに登録した割り込みベクタを送信する
|
||||
- 登録した割り込みハンドラを削除する
|
||||
* 割り込みハンドラは時間が掛かる処理 (x86_64で0.2秒程度) を行う
|
||||
このパッチ適用カーネルを使ってテストする。
|
||||
|
||||
C1221T01 時間が掛かる割り込み処理を行ってシステム時間が増加していることを
|
||||
確認するプログラムを実行し、PASS すること
|
||||
|
||||
2. LTP を用いて既存処理に影響しないことを確認
|
||||
CPU時間関連の処理を変更したため、関連するシステムコールのテストを選定した。
|
||||
C1221T02 getrusage01: getrusage の基本機能の確認
|
||||
C1221T03 getrusage02: getrusage の基本機能の確認
|
||||
C1221T04 getrusage03: getrusage の基本機能の確認
|
||||
C1221T05 getrusage04: getrusage の基本機能の確認
|
||||
|
||||
□ 実行手順
|
||||
$ make test
|
||||
|
||||
McKernelのインストール先や LTP の配置場所は、$HOME/.mck_test_config を
|
||||
参照する。.mck_test_config は、McKernel をビルドした際に生成される
|
||||
mck_test_config.sample ファイルを $HOME にコピーし、適宜編集すること。
|
||||
|
||||
尚、テスト実行には C1221.patch を適用した McKernel を使用すること。
|
||||
|
||||
□ 実行結果
|
||||
C1221_x86_64.txt(x86_64実行結果)、C1221_arm64.txt(arm64実行結果) 参照。
|
||||
全ての項目が PASS していることを確認。
|
||||
137
test/issues/452/C452_arm64.txt
Normal file
137
test/issues/452/C452_arm64.txt
Normal file
@ -0,0 +1,137 @@
|
||||
Script started on Thu 26 Sep 2019 10:31:51 AM JST
|
||||
gcc -g -Wall -o C452T01 C452T01.c
|
||||
sh ./C452.sh
|
||||
mcstop+release.sh ... done
|
||||
mcreboot.sh -c 1-6,29-34 -m 50G@0,50G@1 -r 1-6:0+29-34:28 -O ... done
|
||||
*** C452T01 test start
|
||||
000000400000-000000410000 r-xs 0 0:0 0
|
||||
000000410000-000000420000 r--s 0 0:0 0
|
||||
000000420000-000000430000 rw-s 0 0:0 0
|
||||
080000000000-080000020000 r-xs 0 0:0 0
|
||||
080000020000-080000030000 r--s 0 0:0 0
|
||||
080000030000-080000040000 rw-s 0 0:0 0
|
||||
0ffffffe0000-100000000000 rw-p 0 0:0 0
|
||||
100000000000-100000010000 r--s 0 0:0 0 [vsyscall]
|
||||
100000010000-100000020000 r-xs 0 0:0 0 [vdso]
|
||||
100000040000-1000001b0000 r-xp 0 0:0 0 /usr/lib64/libc-2.17.so
|
||||
1000001b0000-1000001c0000 r--p 0 0:0 0 /usr/lib64/libc-2.17.so
|
||||
1000001c0000-1000001d0000 rw-p 0 0:0 0 /usr/lib64/libc-2.17.so
|
||||
1000001d0000-1000001e0000 rw-p 0 0:0 0
|
||||
3fffff800000-400000000000 rw-p 0 0:0 0 [stack]
|
||||
*** C452T01 PASS
|
||||
mmap01 1 TPASS : Functionality of mmap() successful
|
||||
*** C452T02: mmap01 PASS (1)
|
||||
mmap02 1 TPASS : Functionality of mmap() successful
|
||||
*** C452T03: mmap02 PASS (1)
|
||||
mmap03 1 TPASS : mmap() functionality is correct
|
||||
*** C452T04: mmap03 PASS (1)
|
||||
mmap04 1 TPASS : Functionality of mmap() successful
|
||||
*** C452T05: mmap04 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
mmap12.c:103: INFO: All pages are present
|
||||
mmap12.c:127: PASS: File mapped properly
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C452T06: mmap12 PASS (0)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
brk01.c:67: PASS: brk() works fine
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C452T07: brk01 PASS (0)
|
||||
fork01 1 TPASS : fork() returned 9892
|
||||
fork01 2 TPASS : child pid and fork() return agree: 9892
|
||||
*** C452T08: fork01 PASS (2)
|
||||
fork02 0 TINFO : Inside parent
|
||||
fork02 0 TINFO : exit status of wait 0
|
||||
fork02 1 TPASS : test 1 PASSED
|
||||
*** C452T09: fork02 PASS (1)
|
||||
fork03 0 TINFO : process id in parent of child from fork : 9979
|
||||
fork03 1 TPASS : test 1 PASSED
|
||||
*** C452T10: fork03 PASS (1)
|
||||
mremap04 1 TPASS : mremap() failed, 'MREMAP_MAYMOVE flag unset', errno 12
|
||||
*** C452T11: mremap04 PASS (1)
|
||||
mremap05 1 TPASS : MREMAP_FIXED requires MREMAP_MAYMOVE
|
||||
mremap05 2 TPASS : new_addr has to be page aligned
|
||||
mremap05 3 TPASS : old/new area must not overlap
|
||||
mremap05 4 TPASS : mremap #1
|
||||
mremap05 5 TPASS : mremap #1 value OK
|
||||
mremap05 6 TPASS : mremap #2
|
||||
mremap05 7 TPASS : mremap #2 value OK
|
||||
*** C452T12: mremap05 PASS (7)
|
||||
munmap01 1 TPASS : Functionality of munmap() successful
|
||||
*** C452T13: munmap01 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
shmat01.c:147: PASS: shmat() succeeded to attach NULL address
|
||||
shmat01.c:147: PASS: shmat() succeeded to attach aligned address
|
||||
shmat01.c:147: PASS: shmat() succeeded to attach unaligned address with SHM_RND
|
||||
shmat01.c:147: PASS: shmat() succeeded to attach aligned address with SHM_READONLY, and got SIGSEGV on write
|
||||
|
||||
Summary:
|
||||
passed 4
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C452T14: shmat01 PASS (0)
|
||||
shmdt01 1 TPASS : shared memory detached correctly
|
||||
*** C452T15: shmdt01 PASS (1)
|
||||
mlock01 1 TPASS : mlock passed
|
||||
mlock01 2 TPASS : mlock passed
|
||||
mlock01 3 TPASS : mlock passed
|
||||
mlock01 4 TPASS : mlock passed
|
||||
*** C452T16: mlock01 PASS (4)
|
||||
mlock04 0 TINFO : locked 40960 bytes from 0x1000001d0000
|
||||
mlock04 1 TPASS : test succeeded.
|
||||
*** C452T17: mlock04 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
execve01_child.c:46: PASS: execve01_child executed
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C452T18: execve01 PASS (0)
|
||||
exit01 1 TPASS : exit() test PASSED
|
||||
*** C452T19: exit01 PASS (1)
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
exit02.c:59: PASS: File written by child read back correctly
|
||||
|
||||
Summary:
|
||||
passed 1
|
||||
failed 0
|
||||
skipped 0
|
||||
warnings 0
|
||||
*** C452T20: exit02 PASS (0)
|
||||
exit_group01 1 TPASS : exit_group() succeeded
|
||||
*** C452T21: exit_group01 PASS (1)
|
||||
mprotect02 1 TPASS : got SIGSEGV as expected
|
||||
mprotect02 2 TPASS : didn't get SIGSEGV
|
||||
*** C452T22: mprotect02 PASS (2)
|
||||
mprotect03 0 TINFO : received signal: SIGSEGV
|
||||
mprotect03 1 TPASS : SIGSEGV generated as expected
|
||||
*** C452T23: mprotect03 PASS (1)
|
||||
msync01 1 TPASS : Functionality of msync() successful
|
||||
*** C452T24: msync01 PASS (1)
|
||||
msync02 1 TPASS : Functionality of msync successful
|
||||
*** C452T25: msync02 PASS (1)
|
||||
munlock01 1 TPASS : test 0 passed length = 1
|
||||
munlock01 2 TPASS : test 1 passed length = 1024
|
||||
munlock01 3 TPASS : test 2 passed length = 1048576
|
||||
munlock01 4 TPASS : test 3 passed length = 10485760
|
||||
*** C452T26: munlock01 PASS (4)
|
||||
remap_file_pages01 1 TPASS : Non-Linear shm file OK
|
||||
remap_file_pages01 2 TPASS : Non-Linear /tmp/ file OK
|
||||
*** C452T27: remap_file_pages01 PASS (2)
|
||||
remap_file_pages01 1 TPASS : Non-Linear shm file OK
|
||||
remap_file_pages01 2 TPASS : Non-Linear /tmp/ file OK
|
||||
*** C452T28: remap_file_pages01 PASS (2)
|
||||
|
||||
Script done on Thu 26 Sep 2019 10:32:32 AM JST
|
||||
@ -32,5 +32,5 @@ mck_test_config.sample ファイルを $HOME にコピーし、適宜編集す
|
||||
尚、テスト実行には C452.patch を適用した McKernel を使用すること。
|
||||
|
||||
□ 実行結果
|
||||
C452.txt 参照。
|
||||
C452_x86_64.txt(x86_64実行結果)、C452_arm64.txt(arm64実行結果) 参照。
|
||||
全ての項目が PASS していることを確認。
|
||||
|
||||
Reference in New Issue
Block a user