All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/2] doc: support for clickable syscalls under stats
Date: Thu, 12 Dec 2024 14:34:55 +0100	[thread overview]
Message-ID: <20241212133455.GB1476154@pevik> (raw)
In-Reply-To: <20241212-doc_syscalls_link-v1-2-69a916958ba9@suse.com>

Hi Andrea,

TL;DR

Reviewed-by: Petr Vorel <pvorel@suse.cz>

I'm glad that my original idea to have links did not get lost :).

> From: Andrea Cervesato <andrea.cervesato@suse.com>

> Under statistics tab, add possibility to click on a syscalls and
> being redirected to the source code which is testing them.

> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  doc/conf.py | 120 ++++++++++++++++++++++++++++++++++--------------------------
>  1 file changed, 69 insertions(+), 51 deletions(-)

> diff --git a/doc/conf.py b/doc/conf.py
> index 1c6a7f74c9401842c01f33dd34a5171d5328248c..258a1b9e285581e40c03caaf643e295fb90cb0c5 100644
> --- a/doc/conf.py
> +++ b/doc/conf.py
> @@ -61,39 +61,38 @@ def generate_syscalls_stats(_):
>      # because in some cases (i.e. io_ring) syscalls are tested, but they are
>      # part of a more complex scenario. In the following list, we define syscalls
>      # which we know they are 100% tested already.
> -    white_list = [
> -        'epoll_pwait2',
> -        'fadvise64',
> -        'fanotify_init',
> -        'fanotify_mark',
> -        'getdents64',
> -        'getmsg',
> -        'getpmsg',

You removed getmsg, getpmsg, putmsg and seccomp.

I originally put them in my patch to black_list (or I wanted)
https://patchwork.ozlabs.org/project/ltp/patch/20241115033916.1707627-1-petr.vorel@gmail.com/

You haven't noticed you removed them (ok, not everything must be documented),
but still it would be nice to remove them from "Untested syscalls" table,
therefore I sent v2.
https://patchwork.ozlabs.org/project/ltp/patch/20241212133024.1480177-1-pvorel@suse.cz/

> -        'inotify_add_watch',
> -        'inotify_rm_watch',
> -        'io_uring_enter',
> -        'io_uring_register',
> -        'io_uring_setup',
> -        'landlock_add_rule',
> -        'landlock_create_ruleset',
> -        'landlock_restrict_self',
> -        'lsetxattr',
> -        'newfstatat',
> -        'putmsg',
> -        'putpmsg',
> -        'pkey_alloc',
> -        'pkey_free',
> -        'pkey_mprotect',
> -        'prlimit64',
> -        'pread64',
> -        'pselect6',
> -        'pwrite64',
> -        'quotactl_fd',
> -        'rt_sigpending',
> -        'seccomp',
> -        'semtimedop',
> -        'sethostname',
> -    ]
> +    ltp_syscalls_path = "testcases/kernel/syscalls"
> +    white_list = {
> +        'bpf': f'{ltp_syscalls_path}/bpf',
> +        'epoll_pwait2': f'{ltp_syscalls_path}/epoll_pwait',
> +        'fadvise64': f'{ltp_syscalls_path}/fadvise',
> +        'fanotify_init': f'{ltp_syscalls_path}/fanotify',
> +        'fanotify_mark': f'{ltp_syscalls_path}/fanotify',
> +        'futex': f'{ltp_syscalls_path}/futex',
> +        'getdents64': f'{ltp_syscalls_path}/gettdents',
> +        'inotify_add_watch': f'{ltp_syscalls_path}/inotify',
> +        'inotify_init': f'{ltp_syscalls_path}/inotify',
> +        'inotify_rm_watch': f'{ltp_syscalls_path}/inotify',
> +        'io_uring_enter': f'{ltp_syscalls_path}/io_uring',
> +        'io_uring_register': f'{ltp_syscalls_path}/io_uring',
> +        'io_uring_setup': f'{ltp_syscalls_path}/io_uring',
> +        'landlock_add_rule': f'{ltp_syscalls_path}/landlock',
> +        'landlock_create_ruleset': f'{ltp_syscalls_path}/landlock',
> +        'landlock_restrict_self': f'{ltp_syscalls_path}/landlock',
> +        'lsetxattr': f'{ltp_syscalls_path}/lgetxattr',
> +        'newfstatat': f'{ltp_syscalls_path}/fstatat',
> +        'pkey_alloc': f'{ltp_syscalls_path}/pkeys',
> +        'pkey_free': f'{ltp_syscalls_path}/pkeys',
> +        'pkey_mprotect': f'{ltp_syscalls_path}/pkeys',
> +        'prlimit64': f'{ltp_syscalls_path}/getrlimit',
> +        'pread64': f'{ltp_syscalls_path}/pread',
> +        'pselect6': f'{ltp_syscalls_path}/pselect',
> +        'pwrite64': f'{ltp_syscalls_path}/pwrite',
> +        'quotactl_fd': f'{ltp_syscalls_path}/quotactl',
> +        'rt_sigpending': f'{ltp_syscalls_path}/sigpending',
> +        'semtimedop': f'{ltp_syscalls_path}/ipc/semop',
> +        'sethostname': f'{ltp_syscalls_path}/sethostname'
> +    }

>      # populate with not implemented, reserved, unmaintained syscalls defined
>      # inside the syscalls file
> @@ -134,6 +133,7 @@ def generate_syscalls_stats(_):
>      if error:
>          return

> +    syscalls_base_dir = "https://github.com/linux-test-project/ltp/tree/master"
nit: we already have some variables for various https://github.com/linux-test-project/ltp
paths. I would personally define at the top variable holding
"https://github.com/linux-test-project/ltp" and deriver others from it
(as a separate commit or a part of previous commit).


>      text = [
>          'Syscalls\n',
>          '--------\n\n',
> @@ -145,15 +145,33 @@ def generate_syscalls_stats(_):
>      with open("syscalls.tbl", 'r', encoding='utf-8') as data:
>          for line in data:
>              match = regexp.search(line)
> -            if match:
> -                ker_syscalls.append(match.group('syscall'))
> +            if not match:
> +                continue
> +
> +            ker_syscalls.append(match.group('syscall'))

>      # collect all LTP tested syscalls
> -    ltp_syscalls = []
> -    for _, _, files in os.walk('../testcases/kernel/syscalls'):
> +    name_patterns = [
> +        re.compile(r'(?P<name>[a-zA-Z_]+[^_])\d{2}\.c'),
> +        re.compile(r'(?P<name>[a-zA-Z_]+[1-9])_\d{2}\.c'),

Using regexp is probably better than my way to set paths (fewer things to
maintain).

Thanks!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-12-12 13:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 10:33 [LTP] [PATCH 0/2] doc: support for links in syscalls Andrea Cervesato
2024-12-12 10:33 ` [LTP] [PATCH 1/2] doc: cleanup conf.py script Andrea Cervesato
2024-12-12 12:59   ` Petr Vorel
2024-12-12 10:33 ` [LTP] [PATCH 2/2] doc: support for clickable syscalls under stats Andrea Cervesato
2024-12-12 13:34   ` Petr Vorel [this message]
2024-12-12 14:02     ` Andrea Cervesato via ltp
2024-12-12 14:13 ` [LTP] [PATCH 0/2] doc: support for links in syscalls Andrea Cervesato via ltp

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=20241212133455.GB1476154@pevik \
    --to=pvorel@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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.