Commit Graph

4177 Commits

Author SHA1 Message Date
9635df43b6 evdev.c: fix decoding of EVIOCGRAB and EVIOCREVOKE
* evdev.c (evdev_write_ioctl): Print argument of EVIOCGRAB
and EVIOCREVOKE as unsigned long.
2016-05-28 00:37:06 +00:00
0039424cb9 evdev.c: fix EVIOCRMFF decoding
* evdev.c (evdev_write_ioctl): Print EVIOCRMFF's argument as int.
2016-05-28 00:37:06 +00:00
53767d8ec5 evdev.c: move handling of EVIOCGBIT to a separate function
* evdev.c (evdev_read_ioctl): Move EVIOCGBIT handling to ...
(bit_ioctl): ... new function.
2016-05-28 00:37:05 +00:00
8a18f80a37 evdev.c: reorder ioctl command checks
Change the order of ioctl command cheks to match the kernel:
1st, check for fixed-number fixed-length commands,
2nd, check for fixed-number variable-length commands,
3rd, check for multi-number fixed-length commands,
4thm check for multi-number variable-length commands.

* evdev.c (evdev_read_ioctl, evdev_write_ioctl): Reorder
ioctl command checks.
2016-05-28 00:37:05 +00:00
2114e08a87 evdev.c: decode all directions except _IOC_READ on entering syscall
* evdev.c (evdev_write_ioctl): Remove exiting check.
(evdev_read_ioctl): Move entering check ...
(evdev_ioctl): ... here.  Add RVAL_DECODED to return code in _IOC_WRITE
and default cases.
2016-05-28 00:37:05 +00:00
8d85c233d2 evdev.c: fix indentation of preprocessor directives
* evdev.c: Fix indentation of preprocessor directives.
Move inclusion of <linux/ioctl.h> into [HAVE_LINUX_INPUT_H].
2016-05-28 00:37:05 +00:00
Jeff Mahoney
eb36e38523 file_ioctl.c: print first two extents for FIDEDUPERANGE in abbrev mode
* file_ioctl.c (file_ioctl, print_file_dedupe_range_info): Print first
two elements of info array in abbrev mode.
* tests/btrfs.c (btrfs_test_extent_same_ioctl): Handle newly
printed elements.
2016-05-28 00:37:02 +00:00
1f1559e6a9 ioctl.c: fix typo in decoding of EVIOCSABS's parameter
* ioctl.c (evdev_decode_number): Fix typo in printxval default value.
2016-05-27 08:55:40 +00:00
Jeff Mahoney
826b7978ec tests: check decoding of btrfs RDWR ioctls returned data
* tests/btrfs-vw.test: New file.
* tests/btrfs-w.test: New file.
* tests/Makefile.am (DECODER_TESTS): Add them.
2016-05-27 08:54:32 +00:00
Jeff Mahoney
fd70b501f6 tests/btrfs.c: fix live btrfs_test_search_ioctls output
* tests/btrfs.c (btrfs_test_search_ioctls): Use print_tree_search_buf
for BTRFS_IOC_TREE_SEARCH and fix missing whitespace.
2016-05-27 08:54:18 +00:00
Jeff Mahoney
d32d95a87f btrfs.c: don't use print_array in btrfs_print_tree_search
* btrfs.c (btrfs_print_tree_search): Don't use print_array.  The buffer
represents a series of variable sized records, not an array.
2016-05-27 08:53:44 +00:00
Jeff Mahoney
2060d97382 btrfs.c: fix print_array usage in btrfs_print_logical_ino_container
* btrfs.c: (btrfs_print_logical_ino_container) Fix the element count
to reflect the number of records rather than the number of items.
2016-05-27 08:53:30 +00:00
Jeff Mahoney
563a758994 tests/btrfs.c: fix btrfs-v for BTRFS_IOC_TREE_SEARCH
* tests/btrfs.c (btrfs_test_send_ioctl): Assign key_reference
to search_args for BTRFS_IOC_TREE_SEARCH ioctl tests.
2016-05-26 20:54:46 +00:00
Fabien Siron
e6d2b566aa Fix -yy documentation
* strace.c (usage): Fix description of -yy option.
* strace.1: Likewise.
2016-05-26 15:34:28 +00:00
59b140a096 tests/ioctl_block.c: tweak magic constants to make the test more reliable
* tests/ioctl_block.c (main): Change bad pointer to make
its lower 32-bit part closer to -1U.
2016-05-26 15:16:31 +00:00
b356ad8abf tests/btrfs.c: check basic decoding of read-only ioctls
* tests/btrfs.c (btrfs_test_read_ioctls): New function.
(main): Use it.
2016-05-26 14:46:37 +00:00
799b22a27d tests: check decoding of BLK* ioctls
* configure.ac (AC_CHECK_TYPES): Add struct blk_user_trace_setup.
* tests/ioctl_block.c: New file.
* tests/ioctl_block.test: New test.
* tests/.gitignore: Add ioctl_block.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_block.test.
2016-05-26 14:44:13 +00:00
37d1b3dd8c Mpersify BLK* ioctl parser
* defs.h (block_ioctl): Remove.
* block.c: Mpersify struct blk_user_trace_setup,
struct blkpg_ioctl_arg, struct blkpg_partition, and ioctl numbers.
(block_ioctl): Mpersify.
* NEWS: Mention this enhancement.
2016-05-26 14:44:13 +00:00
0c9087c1b5 block.c: optimize decoding of paired ioctls
* block.c (block_ioctl): Optimize decoding of commands that return
a signed int.
2016-05-26 14:44:13 +00:00
46d25c2b84 block.c: fix printing of uint64_t pairs
* block.c (block_ioctl): Print uint64_t values using PRIu64 format.
2016-05-26 14:44:13 +00:00
0bea528fa8 block.c: fix printing of struct blk_user_trace_setup
* block.c (block_ioctl): Fix printing of comma before
struct blk_user_trace_setup.name on exiting syscall.
2016-05-26 14:44:13 +00:00
4dd9f3f038 Move parser of 'X' type ioctls to a separate file
* fs_x_ioctl.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* block.c: (block_ioctl): Move parser of FITRIM, FIFREEZE, and FITHAW
to fs_x_ioctl.c.
* defs.h (fs_x_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call fs_x_ioctl for ioctl type 'X'.
2016-05-26 14:44:13 +00:00
b3f00403c3 Move parser of HDIO_* ioctls to a separate file
* hdio.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* block.c: Do not include <linux/hdreg.h>.
(block_ioctl): Move parser of HDIO_GETGEO to hdio.c.
* defs.h (hdio_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call hdio_ioctl for ioctl type 0x03.
2016-05-26 14:44:13 +00:00
84a979c9ee Fix explicit casts of signed integer types to unsigned long long
* defs.h (widen_to_ull): New macro.
* dirent.c (print_old_dirent, SYS_FUNC(getdents)): Use it in place
of explicit casts to unsigned long long.
* io.c (print_lld_from_low_high_val): Likewise.
* lseek.c (SYS_FUNC(llseek)): Likewise.
* printsiginfo.c (print_si_info): Likewise.
* printstat.h (DO_PRINTSTAT): Likewise.
* sysinfo.c (SYS_FUNC(sysinfo)): Likewise.
* times.c (SYS_FUNC(times)): Likewise.
* fetch_struct_statfs.c (ASSIGN_NUMBER): Remove.
(fetch_struct_statfs, fetch_struct_statfs64): Replace ASSIGN_NUMBER
with widen_to_ull.
2016-05-26 14:44:13 +00:00
51507201ea scsi.c: print __u64 types using PRI__u64 format
* scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Remove explicit casts
to unsigned long long, print fields of type __u64 using PRI__u64 format.
2016-05-26 14:44:13 +00:00
ba35137246 tests: check decoding of RTC_* ioctls
* configure.ac (AC_CHECK_FUNCS): Add ioctl_rtc.
* tests/ioctl_rtc.c: New file.
* tests/ioctl_rtc-v.c: Likewise.
* tests/ioctl_rtc.test: New test.
* tests/ioctl_rtc-v.test: Likewise.
* tests/.gitignore: Add ioctl_rtc and ioctl_rtc-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_rtc.test and ioctl_rtc-v.test.
2016-05-25 17:58:57 +00:00
5d7812a479 Mpersify RTC_* ioctl parser
* defs.h (rtc_ioctl): Remove.
* rtc.c: Mpersify struct rtc_pll_info and ioctl numbers.
(rtc_ioctl): Mpersify.
* NEWS: Mention this enhancement.
2016-05-25 16:36:37 +00:00
7e3a381c3d rtc.c: fix decoding of struct rtc_wkalrm
* rtc.c (decode_rtc_wkalrm): Print field name of struct rtc_wkalrm.time.
2016-05-25 15:28:23 +00:00
eea86017e1 file_ioctl.c: print file descriptors using printfd
* file_ioctl.c (print_file_dedupe_range_info): Print
struct file_dedupe_range_info.dest_fd using printfd.
(file_ioctl): Print struct file_clone_range.src_fd using printfd.
2016-05-25 08:38:53 +00:00
6085825201 rtc.c: do not print argument of ioctls that have no arguments
* rtc.c (rtc_ioctl): Do not print argument of RTC_{A,U,P,W}IE_{ON,OFF}
and RTC_VL_CLR ioctls.
2016-05-25 08:38:53 +00:00
3adf229434 rtc.c: decode RTC_PLL_GET and RTC_PLL_SET
* rtc.c (rtc_ioctl): Decode RTC_PLL_GET and RTC_PLL_SET
2016-05-25 08:38:52 +00:00
e0b5e91375 rtc.c: optimize decoding of paired ioctls
* rtc.c (rtc_ioctl): Optimize decoding of RTC_ALM_READ/RTC_ALM_SET,
RTC_RD_TIME/RTC_SET_TIME, and RTC_WKALM_RD/RTC_WKALM_SET ioctl pairs.
2016-05-25 07:37:44 +00:00
a41fdb5786 block.c: handle BLKDAXGET
* block.c [!BLKDAXGET] (BLKDAXGET): Define.
(block_ioctl): Handle it.
2016-05-25 07:33:02 +00:00
f8da0f3e78 tests: check decoding of mount syscall
* tests/mount.c: New file.
* tests/mount.test: New test.
* tests/.gitignore: Add mount.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mount.
2016-05-25 00:11:37 +00:00
1ba55355c6 tests/vhangup.c: diassociate from the controlling terminal first
* tests/vhangup.c (main): Call setsid before vhangup.
2016-05-24 20:12:25 +00:00
Fei Jie
a41d9f5621 tests: add vhangup.test
* tests/vhangup.c: New file.
* tests/vhangup.test: New test.
* tests/.gitignore: Add vhangup.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add vhangup.test.
2016-05-24 20:09:16 +00:00
0cf24d9184 NEWS: Prepare for 4.12 release 2016-05-24 18:12:08 +00:00
Gleb Fotengauer-Malinovskiy
e79f038dd9 tests/btrfs.c: fix build on x32
* tests/btrfs.c (btrfs_test_ino_path_ioctls): Fix printing of st_ino.
2016-05-24 15:10:41 +00:00
6697d15f0a tests/btrfs.c: fix build with u64 based BTRFS_IOC_DEFAULT_SUBVOL
* tests/btrfs.c: Fix build on systems where BTRFS_IOC_DEFAULT_SUBVOL
is defined using unexported type "u64".
2016-05-24 14:52:27 +00:00
ea516df85e btrfs.c: fix build on systems without BTRFS_IOC_FILE_EXTENT_SAME
* btrfs.c (btrfs_ioctl): Skip BTRFS_IOC_FILE_EXTENT_SAME case
if this constant is not defined.
* tests/btrfs.c (btrfs_test_extent_same_ioctl): Skip this part
of the test if BTRFS_IOC_FILE_EXTENT_SAME is not defined.
2016-05-24 14:52:27 +00:00
3f36611e98 tests/btrfs.c: fix printing struct btrfs_ioctl_clone_range_args
* tests/btrfs.c (btrfs_test_clone_ioctls): Print __u64 members
of struct btrfs_ioctl_clone_range_args using PRI__u64 format.
2016-05-24 14:52:27 +00:00
57888fa5f9 tests/btrfs.c: tweak magic constants to make the test more reliable
* tests/btrfs.c (btrfs_test_sync_ioctls): Change u64val
to 0xdeadbeefbadc0ded.
(btrfs_test_subvol_ioctls): Likewise.  Change bad_pointer
to make their lower 32-bit parts closer to -1U.
2016-05-24 14:52:27 +00:00
6ce6d3be10 btrfs.c: print file descriptors using printfd
* btrfs.c (btrfs_ioctl): Print struct btrfs_ioctl_send_args.send_fd,
struct btrfs_ioctl_vol_args.fd, and struct btrfs_ioctl_vol_args_v2.fd
using printfd.
* tests/btrfs.c (btrfs_print_vol_args_v2, btrfs_test_subvol_ioctls,
btrfs_test_device_ioctls, btrfs_test_clone_ioctls,
btrfs_test_send_ioctl): Update.
2016-05-24 14:52:27 +00:00
9298c66dc0 tests/btrfs.c: do not print errno in case of fs type mismatch
* tests/btrfs.c (main): Use error_msg_and_fail instead of
perror_msg_and_fail when the fs type of the given directory
is not BTRFS_SUPER_MAGIC.
2016-05-24 14:52:27 +00:00
2447de4ca1 tests/btrfs.c: fix indentation
* tests/btrfs.c: Fix indentation of preprocessor directives
and function prototypes.
2016-05-24 14:52:27 +00:00
28a5f66e2e tests/btrfs.c: sort included headers
* tests/btrfs.c: Sort included headers.
2016-05-24 14:52:27 +00:00
45fcc0c853 tests/btrfs.c: do not use alloca
* tests/btrfs.c: Don't include <alloca.h>.
(btrfs_test_subvol_ioctls): Allocate
struct btrfs_ioctl_vol_args_v2.qgroup_inherit using tail_alloc.
2016-05-24 14:52:27 +00:00
2212918aa2 tests/btrfs.c: fix build on systems without <linux/btrfs.h> or <linux/fiemap.h>
* tests/btrfs.c: Include "tests.h" first.
Skip the test if [!HAVE_LINUX_BTRFS_H].  Skip parts of the test
that use struct fiemap if [!HAVE_LINUX_FIEMAP_H].
2016-05-24 14:52:27 +00:00
Jeff Mahoney
3586679f7a tests: add testing for btrfs ioctls
* tests/btrfs.c: New file.
* tests/btrfs.test: New test.
* tests/btrfs-v.test: Likewise.
* tests/.gitignore: Add btrfs.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add btrfs.test and btrfs-v.test.
2016-05-24 14:52:27 +00:00
aab00c2023 tests/file_ioctl.c: use tail_alloc
* tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc.
2016-05-24 14:52:27 +00:00