Skip to content

Automatically generate syscalls.h

Andrea Cervesato ltp 9 versions – In review

Get series with b4
b4 am [email protected] change-id 20240923-generate_syscalls-780dc2227bdb

Versions newest first

  1. v9 Latest5 patches 8 repliesIn review
  2. v84 patches 6 repliesSuperseded
  3. v74 patches 8 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v63 patches12 repliesSuperseded
v53 patches10 repliesSuperseded
v44 patches15 repliesSuperseded
v34 patches3 repliesSuperseded
v25 patches2 repliesSuperseded
v14 patches7 repliesSuperseded

Changes in v9 from the cover letter

- use of printf when printing "\n" string, in order to support both dash
and bash. BEWARE: ugliness triggered.
- rename *.in files with supported-arch.txt file naming convention
- update *.in files in a separated commit
- update documentation to be more readable
- aesthetic code changes
- Link to v8: https://lore.kernel.org/r/[email protected]

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Refactor regen.sh script to generate syscallsconfigure.ac include/lapi/syscalls/arm64.in include/lapi/syscalls/generate_syscalls.sh +7 more+116 -1360 replies
2/5Add script to generate arch(s) dependant syscallsinclude/lapi/syscalls/generate_arch.sh+213 -03 replies
3/5Update arch(s) syscalls filesinclude/lapi/syscalls/arc.in include/lapi/syscalls/arm.in include/lapi/syscalls/arm64.in +14 more+968 -5562 replies
4/5Delete obsolete strip_syscall.awk fileinclude/lapi/syscalls/strip_syscall.awk+0 -190 replies
5/5Add documentation about syscalls.h generatordoc/developers/test_case_tutorial.rst+16 -132 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchLi WangPetr VorelCyril Hrubis
1/5R-b R-b R-b
2/5R-b R-b R-b
3/5R-b R-b
4/5R-b R-b R-b
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v9 thread

Cover letter [LTP] [PATCH v9 0/5] Automatically generate syscalls.h

The problem we have at the moment is that all syscalls input files must be changed by hand each time we need to test a new syscall. The idea is to simplify this process, providing a script that is able to read from kernel sources and to generate all syscalls files we need.

This patch set adds a new command inside the syscalls folder and it refactors the previous regen.sh code.
The new way we have to generate the syscalls.h file is the following:

include/lapi/syscalls/generate_arch.sh path/to/kernel/source
include/lapi/syscalls/generate_syscalls.sh path/to/syscalls.h

Scripts are independent and they can be run separately. generate_syscalls.sh is the equivalent of regen.sh, but its code has been cleaned up.

---
Changes in v9:
- use of printf when printing "\n" string, in order to support both dash
and bash. BEWARE: ugliness triggered.
- rename *.in files with supported-arch.txt file naming convention
- update *.in files in a separated commit
- update documentation to be more readable
- aesthetic code changes
- Link to v8: https://lore.kernel.org/r/[email protected]

Changes in v8:
- use /bin/sh -eu
- support for dash and removed all bashism madness
- validation: https://github.com/acerv/ltp/actions/runs/11615377438
- Link to v7: https://lore.kernel.org/r/[email protected]

Changes in v7:
- check for errors in generate_syscalls.sh
- add documentation
- validation: https://github.com/acerv/ltp/actions/runs/11611080151
- Link to v6: https://lore.kernel.org/r/[email protected]

Changes in v6:
- aesthetic changes in the syscall generator
- fix fallback definitions in the syscalls.h file generator
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- license SPDX inside scripts files
- quote shell variables inside scripts
- some generic code cleanup
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- remove blacklist file
- update syscalls files
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- fix generate_arch.sh to work properly for all architectures
- rename some arch .in files and handle renaming inside
generate_syscalls.sh using the right gcc directives
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- refactor regen.sh
- split syscalls.h and syscalls .in files creation
- updated syscalls .in files
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Andrea Cervesato (5):
Refactor regen.sh script to generate syscalls Add script to generate arch(s) dependant syscalls Update arch(s) syscalls files
Delete obsolete strip_syscall.awk file Add documentation about syscalls.h generator

 configure.ac                                       |   2 +-
 doc/developers/test_case_tutorial.rst              |  29 +-
 include/lapi/syscalls/arc.in                       |  41 +-
 include/lapi/syscalls/arm.in                       | 821 +++++++++++----------
 include/lapi/syscalls/{loongarch.in => arm64.in}   |  12 +-
 include/lapi/syscalls/generate_arch.sh             | 213 ++++++
 include/lapi/syscalls/generate_syscalls.sh         | 109 +++
 include/lapi/syscalls/hppa.in                      |  54 --
 include/lapi/syscalls/i386.in                      |  18 +-
 .../lapi/syscalls/{aarch64.in => loongarch64.in}   |  20 +-
 include/lapi/syscalls/{mips_n64.in => mips64.in}   |  13 +-
 .../lapi/syscalls/{mips_n32.in => mips64n32.in}    |  13 +-
 include/lapi/syscalls/{mips_o32.in => mipso32.in}  |  19 +-
 include/lapi/syscalls/parisc.in                    | 397 ++++++++++
 include/lapi/syscalls/powerpc.in                   |  19 +-
 include/lapi/syscalls/powerpc64.in                 |  47 +-
 include/lapi/syscalls/regen.sh                     | 129 ----
 include/lapi/syscalls/s390.in                      |  15 +-
 include/lapi/syscalls/s390x.in                     |  15 +-
 include/lapi/syscalls/sh.in                        |  15 +-
 include/lapi/syscalls/sparc.in                     |  14 +-
 include/lapi/syscalls/sparc64.in                   |  16 +-
 include/lapi/syscalls/strip_syscall.awk            |  19 -
 .../lapi/syscalls/{order => supported-arch.txt}    |  12 +-
 include/lapi/syscalls/x86_64.in                    |  51 +-
 25 files changed, 1351 insertions(+), 762 deletions(-)

---
base-commit: 84e77afb3acc4bc69c434c430cc1c1d000427921
change-id: 20240923-generate_syscalls-780dc2227bdb

Best regards,

Signature · 5 lines
Andrea Cervesato <[email protected]>


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