All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V4 06/17] syscalls/futex: Add support for time64 tests
Date: Tue, 9 Jun 2020 20:55:49 +0800	[thread overview]
Message-ID: <CAEemH2fmr+jXW3kZ5LAMrGH0ReHND2jr-TqoSHm9p9WBePtE3g@mail.gmail.com> (raw)
In-Reply-To: <ff8a9eee3642f28a365437c9a42e5126e90bc242.1590144577.git.viresh.kumar@linaro.org>

On Fri, May 22, 2020 at 6:53 PM Viresh Kumar <viresh.kumar@linaro.org>
wrote:

> ...
> diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c
> b/testcases/kernel/syscalls/futex/futex_wake04.c
> index f92bda53f6c7..edbb9c644c57 100644
> --- a/testcases/kernel/syscalls/futex/futex_wake04.c
> +++ b/testcases/kernel/syscalls/futex/futex_wake04.c
> ...
>
>  static void wakeup_thread2(void)
>  {
> +       struct test_variants *tv = &variants[tst_variant];
>         void *addr;
>         int hpsz, pgsz, res;
>         pthread_t th1, th2;
>
>         hpsz = read_hugepagesize();
> -       tst_resm(TINFO, "Hugepagesize %i", hpsz);
> +       tst_res(TINFO, "Hugepagesize %i", hpsz);
>
>         /*allocate some shared memory*/
>         addr = mmap(NULL, hpsz, PROT_WRITE | PROT_READ,
>                     MAP_SHARED | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0);
>
>         if (addr == MAP_FAILED) {
> -               if (errno == ENOMEM) {
> -                       tst_brkm(TCONF, NULL,
> -                                "Cannot allocate hugepage, memory too
> fragmented?");
> -               }
> +               if (errno == ENOMEM)
> +                       tst_res(TCONF, "Cannot allocate hugepage, memory
> too fragmented?");
>

Here we can use tst_brk(TCONF, ...), otherwise, the if condition will out
of action for ENOMEM.

-               tst_brkm(TBROK | TERRNO, NULL, "Cannot allocate hugepage");
> +               tst_res(TFAIL | TERRNO, "Cannot allocate hugepage");
> +               return;
>

tst_brk(TBROK | TERRNO, ...)

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

  reply	other threads:[~2020-06-09 12:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 10:51 [LTP] [PATCH V4 00/17] Syscalls: Add support for time64 variants Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 01/17] syscalls/timer_gettime: Add support for time64 tests Viresh Kumar
2020-06-09 12:32   ` Li Wang
2020-06-10  3:26     ` Viresh Kumar
2020-06-10  3:34   ` [LTP] [PATCH V5 " Viresh Kumar
2020-06-10  3:38   ` [LTP] [PATCH V6 " Viresh Kumar
2020-06-24 14:23     ` Cyril Hrubis
2020-06-25  9:50       ` Viresh Kumar
2020-06-25 11:07         ` Cyril Hrubis
2020-06-25 11:10           ` Viresh Kumar
2020-06-25 11:13             ` Cyril Hrubis
2020-05-22 10:51 ` [LTP] [PATCH V4 02/17] syscalls/timer_settime: " Viresh Kumar
2020-06-24 14:30   ` Cyril Hrubis
2020-06-25  9:56     ` Viresh Kumar
2020-06-25 11:12       ` Cyril Hrubis
2020-05-22 10:51 ` [LTP] [PATCH V4 03/17] syscalls/timerfd: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 04/17] syscalls/sched_rr_get_interval: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 05/17] syscalls/futex: Merge futex_wait_bitset tests Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 06/17] syscalls/futex: Add support for time64 tests Viresh Kumar
2020-06-09 12:55   ` Li Wang [this message]
2020-06-10  3:35   ` [LTP] [PATCH V5 " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 07/17] syscalls/io_pgetevents: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 08/17] syscalls/sigwaitinfo: Migrate to new test framework Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 09/17] syscalls/rt_sigtimedwait: Add support for time64 tests Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 10/17] syscalls/mq_timed{send|receive}: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 11/17] syscalls/recvmmsg: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 12/17] syscalls/ppoll: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 13/17] syscalls/select6: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 14/17] syscalls/semop: Migrate to new test framework Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 15/17] syscalls/semtimedop: Add support for semtimedop and its time64 version Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 16/17] syscalls/utimensat: Migrate to new test framework Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 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=CAEemH2fmr+jXW3kZ5LAMrGH0ReHND2jr-TqoSHm9p9WBePtE3g@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.