aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-06-08 17:21:22 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-06-08 17:21:22 +0000
commit7c6bfa1255e4a3c18b070fbc4720bc946f498584 (patch)
tree2d118143e496384485e9e24d4ccad5b43b04b312
parent9010f0629929f6ba43b1a326fa25b72729ce200a (diff)
parent4b439ab7ff015caf220ef09f505d65d21f2bfcdf (diff)
downloadltp-7c6bfa1255e4a3c18b070fbc4720bc946f498584.tar.gz
Change-Id: I750be543adafca950551992ddb478e7ec28c0024
-rwxr-xr-xtestcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh1
-rw-r--r--testcases/kernel/syscalls/clock_gettime/clock_gettime04.c18
-rw-r--r--testcases/kernel/syscalls/syscall/syscall01.c8
3 files changed, 25 insertions, 2 deletions
diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
index fc3ad1b63..8c282f287 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
@@ -168,6 +168,7 @@ test8()
# Test that notify_on_release can be changed
test9()
{
+ create_subgroup "$start_path/ltp_1"
local notify=$(ROD cat "$start_path/ltp_1/notify_on_release")
local value
diff --git a/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c b/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
index a8d2c5b38..c279da79e 100644
--- a/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
+++ b/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
@@ -35,7 +35,7 @@ clockid_t clks[] = {
};
static gettime_t ptr_vdso_gettime, ptr_vdso_gettime64;
-static long long delta = 5;
+static long long delta, precise_delta, coarse_delta;
static inline int do_vdso_gettime(gettime_t vdso, clockid_t clk_id, void *ts)
{
@@ -92,9 +92,18 @@ static struct time64_variants variants[] = {
static void setup(void)
{
+ struct timespec res;
+
+ clock_getres(CLOCK_REALTIME, &res);
+ precise_delta = 5 + res.tv_nsec / 1000000;
+
+ clock_getres(CLOCK_REALTIME_COARSE, &res);
+ coarse_delta = 5 + res.tv_nsec / 1000000;
+
if (tst_is_virt(VIRT_ANY)) {
tst_res(TINFO, "Running in a virtual machine, multiply the delta by 10.");
- delta *= 10;
+ precise_delta *= 10;
+ coarse_delta *= 10;
}
find_clock_gettime_vdso(&ptr_vdso_gettime, &ptr_vdso_gettime64);
@@ -108,6 +117,11 @@ static void run(unsigned int i)
int count = 10000, ret;
unsigned int j;
+ if (clks[i] == CLOCK_REALTIME_COARSE || clks[i] == CLOCK_MONOTONIC_COARSE)
+ delta = coarse_delta;
+ else
+ delta = precise_delta;
+
do {
for (j = 0; j < ARRAY_SIZE(variants); j++) {
/* Refresh time in start */
diff --git a/testcases/kernel/syscalls/syscall/syscall01.c b/testcases/kernel/syscalls/syscall/syscall01.c
index 167e6ee86..76e793221 100644
--- a/testcases/kernel/syscalls/syscall/syscall01.c
+++ b/testcases/kernel/syscalls/syscall/syscall01.c
@@ -37,7 +37,11 @@ static void verify_getuid(void)
uid_t u1, u2;
u1 = getuid();
+#ifdef SYS_getuid32
+ u2 = syscall(SYS_getuid32);
+#else
u2 = syscall(SYS_getuid);
+#endif
if (u1 == u2) {
tst_res(TPASS, "getuid() == syscall(SYS_getuid)");
@@ -52,7 +56,11 @@ static void verify_getgid(void)
gid_t g1, g2;
g1 = getgid();
+#ifdef SYS_getgid32
+ g2 = syscall(SYS_getgid32);
+#else
g2 = syscall(SYS_getgid);
+#endif
if (g1 == g2) {
tst_res(TPASS, "getgid() == syscall(SYS_getgid)");