All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add strace support for printing arguments for ioctls
@ 2020-06-16 10:51 Filip Bozuta
  2020-06-16 10:51 ` [PATCH v2 1/2] linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS Filip Bozuta
  2020-06-16 10:51 ` [PATCH v2 2/2] linux-user: Add strace support for printing arguments of ioctl() Filip Bozuta
  0 siblings, 2 replies; 5+ messages in thread
From: Filip Bozuta @ 2020-06-16 10:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent

From: Filip Bozuta <Filip.Bozuta@syrmia.com>

This series introduces the functionality in strace to print arguments for
ioctls. This is gonna be a useful adittion as it indroduces a good debugging
and diagnostic mechanism for user programs cross compiled for different
architectures.

The first patch in the series introduces missing thunk argument types for ioctls
SIOCGSTAMP and SIOCGSTAMPNS needed for strace argument printing. The second patch
introduces the argument printing functionality. The implementation details are
described in the patch commit messages.

Testing method:

    Mini test programs were written that run ioctls that are implemented in qemu.
    These programs covered different varieties of ioctls. Some covered rtc ioctls
    with both basic argument types (like RTC_IRQP_SET and RTC_IRQP_READ) and
    structure types (like RTC_RD_TIME and RTC_SET_TIME). Some covered loop ioctls
    LOOP_SET_STATUS and LOOP_GET_STATUS that use "struct loop_info" which contain
    special types olddev_t (in qemu presented as OLDDEV_T). Some covered alsa timer
    ioctls like SNDRV_TIMER_IOCTL_GSTATUS, SDNRV_TIMER_IOCTL_STATUS which contain
    complex third argument types (structures that contain other structures and strings
    as fields).

    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)

    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:
    * Removed case TYPE_LONGLONG, TYPE_ULONGLONG from print_ioctl()
    * Changed error printing in print_syscall_ret_ioctl() to use
      error printing function from another series
    * Added and #ifdef directive in "syscall.types.h" to manage the
      case when the "u_sec" filed in timeval structure is of type int

Filip Bozuta (2):
  linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS
  linux-user: Add strace support for printing arguments of ioctl()

 include/exec/user/thunk.h  |   1 +
 linux-user/ioctls.h        |  12 ++-
 linux-user/qemu.h          |  20 +++++
 linux-user/strace.c        | 107 ++++++++++++++++++++++++++
 linux-user/strace.list     |   3 +-
 linux-user/syscall.c       |  20 +----
 linux-user/syscall_types.h |  22 ++++++
 thunk.c                    | 154 +++++++++++++++++++++++++++++++++++++
 8 files changed, 315 insertions(+), 24 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-18 14:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 10:51 [PATCH v2 0/2] Add strace support for printing arguments for ioctls Filip Bozuta
2020-06-16 10:51 ` [PATCH v2 1/2] linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS Filip Bozuta
2020-06-18 14:24   ` Laurent Vivier
2020-06-16 10:51 ` [PATCH v2 2/2] linux-user: Add strace support for printing arguments of ioctl() Filip Bozuta
2020-06-18 14:44   ` Laurent Vivier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.