All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] syscalls: shift to time() if __NR_time not support
Date: Tue, 24 Nov 2020 18:24:42 +0800	[thread overview]
Message-ID: <5FBCDF6A.8050704@cn.fujitsu.com> (raw)
In-Reply-To: <CAEemH2eiTQMBA6g1BOeDNx+H81Yk6FvZt_0AonRY7zdpc0K14w@mail.gmail.com>

Hi Li
> Hi Xu,
>
> Yang Xu <xuyang2018.jy@cn.fujitsu.com
> <mailto:xuyang2018.jy@cn.fujitsu.com>> wrote:
>
>     I have seen this patchset, Can we use a function to check whether
>     kernel
>
>
> Yes, we can, I was even thinking to define a global MACRO can check
> any syscall not only __NR_time.
> (maybe we can achieve it for other tests)
> But for this kind of case, I'd not suggest using that MACRO/function
> to check __NR_time, because the test will perform twice at the moment
> for the __NR_time syscall if it supporting(first time for support checking,
> second time for real invoking).
>
> Considering this is a time comparing test, that makes our seconds
> more inaccurate to compare.
>
>     supports time syscall (like time_supported_by_kernel()) in setup
>     and then we use time() - !return value in verify funtion?
>
>
> Though we check the syscall in setup(), shouldn't we also export a variable
> to record the result we checked? That does not make things be simple too.
Yes. On some platform(aarch64), it is simple because it doesn't need to 
call tst_syscall two times and  time() two times and report non-support 
info many times especailly when using -i parameters.

IMO, it is a taste perference(I usually detect kernel whether support in 
setup). Your patchset is also ok. So

Acked-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>

>
> --
> Regards,
> Li Wang




  reply	other threads:[~2020-11-24 10:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23  8:31 [LTP] [PATCH 1/2] syscalls: avoid time() using __cvdso_gettimeofday in use-level's VDSO Li Wang
2020-11-23  8:31 ` [LTP] [PATCH 2/2] syscalls: shift to time() if __NR_time not support Li Wang
2020-11-24  2:56   ` Yang Xu
2020-11-24  7:57     ` Li Wang
2020-11-24 10:24       ` Yang Xu [this message]
2020-11-24 15:38 ` [LTP] [PATCH 1/2] syscalls: avoid time() using __cvdso_gettimeofday in use-level's VDSO Cyril Hrubis
2020-11-25 11:32   ` Thomas Gleixner
2020-11-25 11:32     ` [LTP] " Thomas Gleixner
2020-11-25 12:35     ` Cyril Hrubis
2020-11-25 12:35       ` [LTP] " Cyril Hrubis
2020-11-26 11:36     ` Vincenzo Frascino
2020-11-26 11:36       ` [LTP] " Vincenzo Frascino

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=5FBCDF6A.8050704@cn.fujitsu.com \
    --to=xuyang2018.jy@cn.fujitsu.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.