From 072b486393ab702eea9ea0a7fef569dbf8be0a32 Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Fri, 8 Mar 2013 01:25:35 -0500 Subject: uncachedev: uncache test tool. This adds the uncache test tool (bin/uncache.c). The tool can be used to test Litmus's char device driver for allocating uncacheable CPU memory. The tool runs various checks and gathers basic cache vs. main memory statistics. In the future, uncache could be extended to quantify the benefits of the L1, L2, and L3 caches, instead of treating them as a black box. Note: Uncache works best when compiled with '-O2'. While '-O2' has not been added to the Makefile, other code was updated (code in tests/ and rtspin), to compile with -O2. DEPENDS UPON LITMUS-RT PATCH 888d097deb6d1fdc0c89a4f9667fd81cf416cfc7. --- tests/fdso.c | 4 ++-- tests/locks.c | 8 ++++---- tests/pcp.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/fdso.c b/tests/fdso.c index 8a2a0d0..fda343f 100644 --- a/tests/fdso.c +++ b/tests/fdso.c @@ -16,7 +16,7 @@ TESTCASE(fmlp_not_active, C_EDF | PFAIR | LINUX, { int fd; - SYSCALL( fd = open(".fmlp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".fmlp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); ASSERT(fd != -1); @@ -57,7 +57,7 @@ TESTCASE(not_inherit_od, GSN_EDF | PSN_EDF, { int fd, od, pid, status; - SYSCALL( fd = open(".fmlp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".fmlp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); SYSCALL( od = open_fmlp_sem(fd, 0) ); diff --git a/tests/locks.c b/tests/locks.c index d7ebfe2..9a928b3 100644 --- a/tests/locks.c +++ b/tests/locks.c @@ -11,7 +11,7 @@ TESTCASE(not_lock_fmlp_be, GSN_EDF | PSN_EDF | P_FP, { int fd, od; - SYSCALL( fd = open(".fmlp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".fmlp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); SYSCALL( od = open_fmlp_sem(fd, 0) ); @@ -34,7 +34,7 @@ TESTCASE(not_lock_srp_be, PSN_EDF | P_FP, { int fd, od; - SYSCALL( fd = open(".srp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".srp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); /* BE tasks may not open SRP semaphores */ @@ -51,7 +51,7 @@ TESTCASE(lock_srp, PSN_EDF | P_FP, { int fd, od; - SYSCALL( fd = open(".srp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".srp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); SYSCALL( sporadic_partitioned(10, 100, 0) ); SYSCALL( task_mode(LITMUS_RT_TASK) ); @@ -83,7 +83,7 @@ TESTCASE(lock_fmlp, PSN_EDF | GSN_EDF | P_FP, { int fd, od; - SYSCALL( fd = open(".fmlp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".fmlp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); SYSCALL( sporadic_partitioned(10, 100, 0) ); SYSCALL( task_mode(LITMUS_RT_TASK) ); diff --git a/tests/pcp.c b/tests/pcp.c index 52ee959..ff4259c 100644 --- a/tests/pcp.c +++ b/tests/pcp.c @@ -13,7 +13,7 @@ TESTCASE(lock_pcp, P_FP, { int fd, od, cpu = 0; - SYSCALL( fd = open(".pcp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".pcp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); SYSCALL( sporadic_partitioned(10, 100, cpu) ); SYSCALL( task_mode(LITMUS_RT_TASK) ); @@ -250,7 +250,7 @@ TESTCASE(lock_dpcp, P_FP, { int fd, od, cpu = 1; - SYSCALL( fd = open(".pcp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".pcp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); SYSCALL( sporadic_partitioned(10, 100, 0) ); SYSCALL( task_mode(LITMUS_RT_TASK) ); @@ -281,7 +281,7 @@ TESTCASE(not_lock_pcp_be, P_FP, { int fd, od; - SYSCALL( fd = open(".pcp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".pcp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); /* BE tasks are not even allowed to open a PCP semaphore */ SYSCALL_FAILS(EPERM, od = open_pcp_sem(fd, 0, 1) ); @@ -303,7 +303,7 @@ TESTCASE(lock_mpcp, P_FP, { int fd, od; - SYSCALL( fd = open(".pcp_locks", O_RDONLY | O_CREAT) ); + SYSCALL( fd = open(".pcp_locks", O_RDONLY | O_CREAT, S_IRUSR) ); SYSCALL( sporadic_partitioned(10, 100, 0) ); SYSCALL( task_mode(LITMUS_RT_TASK) ); -- cgit v1.2.2