Dmitry V. Levin [Wed, 22 Jun 2016 15:58:00 +0000 (15:58 +0000)]
Split print_sockaddr
* net.c (sockaddr_buf_t): Remove.
(sockaddr_printer): New type.
(sa_printers): New array of sockaddr_printer.
(print_sockaddr): Use it. Move printers of family specific
sockaddr data to separate funcions.
Fabien Siron [Wed, 22 Jun 2016 13:27:03 +0000 (13:27 +0000)]
Add a enum for decoding to tprint_iov() and tprint_iov_upto()
Introduce a new type iov_decode which will be used instead of the integer
"decode" as a parameter.
* defs.h (iov_decode): New enum.
(tprint_iov, tprint_iov_upto): Change type of "decode_iov" to enum iov_decode.
* aio.c (print_iocb): Change type of "decode_iov" to enum iov_decode in
tprint_iov() call.
* keyctl.c (keyctl_instantiate_key_iov): Likewise.
* process.c (ptrace): Likewise.
* process_vm.c (process_vm_readv, process_vm_writev): Likewise.
* io.c (writev, do_pwritev, vmsplice): Likewise.
(print_iovec): Replace the condition with a switch.
(tprint_iov_upto): Change type of "decode_iov" to enum iov_decode.
(readv, do_preadv): Change type of "decode_iov" to enum iov_decode in
tprint_iov_upto() call.
* scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
print_sg_io_v4_res): Likewise.
* net.c (do_msghdr): Adapt call of tprint_iov_upto().
Dmitry V. Levin [Wed, 22 Jun 2016 00:21:47 +0000 (00:21 +0000)]
printsock: fix zero padding of sockaddr buffer
Before this change printsock used to erroneously clear the last byte
of sockaddr buffer.
* net.c (printsock): Use struct sockaddr_storage as a sockaddr buffer.
Reserve additional byte after the sockaddr buffer for zero padding.
Do not clear memory that is going to be overwritten by umoven.
Clear the tail of sockaddr buffer that was not overwritten by umoven.
Fabien Siron [Fri, 17 Jun 2016 16:29:53 +0000 (16:29 +0000)]
Make getfdproto return enum instead of string
Introduce a new enum type sock_proto and use it instead of strings for socket
protocols identification.
* defs.h (sock_proto): New enum.
(get_proto_by_name): New function.
* socketutils.c (protocols): New static table.
(print_sockaddr_by_inode): Use it. Change type of "proto" argument
to sock_proto.
(get_proto_by_name): New function.
* util.c (getfdproto): Use it. Change return type to sock_proto.
(printfd): Update.
Dmitry V. Levin [Sat, 18 Jun 2016 22:53:25 +0000 (22:53 +0000)]
Split travis-ci.sh
* travis-ci.sh: Split into travis-build.sh, travis-install.sh,
and travis-success.sh files.
* .travis.yml (before_install, after_success, git): New mappings.
(script): Change to travis-build.sh.
(addons, install): Remove.
(env): Remove matrix.
(matrix): Replace exclude list with include list.
Dmitry V. Levin [Fri, 17 Jun 2016 00:44:44 +0000 (00:44 +0000)]
btrfs: fix build with fresh linux/btrfs.h
Fix build with fresh <linux/btrfs.h> that provides a slightly different
definition of struct btrfs_ioctl_defrag_range_args.
* btrfs.c (btrfs_ioctl): Cast "len" member of
struct btrfs_ioctl_defrag_range_args to uint64_t.
* tests/btrfs.c (btrfs_print_defrag_range_args): Cast "start" and "len"
members of struct btrfs_ioctl_defrag_range_args to uint64_t.
Dmitry V. Levin [Fri, 17 Jun 2016 00:02:46 +0000 (03:02 +0300)]
btrfs: provide fallback definitions for BTRFS_IOC_QUOTA_RESCAN*
<linux/btrfs.h> was introduced in linux v3.9-rc1 while some
of btrfs ioctls were added later, e.g. BTRFS_IOC_QUOTA_RESCAN
and BTRFS_IOC_QUOTA_RESCAN_STATUS in v3.10-rc2,
or BTRFS_IOC_QUOTA_RESCAN_WAIT in v3.11-rc1.
* btrfs.c [!BTRFS_IOC_QUOTA_RESCAN]
(struct btrfs_ioctl_quota_rescan_args): New structure.
(BTRFS_IOC_QUOTA_RESCAN, BTRFS_IOC_QUOTA_RESCAN_STATUS): New macros.
[!BTRFS_IOC_QUOTA_RESCAN_WAIT] (BTRFS_IOC_QUOTA_RESCAN_WAIT): New macro.
* tests/btrfs.c: Likewise.
Dmitry V. Levin [Thu, 16 Jun 2016 23:21:57 +0000 (23:21 +0000)]
configure.ac: fix checks for btrfs specific structures
* configure.ac (AC_CHECK_MEMBERS): Fix typo in the check for
struct btrfs_ioctl_defrag_range_args.start and
struct btrfs_ioctl_search_args_v2.buf_size.
Dmitry V. Levin [Wed, 15 Jun 2016 21:27:41 +0000 (21:27 +0000)]
net.c: include <linux/icmp.h> unconditionally
* configure.ac (AC_CHECK_HEADERS): Remove linux/icmp.h.
* net.c: Follow the example of tests/net-icmp_filter.c and include
<linux/icmp.h> unconditionally.
Elvira Khabirova [Sun, 12 Jun 2016 16:11:43 +0000 (19:11 +0300)]
Remove UNDEFINED_SCNO
Since UNDEFINED_SCNO is set if and only if !SCNO_IS_VALID
and since tcp->s_ent can only be set to &sysent[tcp->scno]
(or to &unknown, but only when !SCNO_IS_VALID), there is no need
to check for UNDEFINED_SCNO before calling syscall_name(tcp->scno).
Dmitry V. Levin [Wed, 8 Jun 2016 00:32:22 +0000 (00:32 +0000)]
make-dist: generate strace-*.tar.gz, strace.dsc, and strace.spec
Change make-dist to generate strace-*.tar.gz, strace.dsc,
and strace.spec in addition to strace-*.tar.xz.
* configure.ac (AM_INIT_AUTOMAKE): Remove no-dist-gzip.
* make-dsc: New file.
* make-dist: Use it.
* .gitignore: Add strace-*.tar.gz, strace.dsc, and strace.spec.
Dmitry V. Levin [Wed, 8 Jun 2016 00:23:28 +0000 (00:23 +0000)]
git-version-gen: replace '-' with '.' in generated version
* git-version-gen: Replace '-' with '.' so version conforms to policies
* configure.ac (SPEC_VERSION): Remove.
* strace.spec.in: Replace SPEC_VERSION with PACKAGE_VERSION.
Remove %srcname.
Dmitry V. Levin [Mon, 6 Jun 2016 15:39:11 +0000 (15:39 +0000)]
Do not check for old sysctl enums
Assume that sysctl enums defined since linux v2.6 are always defined,
with a signle exception: check for CTL_PROC which definition was removed
in v2.6.18 and restored later in v2.6.23.
* configure.ac (AC_CHECK_DECLS): Remove old constants.
* xlat/sysctl_kern.in: Mark constants older than KERN_PRINTK_RATELIMIT
as unconditional.
* xlat/sysctl_net.in: Mark constants older than NET_LLC
as unconditional.
* xlat/sysctl_net_core.in: Mark constants older than NET_CORE_BUDGET
as unconditional.
* xlat/sysctl_net_ipv4.in: Mark constants older than
NET_IPV4_IGMP_MAX_MSF as unconditional.
* xlat/sysctl_net_ipv4_conf.in: Mark constants older than
NET_IPV4_CONF_FORCE_IGMP_VERSION as unconditional.
* xlat/sysctl_net_ipv4_route.in: Mark constants older than
NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS as unconditional.
* xlat/sysctl_net_ipv6.in: Mark constants older than
NET_IPV6_MLD_MAX_MSF as unconditional.
* xlat/sysctl_net_ipv6_route.in: Mark constants older than
NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS as unconditional.
* xlat/sysctl_net_unix.in: Mark all constants as unconditional.
* xlat/sysctl_root.in: Mark constants older than CTL_ARLAN
as unconditional.
* xlat/sysctl_vm.in: Mark constants older than VM_MAX_MAP_COUNT
as unconditional.
Dmitry V. Levin [Sun, 29 May 2016 22:34:30 +0000 (22:34 +0000)]
loop.c: fix printing of arrays
* loop.c (decode_loop_info): Use square brackets to print
struct loop_info.lo_init and struct loop_info.reserved arrays.
(decode_loop_info64): Use square brackets to print
struct loop_info64.lo_init array.
Dmitry V. Levin [Fri, 27 May 2016 00:49:08 +0000 (00:49 +0000)]
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.