[RFC/PATCH v3 0/2] Add decoders for WDIOC_GETSUPPORT and WDIOC_SETOPTIONS

Sahil Siddiq icegambit91 at gmail.com
Wed Aug 7 19:59:54 UTC 2024


Hi,

This patch improves upon the tests that were submitted
in the previous two patches. As suggested in the response
to v1, syscall injection is used to emulate a successful
ioctl call.

A new test has also been added to verify their behaviour
when strace is run with the -v/--no-abbrev option. This
is for the WDIOC_GETSUPPORT decoder.

I have split the patch into two commits - the decoder's
implementation and the tests. I think this will make it
easier to review them. Please let me know if I should
squash them into a single commit.

Thanks,
Sahil

Changes v1 -> v3:
- src/watchdog_ioctl.c:
  (options): Change to "unsigned int".
  (identity): Print using PRINT_FIELD_CSTRING.
  (WDIOC_SETOPTIONS):
  - Shift "tprint_arg_next" above umove.
  - Use "printflags" instead of its 64-bit counterpart.

Changes v2 -> v3:
- Move tests to commit #2.
- tests/.gitignore (ioctl_watchdog-success.c,
  ioctl_watchdog-success-v.c): New entries.
- tests/Makefile.am (ioctl_watchdog-success.c,
  ioctl_watchdog-success-v.c): New entries.
- tests/gen_tests.in (ioctl_watchdog-success.c,
  ioctl_watchdog-success-v.c): New entries.
- ioctl_watchdog-v.c: New file.
- ioctl_watchdog-success.c: New file.
- tests/ioctl_watchdog.c:
  - Added tests that use syscall retval injection.
  - Added tests to check behaviour under -v/--no-abbrev
    option.

Sahil Siddiq (2):
  watchdog_ioctl: Add decoding of WDIOC_GETSUPPORT and WDIOC_SETOPTIONS
    ioctls
  tests: Improve tests for watchdog ioctl commands

 NEWS                                       |   2 +
 src/watchdog_ioctl.c                       |  32 +++++
 src/xlat/watchdog_ioctl_cmds.in            |   1 +
 src/xlat/watchdog_ioctl_setoptions.in      |   3 +
 src/xlat/watchdog_ioctl_support_options.in |  12 ++
 tests/.gitignore                           |   2 +
 tests/Makefile.am                          |   2 +
 tests/gen_tests.in                         |   4 +-
 tests/ioctl_watchdog-success-v.c           |   2 +
 tests/ioctl_watchdog-success.c             |   2 +
 tests/ioctl_watchdog.c                     | 154 ++++++++++++++++++---
 11 files changed, 193 insertions(+), 23 deletions(-)
 create mode 100644 src/xlat/watchdog_ioctl_setoptions.in
 create mode 100644 src/xlat/watchdog_ioctl_support_options.in
 create mode 100644 tests/ioctl_watchdog-success-v.c
 create mode 100644 tests/ioctl_watchdog-success.c

-- 
2.45.2



More information about the Strace-devel mailing list