[PATCH v4 0/6] Add strace support for printing arguments of selected syscalls

Filip Bozuta posted 6 patches 3 years, 10 months ago
Test FreeBSD passed
Test asan passed
Test docker-quick@centos7 passed
Test checkpatch failed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200616103927.20222-1-filip.bozuta@syrmia.com
Maintainers: Laurent Vivier <laurent@vivier.eu>, Riku Voipio <riku.voipio@iki.fi>
There is a newer version of this series
linux-user/qemu.h      |  20 ++-
linux-user/strace.c    | 286 +++++++++++++++++++++++++++++++++++++----
linux-user/strace.list |  37 +++---
linux-user/syscall.c   |  18 +--
4 files changed, 298 insertions(+), 63 deletions(-)
[PATCH v4 0/6] Add strace support for printing arguments of selected syscalls
Posted by Filip Bozuta 3 years, 10 months ago
From: Filip Bozuta <Filip.Bozuta@syrmia.com>

This series covers strace support for printing arguments of following syscalls:

    *acct()           *lgetxattr()       *removexattr()       *lchown()
    *fsync()          *fgetxattr()       *lremovexattr()      *fallocate()
    *fdatasync()      *listxattr()       *fremovexattr()
    *listen()         *llistxattr()      *lseek()
    *getxattr()       *flistxattr()      *chown()

The implementation details for strace support is described in this series patch
commit messages.

Testing method:

    Mini test programs were written that run these syscalls for different arguments.
    Those programs were compiled (sometimes using cross-compilers) for the following
    architectures:

        * Intel 64-bit (little endian) (gcc)
        * Power pc 32-bit (big endian) (powerpc-linux-gnu-gcc)
        * Power pc 64-bit (big endian) (powerpc64-linux-gnu-gcc)
        * Mips 32-bit (little endian) (mipsel-linux-gnu-gcc)
        * Mips 64-bit (little endian) (mips64el-linux-gnuabi64-gcc)

    The corresponding native programs were executed with strace, without using
    QEMU, on Intel Core i7-4790K (x86_64) host.

    All applicable compiled programs were in turn executed with "-strace"
    through QEMU and the strace printing results obtained were the same 
    ones gotten for native execution.

v2:

    * Added patch that extends strace support by enabling argument printing
      after syscall execution
    * Added strace support for argument printing for syscalls:
      removexattr(), lremovexattr(), fremovexattr()
    * Added "print_syscall_ret_listxattr()" that prints list of extended
      attributes after execution of syscalls: listxattr(), llistxattr(),
      flistxattr()
    * Corrected formats in some printing functions
    * Moved target_offset64() function definition from "syscall.c" to
      "qemu.h"

v3:

    * Added generic function SYSCALL_RET_ERR() that checks the return value
      and prints the approppriate error message
    * Added "print_syscall_ret_llistxattr" and "print_syscall_ret_flistxattr"
      in strace.list for "llistxattr()" and "flistxattr()" that have same
      definition as "print_syscall_ret_listxattr"

v4:

    * Changed error printing from macro SYSCALL_RET_ERR() to function
      print_syscall_err()
    * Changed while loop in print_syscall_ret_listxattr() to check printed
      bytes against size of the return value


Filip Bozuta (6):
  linux-user: Extend strace support to enable argument printing after
    syscall execution
  linux-user: Add strace support for a group of syscalls
  linux-user: Add strace support for printing argument of syscalls used
    for extended attributes
  linux-user: Add strace support for printing arguments of lseek()
  linux-user: Add strace support for printing arguments of
    chown()/lchown()
  linux-user: Add strace support for printing arguments of fallocate()

 linux-user/qemu.h      |  20 ++-
 linux-user/strace.c    | 286 +++++++++++++++++++++++++++++++++++++----
 linux-user/strace.list |  37 +++---
 linux-user/syscall.c   |  18 +--
 4 files changed, 298 insertions(+), 63 deletions(-)

-- 
2.17.1


Re: [PATCH v4 0/6] Add strace support for printing arguments of selected syscalls
Posted by no-reply@patchew.org 3 years, 10 months ago
Patchew URL: https://patchew.org/QEMU/20200616103927.20222-1-filip.bozuta@syrmia.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [PATCH v4 0/6] Add strace support for printing arguments of selected syscalls
Type: series
Message-id: 20200616103927.20222-1-filip.bozuta@syrmia.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Switched to a new branch 'test'
756604e linux-user: Add strace support for printing arguments of fallocate()
25680d5 linux-user: Add strace support for printing arguments of chown()/lchown()
cadd65d linux-user: Add strace support for printing arguments of lseek()
eb40627 linux-user: Add strace support for printing argument of syscalls used for extended attributes
47226e8 linux-user: Add strace support for a group of syscalls
3e531d0 linux-user: Extend strace support to enable argument printing after syscall execution

=== OUTPUT BEGIN ===
1/6 Checking commit 3e531d0470d2 (linux-user: Extend strace support to enable argument printing after syscall execution)
2/6 Checking commit 47226e8674a7 (linux-user: Add strace support for a group of syscalls)
3/6 Checking commit eb40627b1196 (linux-user: Add strace support for printing argument of syscalls used for extended attributes)
4/6 Checking commit cadd65d9f866 (linux-user: Add strace support for printing arguments of lseek())
5/6 Checking commit 25680d5e1b01 (linux-user: Add strace support for printing arguments of chown()/lchown())
6/6 Checking commit 756604eefe06 (linux-user: Add strace support for printing arguments of fallocate())
ERROR: storage class should be at the beginning of the declaration
#69: FILE: linux-user/strace.c:1146:
+UNUSED static struct flags falloc_flags[] = {

total: 1 errors, 0 warnings, 104 lines checked

Patch 6/6 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200616103927.20222-1-filip.bozuta@syrmia.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com