]> xenbits.xensource.com Git - unikraft/unikraft.git/commit
lib/syscall_shim: Functions to pretty-print system call requests
authorSimon Kuenzer <simon@unikraft.io>
Wed, 1 Feb 2023 21:36:24 +0000 (22:36 +0100)
committerUnikraft <monkey@unikraft.io>
Sat, 4 Feb 2023 13:01:39 +0000 (13:01 +0000)
commit26dfabdfdc43a9d89dc00c5284e2af19ddb44265
tree08cb7462d624c82ebb280353820a21494e41bedf
parent5f0510de86507b2e1745020acc862ad1b1a2bb97
lib/syscall_shim: Functions to pretty-print system call requests

This commit introduces an initial implementation of `uk_snprsyscall()` and
`uk_vsnprsyscall()`, two functions that pretty print a system call request
to a given C-string buffer. The system call name, the given arguments
(including flags and definitions) and the response are decoded.
As a start, this commit implements the formatting of the following system
calls: brk, open, openat, write, read, stat, fstat, close, dup, dup2,
 gettid, getpid
Yet unsupported system calls are printed with the raw values of arguments.

Checkpatch-Ignore: DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON
Checkpatch-Ignore: MULTISTATEMENT_MACRO_USE_DO_WHILE
Checkpatch-Ignore: TRAILING_SEMICOLON
Checkpatch-Ignore: MISSING_BREAK
Checkpatch-Ignore: COMPLEX_MACRO
Checkpatch-Ignore: SPACING
Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Andra Paraschiv <andra@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #737
lib/syscall_shim/Config.uk
lib/syscall_shim/Makefile.uk
lib/syscall_shim/include/uk/syscall.h
lib/syscall_shim/uk_prsyscall.c [new file with mode: 0644]