qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/4] linux-user: Add strace support for printing arguments


From: Laurent Vivier
Subject: Re: [PATCH v2 2/4] linux-user: Add strace support for printing arguments of truncate()/ftruncate() and getsid()
Date: Tue, 21 Jul 2020 16:28:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

Le 13/07/2020 à 11:50, Filip Bozuta a écrit :
> This patch implements strace argument printing functionality for following 
> syscalls:
> 
>     * truncate, ftruncate - truncate a file to a specified length
> 
>         int truncate/truncate64(const char *path, off_t length)
>         int ftruncate/ftruncate64(int fd, off_t length)
>         man page: https://man7.org/linux/man-pages/man2/truncate.2.html
> 
>     * getsid - get session ID
> 
>         pid_t getsid(pid_t pid)
>         man page: https://man7.org/linux/man-pages/man2/getsid.2.html
> 
> Implementation notes:
> 
>     Syscalls truncate/truncate64 take string argument types and thus a
>     separate print function "print_truncate/print_truncate64" is stated in
>     file "strace.list". This function is defined and implemented in "strace.c"
>     by using an existing function used to print string arguments: 
> "print_string()".
>     For syscall ftruncate64, a separate printing function was also stated in
>     "strace.c" as it requires a special kind of handling.
>     The other syscalls have only primitive argument types, so the rest of the
>     implementation was handled by stating an appropriate printing format in 
> file
>     "strace.list".
>     Function "regpairs_aligned()" was cut & pasted from "syscall.c" to 
> "qemu.h"
>     as it is used by functions "print_truncate64()" and "print_ftruncate64()"
>     to print the offset arguments of "truncate64()" and "ftruncate64()".
> 
> Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
> ---
>  linux-user/qemu.h      | 35 +++++++++++++++++++++++++++++++
>  linux-user/strace.c    | 47 ++++++++++++++++++++++++++++++++++++++++++
>  linux-user/strace.list | 10 ++++-----
>  linux-user/syscall.c   | 32 ----------------------------
>  4 files changed, 87 insertions(+), 37 deletions(-)
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]