All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V2 06/17] syscalls/futex: Add support for time64 tests
Date: Sat, 9 May 2020 17:02:35 +0800	[thread overview]
Message-ID: <CAEemH2f8fQ58f_sJBkF4j2gnRORYm28g5Bzy21TF_M_wKuANUg@mail.gmail.com> (raw)
In-Reply-To: <5432ab11234b37bf7f46db7c1a624a432c8aedf3.1588911607.git.viresh.kumar@linaro.org>

On Fri, May 8, 2020 at 12:27 PM Viresh Kumar <viresh.kumar@linaro.org>
wrote:

> This adds support for time64 tests to the existing futex() syscall
> tests.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> ---
>  include/tst_timer.h                           |  12 ++
>  .../syscalls/futex/futex_cmp_requeue01.c      |  35 +++-
>  .../syscalls/futex/futex_cmp_requeue02.c      |  25 ++-
>  testcases/kernel/syscalls/futex/futex_utils.h |  52 ++++--
>  .../kernel/syscalls/futex/futex_wait01.c      |  83 +++++-----
>  .../kernel/syscalls/futex/futex_wait02.c      | 104 ++++++------
>  .../kernel/syscalls/futex/futex_wait03.c      |  91 +++++------
>  .../kernel/syscalls/futex/futex_wait04.c      |  85 +++++-----
>  .../kernel/syscalls/futex/futex_wait05.c      |   2 +-
>  .../syscalls/futex/futex_wait_bitset01.c      |  50 ++++--
>  .../kernel/syscalls/futex/futex_wake01.c      |  71 ++++-----
>  .../kernel/syscalls/futex/futex_wake02.c      |  99 ++++++------
>  .../kernel/syscalls/futex/futex_wake03.c      | 111 +++++++------
>  .../kernel/syscalls/futex/futex_wake04.c      | 150 +++++++++---------
>  testcases/kernel/syscalls/futex/futextest.h   | 111 ++++++++-----
>  15 files changed, 609 insertions(+), 472 deletions(-)
>
> diff --git a/include/tst_timer.h b/include/tst_timer.h
> index a726298b407d..b4280042c77f 100644
> --- a/include/tst_timer.h
> +++ b/include/tst_timer.h
> @@ -243,6 +243,18 @@ static inline int sys_clock_nanosleep64(clockid_t
> clk_id, int flags,
>                            request, remain);
>  }
>
> +static inline int sys_futex(int *uaddr, int futex_op, int val, void *to,
> +                           int *uaddr2, int val3)
> +{
> +       return tst_syscall(__NR_futex, uaddr, futex_op, val, to, uaddr2,
> val3);
> +}
> +
> +static inline int sys_futex_time64(int *uaddr, int futex_op, int val,
> void *to,
> +                                  int *uaddr2, int val3)
> +{
> +       return tst_syscall(__NR_futex_time64, uaddr, futex_op, val, to,
> uaddr2, val3);
> +}
> +
>  static inline int libc_sched_rr_get_interval(pid_t pid, void *ts)
>  {
>         return sched_rr_get_interval(pid, ts);
> diff --git a/testcases/kernel/syscalls/futex/futex_cmp_requeue01.c
> b/testcases/kernel/syscalls/futex/futex_cmp_requeue01.c
> index c50fade9f969..bc9d2a6bee37 100644
> --- a/testcases/kernel/syscalls/futex/futex_cmp_requeue01.c
> +++ b/testcases/kernel/syscalls/futex/futex_cmp_requeue01.c
> @@ -18,6 +18,7 @@
>  #include "tst_timer_test.h"
>  #include "tst_test.h"
>  #include "futextest.h"
> +#include "lapi/abisize.h"
>
>  struct shared_data {
>         futex_t futexes[2];
> @@ -42,14 +43,33 @@ static struct tcase {
>         {1000, 300, 500},
>  };
>
> +static struct test_variants {
> +       enum futex_fn_type fntype;
> +       enum tst_ts_type tstype;
> +       char *desc;
> +} variants[] = {
> +#if defined(TST_ABI32)
> +       { .fntype = FUTEX_FN_FUTEX, .tstype = TST_KERN_OLD_TIMESPEC, .desc
> = "syscall with kernel spec32"},
> +#endif
> +
> +#if defined(TST_ABI64)
> +       { .fntype = FUTEX_FN_FUTEX, .tstype = TST_KERN_TIMESPEC, .desc =
> "syscall with kernel spec64"},
> +#endif
> +
> +#if (__NR_futex_time64 != __LTP__NR_INVALID_SYSCALL)
>

This might not safe to use it directly if only check __NR_futex_time64 being
defined. i.e Test it on the platform without achieving the system
syscall(but
define __NR_futex_time64), the test children exit with TCONF will cause
kind of issues.


RHEL-8.2(ppc64le) failed as:
--------------------------------------

tag=futex_cmp_requeue01 stime=1588947939
cmdline="futex_cmp_requeue01"
contacts=""
analysis=exit
<<<test_output>>>
tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
futex_cmp_requeue01.c:202: INFO: Testing variant: syscall with kernel spec64
futex_cmp_requeue01.c:114: INFO: Test 0: waiters: 10, wakes: 3, requeues: 7
futex_cmp_requeue01.c:136: INFO: futex_cmp_requeue() returned 10
futex_cmp_requeue01.c:152: INFO: children woken, futex0: 0, futex1: 7,
spurious wakeups: 0
futex_cmp_requeue01.c:197: PASS: futex_cmp_requeue()
futex_cmp_requeue01.c:114: INFO: Test 1: waiters: 10, wakes: 0, requeues: 10
futex_cmp_requeue01.c:136: INFO: futex_cmp_requeue() returned 10
futex_cmp_requeue01.c:152: INFO: children woken, futex0: 0, futex1:
10, spurious wakeups: 0
futex_cmp_requeue01.c:197: PASS: futex_cmp_requeue()
futex_cmp_requeue01.c:114: INFO: Test 2: waiters: 10, wakes: 2, requeues: 6
...
futex_cmp_requeue01.c:152: INFO: children woken, futex0: 200, futex1:
500, spurious wakeups: 0
futex_cmp_requeue01.c:197: PASS: futex_cmp_requeue()
tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
futex_cmp_requeue01.c:202: INFO: Testing variant: syscall time64 with
kernel spec64
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
...
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
Test timeouted, sending SIGKILL!
tst_test.c:1286: INFO: If you are running on slow machine, try
exporting LTP_TIMEOUT_MUL > 1
tst_test.c:1287: BROK: Test killed! (timeout?)


cmdline="futex_wake02"
contacts=""
analysis=exit
<<<test_output>>>
tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
futex_wake02.c:155: INFO: Testing variant: syscall with kernel spec64
futex_wake02.c:105: PASS: futex_wake() woken up 1 threads
futex_wake02.c:105: PASS: futex_wake() woken up 2 threads
futex_wake02.c:105: PASS: futex_wake() woken up 3 threads
futex_wake02.c:105: PASS: futex_wake() woken up 4 threads
futex_wake02.c:105: PASS: futex_wake() woken up 5 threads
futex_wake02.c:105: PASS: futex_wake() woken up 6 threads
futex_wake02.c:105: PASS: futex_wake() woken up 7 threads
futex_wake02.c:105: PASS: futex_wake() woken up 8 threads
futex_wake02.c:105: PASS: futex_wake() woken up 9 threads
futex_wake02.c:105: PASS: futex_wake() woken up 10 threads
futex_wake02.c:118: PASS: futex_wake() woken up 0 threads
tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
futex_wake02.c:155: INFO: Testing variant: syscall time64 with kernel spec64
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
tst_test.c:1063: BROK: Test haven't reported results!


futex_wake03.c:111: INFO: Testing variant: syscall with kernel spec64
futex_wake03.c:71: PASS: futex_wake() woken up 1 childs
futex_wake03.c:71: PASS: futex_wake() woken up 2 childs
futex_wake03.c:71: PASS: futex_wake() woken up 3 childs
futex_wake03.c:71: PASS: futex_wake() woken up 4 childs
futex_wake03.c:71: PASS: futex_wake() woken up 5 childs
futex_wake03.c:71: PASS: futex_wake() woken up 6 childs
futex_wake03.c:71: PASS: futex_wake() woken up 7 childs
futex_wake03.c:71: PASS: futex_wake() woken up 8 childs
futex_wake03.c:71: PASS: futex_wake() woken up 9 childs
futex_wake03.c:71: PASS: futex_wake() woken up 10 childs
futex_wake03.c:105: PASS: futex_wake() woken up 0 children
tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
futex_wake03.c:111: INFO: Testing variant: syscall time64 with kernel spec64
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported...
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
Test timeouted, sending SIGKILL!
tst_test.c:1286: INFO: If you are running on slow machine, try
exporting LTP_TIMEOUT_MUL > 1
tst_test.c:1287: BROK: Test killed! (timeout?)


cmdline="futex_wake04"
contacts=""
analysis=exit
<<<test_output>>>
tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
futex_wake04.c:69: INFO: Testing variant: syscall with kernel spec64
futex_wake04.c:142: INFO: Hugepagesize 16777216
futex_wake04.c:127: PASS: Hi hydra, thread2 awake!
tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
futex_wake04.c:69: INFO: Testing variant: syscall time64 with kernel spec64
futex_wake04.c:142: INFO: Hugepagesize 16777216
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
../../../../include/tst_timer.h:256: CONF: syscall(422)
__NR_futex_time64 not supported
futex_wake04.c:129: FAIL: Bug: wait_thread2 did not wake after 30
secs.: SUCCESS (0)


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200509/a0d436a4/attachment-0001.htm>

  reply	other threads:[~2020-05-09  9:02 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  4:23 [LTP] [PATCH V2 00/17] Syscalls: Add support for time64 variants Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 01/17] syscalls/timer_gettime: Add support for time64 tests Viresh Kumar
2020-05-08  8:30   ` Arnd Bergmann
2020-05-08  4:23 ` [LTP] [PATCH V2 02/17] syscalls/timer_settime: " Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 03/17] syscalls/timerfd: " Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 04/17] syscalls/sched_rr_get_interval: " Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 05/17] syscalls/futex: Merge futex_wait_bitset tests Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 06/17] syscalls/futex: Add support for time64 tests Viresh Kumar
2020-05-09  9:02   ` Li Wang [this message]
2020-05-11 11:08     ` Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 07/17] syscalls/io_pgetevents: " Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 08/17] syscalls/sigwaitinfo: Migrate to new test framework Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 09/17] syscalls/rt_sigtimedwait: Add support for time64 tests Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 10/17] syscalls/mq_timed{send|receive}: " Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 11/17] syscalls/recvmmsg: " Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 12/17] syscalls/ppoll: " Viresh Kumar
2020-05-08  4:23 ` [LTP] [PATCH V2 13/17] syscalls/select6: " Viresh Kumar
2020-05-08  7:21   ` Arnd Bergmann
2020-05-08  4:23 ` [LTP] [PATCH V2 14/17] syscalls/semop: Migrate to new test framework Viresh Kumar
2020-05-08  4:24 ` [LTP] [PATCH V2 15/17] syscalls/semtimedop: Add support for semtimedop and its time64 version Viresh Kumar
2020-05-08  7:18   ` Arnd Bergmann
2020-05-08  8:56     ` Viresh Kumar
2020-05-08  9:24       ` Arnd Bergmann
2020-05-11  5:44         ` Viresh Kumar
2020-05-11  6:49     ` Viresh Kumar
2020-05-11  7:20       ` Arnd Bergmann
2020-05-11  7:33         ` Viresh Kumar
2020-05-11  7:58           ` Arnd Bergmann
2020-05-11 11:23             ` Viresh Kumar
2020-05-09  4:21   ` Li Wang
2020-05-11 10:43     ` Viresh Kumar
2020-05-11 12:29       ` Li Wang
2020-05-12  4:19         ` Viresh Kumar
2020-05-08  4:24 ` [LTP] [PATCH V2 16/17] syscalls/utimensat: Migrate to new test framework Viresh Kumar
2020-05-09  3:50   ` Li Wang
2020-05-11  9:33   ` Cyril Hrubis
2020-05-08  4:24 ` [LTP] [PATCH V2 17/17] syscalls/utimensat: Add support for time64 tests Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEemH2f8fQ58f_sJBkF4j2gnRORYm28g5Bzy21TF_M_wKuANUg@mail.gmail.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.