Commit Graph

4199 Commits

Author SHA1 Message Date
bece24d1c6 loop.c: optimize decoding of paired ioctls
* loop.c (loop_ioctl): Optimize decoding of LOOP_[GS]ET_STATUS
and LOOP_[GS]ET_STATUS64 ioctl pairs.
2016-05-29 22:15:53 +00:00
124c17ad3c tests/ioctl_evdev.c: check EVIOCGUNIQ decoding
* tests/ioctl_evdev.c (main): Check EVIOCGUNIQ(0) decoding.
2016-05-28 22:13:27 +00:00
bd090efc40 tests/ioctl_mtd.c: fix build with musl
* tests/ioctl_mtd.c: Include <linux/ioctl.h>.
2016-05-28 19:55:01 +00:00
129b304c95 tests: check decoding of 'M' type ioctls
* tests/ioctl_mtd.c: New file.
* tests/ioctl_mtd.test: New test.
* tests/.gitignore: Add ioctl_mtd.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_mtd.test.
2016-05-28 19:31:50 +00:00
a0866bce35 Mpersify mtd.c
* defs.h (mtd_ioctl): Remove.
* mtd.c: Mpersify struct mtd_oob_buf and ioctl numbers.
(mtd_ioctl): Mpersify.
2016-05-28 19:16:32 +00:00
0a27c814b2 mtd.c: refactor
* mtd.c (mtd_ioctl): Move parsers of structures to separate functions.
2016-05-28 19:16:28 +00:00
5104db4e60 Move parser of UBI_* ioctls to a separate file
* mtd.c (ubi_ioctl): Move to ...
* ubi.c: ... new file.
* Makefile.am (strace_SOURCES): Add it.
2016-05-28 10:29:30 +00:00
fc0a38612f tests: check decoding of EVIOC* ioctls
* tests/ioctl_evdev.c: New file.
* tests/ioctl_evdev-v.c: Likewise.
* tests/ioctl_evdev.test: New test.
* tests/ioctl_evdev-v.test: Likewise.
* tests/.gitignore: Add ioctl_evdev and ioctl_evdev-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_evdev.test and ioctl_evdev-v.test.
2016-05-28 00:56:47 +00:00
43c8a5d0e8 Mpersify EVIOC* ioctl parser
* defs.h (evdev_abs): New xlat prototype.
(evdev_ioctl): Remove.
* evdev.c: Do not include "xlat/evdev_abs.h".
Mpersify struct ff_effect and ioctl numbers.
(evdev_ioctl): Mpersify.
* NEWS: Mention this enhancement.
2016-05-28 00:56:47 +00:00
aa21c07f2e evdev.c: fix printing of unrecognized event type passed to EVIOCGBIT
* evdev.c (bit_ioctl): If event type is not unrecognized,
print the argument as an address.
2016-05-28 00:56:47 +00:00
47be9f2597 evdev.c: fix printing of EV_PWR's argument
* evdev.c (bit_ioctl): Fix printing of comma before EV_PWR's argument.
2016-05-28 00:56:47 +00:00
3f23c0c79f evdev.c: fix indentation
* evdev.c: Fix indentation of print formats.
2016-05-28 00:56:47 +00:00
10de2eb030 evdev.c: fix decoding of EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ
* evdev.c (evdev_read_ioctl): Fix printing of the string returned
in response to EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ requests.
2016-05-28 00:56:47 +00:00
b29569aa1d evdev.c: fix EVIOCGVERSION decoding
* evdev.c (evdev_read_ioctl): Print EVIOCGVERSION's argument
using #x format.
2016-05-28 00:56:47 +00:00
563f0cefb1 evdev.c: fix EVIOCGMTSLOTS decoding
* evdev.c (mtslots_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
14a810e6d8 evdev.c: fix bitset decoding
* evdev.c (decode_bitset): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
e54f98a223 evdev.c: fix decoding of struct input_id
* evdev.c (getid_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
13f8e8fb4e evdev.c: fix decoding of struct input_keymap_entry
* evdev.c (keycode_V2_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
7954e2a711 evdev.c: fix decoding of EVIOCGKEYCODE/EVIOCSKEYCODE
* evdev.c (keycode_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
e167006908 evdev.c: fix decoding of struct input_absinfo
* evdev.c (abs_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:46 +00:00
3a45eb3711 evdev.c: fix decoding of struct ff_effect
* evdev.c (ff_effect_ioctl): Use umove_or_printaddr.
Fix printing of struct ff_effect.u member names.
2016-05-28 00:37:06 +00:00
c758ed0f50 evdev.c: fix printing of struct ff_envelope.fade_level
* evdev.c (decode_envelope): Print struct ff_envelope.fade_level
using #x format.
2016-05-28 00:37:06 +00:00
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