diff mbox series

[v9,5/5] Add documentation about syscalls.h generator

Message ID 20241101-generate_syscalls-v9-5-d2c3820b0323@suse.com
State Accepted
Headers show
Series Automatically generate syscalls.h | expand

Commit Message

Andrea Cervesato Nov. 1, 2024, 10:48 a.m. UTC
From: Andrea Cervesato <andrea.cervesato@suse.com>

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 doc/developers/test_case_tutorial.rst | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

Comments

Petr Vorel Nov. 4, 2024, 8:17 a.m. UTC | #1
Hi Andrea,

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

LGTM, thanks!

> diff --git a/doc/developers/test_case_tutorial.rst b/doc/developers/test_case_tutorial.rst
> index be9a0ea8bac1d690b4ed4879d110f87c3f2a381a..97f385e5853a9041ac3e5ded7fb99e8355d84742 100644
> --- a/doc/developers/test_case_tutorial.rst
> +++ b/doc/developers/test_case_tutorial.rst
> @@ -302,24 +302,27 @@ for a distribution's C library version to be older than its kernel or it may use
>  cut down C library in comparison to the GNU one. So we must call ``statx()``
>  using the general ``syscall()`` interface.

> -The LTP contains a library for dealing with the ``syscall`` interface, which is
> +LTP contains a library for dealing with the ``syscall`` interface, which is
very nit: This was added by Richie in 7324ee19de. I also think that the "The"
article should not be there, but I'm surprised that he would make a make a mistake
(native speaker).

Kind regards,
Petr
Cyril Hrubis Nov. 4, 2024, 12:25 p.m. UTC | #2
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
diff mbox series

Patch

diff --git a/doc/developers/test_case_tutorial.rst b/doc/developers/test_case_tutorial.rst
index be9a0ea8bac1d690b4ed4879d110f87c3f2a381a..97f385e5853a9041ac3e5ded7fb99e8355d84742 100644
--- a/doc/developers/test_case_tutorial.rst
+++ b/doc/developers/test_case_tutorial.rst
@@ -302,24 +302,27 @@  for a distribution's C library version to be older than its kernel or it may use
 cut down C library in comparison to the GNU one. So we must call ``statx()``
 using the general ``syscall()`` interface.
 
-The LTP contains a library for dealing with the ``syscall`` interface, which is
+LTP contains a library for dealing with the ``syscall`` interface, which is
 located in :master:`include/lapi`. System call numbers are listed against the relevant
 call in the ``*.in`` files (e.g. ``x86_64.in``) which are used to generate
-``syscalls.h``, which is the header you should include. On rare occasions you
-may find the system call number is missing from the ``*.in`` files and will need
-to add it (see :master:`include/lapi/syscalls/strip_syscall.awk`).
-
+``syscalls.h``, the header you should include.
 System call numbers vary between architectures, hence there are multiple
-``*.in`` files for each architecture. You can find the various values for the
-``statx`` system call across a number of ``unistd.h`` files in the Linux kernel.
+``*.in`` files for each architecture.
+
+On rare occasions, you may find that system call number is missing from ``*.in``
+files. In these cases, they will need to be updated using
+:master:`include/lapi/syscalls/generate_arch.sh` script as following:
+
+.. code-block:: bash
+
+    $ include/lapi/syscalls/generate_arch.sh /path/to/Linux/sources
 
-Note that we don't use the system-call-identifier value available in
-``/usr/include/linux/uinstd.h`` because the kernel might be much newer than the
-user land development packages.
+The script will generate all the needed ``*.in`` files accordingly to the Linux
+source code which has been used. Make sure that your Linux source code has
+been updated to the latest version.
 
-For ``statx`` we had to add ``statx 332`` to :master:`include/lapi/syscalls/x86_64.in`,
-``statx 383`` to :master:`include/lapi/syscalls/powerpc.in`, etc.  Now lets look at
-the code, which I will explain in more detail further down.
+Once the new syscalls files have been updated, to rebuild our ``syscalls.h``
+file, please re-run ``./configure`` script.
 
 .. code-block:: c