summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* Enhance reboot decodingDmitry V. Levin2014-02-05
| | | | | | | | | * linux/reboot.h: New file. * system.c (bootflags1, bootflags2, bootflags3, sys_reboot): Move... * reboot.c: ... here. (bootflags2, bootflags3): Update constants. * Makefile.am (strace_SOURCES): Add reboot.c. (EXTRA_DIST): Add linux/reboot.h.
* Implement kexec_load decodingDmitry V. Levin2014-02-05
| | | | | | | | | * kexec.c: New file. * linux/kexec.h: Likewise. * Makefile.am (strace_SOURCES): Add kexec.c. (EXTRA_DIST): Add linux/kexec.h. * linux/dummy.h (sys_kexec_load): Remove. * linux/syscall.h (sys_kexec_load): New prototype.
* Use prepared editions of recently imported linux headersDmitry V. Levin2014-02-05
| | | | | * linux/fanotify.h: Replace with edition prepared with headers_install.sh. * linux/personality.h: Likewise.
* Implement fanotify_init and fanotify_mark decodingDmitry V. Levin2014-02-05
| | | | | | | | | | | | | | * fanotify.c: New file. * linux/fanotify.h: Likewise. * Makefile.am (strace_SOURCES): Add fanotify.c. (EXTRA_DIST): Add linux/fanotify.h. * defs.h (print_dirfd): New prototype. * file.c (print_dirfd): Export. * linux/dummy.h (sys_fanotify_init, sys_fanotify_mark): Remove. * linux/syscall.h (sys_fanotify_init, sys_fanotify_mark): New prototypes. * pathtrace.c (pathtrace_match): Handle sys_fanotify_init and sys_fanotify_mark.
* Use XLAT_END macroDmitry V. Levin2014-02-05
| | | | | Automatically update all xlat structures using the following sed regexp: s/^[[:space:]]*{[[:space:]]*0[[:space:]]*,[[:space:]]*NULL[[:space:]]*,\?[[:space:]]*}[[:space:]]*,\?[[:space:]]*/\tXLAT_END/
* Itroduce XLAT_END macro to make xlat structures more compactDmitry V. Levin2014-02-05
| | | | * defs.h (XLAT_END): New macro.
* Convert personality_options to XLAT formDmitry V. Levin2014-02-05
| | | | | | | * linux/personality.h: New file. * Makefile.am (EXTRA_DIST): Add it. * system.c: Include <linux/personality.h>. (personality_options): Update PER_* constants, convert to XLAT form.
* Convert futexops to XLAT formDmitry V. Levin2014-02-05
| | | | | * process.c: Define FUTEX_*_PRIVATE macros. (futexops): Convert to XLAT form.
* Convert sigev_value to XLAT formDmitry V. Levin2014-02-05
| | | | | * time.c (sigev_value): Convert to XLAT form. (printsigevent32, printsigevent): Update use of sigev_value.
* Use XLAT macroDmitry V. Levin2014-02-05
| | | | | | Automatically convert all xlat structures to XLAT form using the following sed regexp: s/^[[:space:]]*{[[:space:]]*\([^",}[:space:]]\+\)[[:space:]]*,[[:space:]]*"\1",\?[[:space:]]*}[[:space:]]*/\tXLAT(\1)/
* Introduce XLAT macro to ease maintenance of xlat structuresDmitry V. Levin2014-02-05
| | | | | | * defs.h (XLAT): New macro. Suggested-by: Mike Frysinger <vapier@gentoo.org>
* Decode ptp ioctlsStefan Sørensen2014-02-04
| | | | | | | | | | | | * defs.h (ptp_ioctl): New prototype. * ioctl.c (ioctl_decode): Call ptp_ioctl when code is '='. * Makefile.am (strace_SOURCES): Add ptp.c. (EXTRA_DIST): Add linux/ptp_clock.h. * ptp.c: New file. * linux/ptp_clock.h: New file. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* Decode dynamic posix clocksStefan Sørensen2014-02-03
| | | | | | | | | | | * time.c (cpuclocknames): New xlat structure. (printclockname): New function that decodes posix clock names, including dynamic fd encoded clocks. (sys_clock_settime, sys_clock_gettime, sys_clock_nanosleep, sys_clock_adjtime, sys_timer_create, sys_timerfd, sys_timerfd_create): Use it. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
* Update ADJ_* constantsStefan Sørensen2014-02-03
| | | | | | | * time.c (adjtimex_modes): Add ADJ_TAI, ADJ_SETOFFSET, ADJ_MICRO, ADJ_NANO, ADJ_OFFSET_SS_READ. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
* Add decoding of sockets descriptor 'paths' for network callsPhilippe Ombredanne2014-02-02
| | | | | | | | | | | | | | | * net.c (sys_bind, sys_listen, do_accept, sys_send, sys_sendto, sys_sendmsg, sys_sendmmsg, sys_recv, sys_recvfrom, sys_recvmsg, sys_recvmmsg, sys_shutdown, sys_getsockopt, sys_setsockopt): Decode socket descriptor arguments using printfd. * pathtrace.c (pathtrace_match): Also check TRACE_NETWORK syscalls that take socket descriptor arguments. * tests/net-fd.test: New test for socket descriptor arguments decoding. * tests/Makefile.am (TESTS): Add net-fd.test. (net-fd.log): New dependency on net.log. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* tests: rename all tests so that their names end in .test suffixDmitry V. Levin2014-02-02
| | | | | | | | | | | | | | | | | Due to automake limitations, some features work only for tests that end in one of the suffixes listed in TEST_EXTENSIONS. * tests/detach-running: Rename to detach-running.test. * tests/detach-sleeping: Rename to detach-sleeping.test. * tests/detach-stopped: Rename to detach-stopped.test. * tests/net: Rename to net.test. * tests/ptrace_setoptions: Rename to ptrace_setoptions.test. * tests/qual_syscall: Rename to qual_syscall.test. * tests/sigaction.sh: Rename to sigaction.test. * tests/stat: Rename to stat.test. * tests/strace-f: Rename to strace-f.test. * tests/Makefile.am (TESTS): Update. (LOG_COMPILER): Rename to TEST_LOG_COMPILER.
* net: add more sockopt optionsMike Frysinger2014-01-31
| | | | | | | | | | | | This syncs with the defines as available in linux-3.13. * net.c (sockipoptions): Add IP_IPSEC_POLICY, IP_XFRM_POLICY, IP_PASSSEC, IP_TRANSPARENT, IP_ORIGDSTADDR, IP_RECVORIGDSTADDR, IP_MINTTL, IP_NODEFRAG, IP_UNBLOCK_SOURCE, IP_BLOCK_SOURCE, IP_ADD_SOURCE_MEMBERSHIP, IP_DROP_SOURCE_MEMBERSHIP, MCAST_JOIN_GROUP, MCAST_BLOCK_SOURCE, MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP, MCAST_JOIN_SOURCE_GROUP, MCAST_LEAVE_SOURCE_GROUP, IP_MULTICAST_ALL, IP_UNICAST_IF.
* mips: fix sigaction reportingChris Dearman2014-01-08
| | | | | | | | | | | | | | | | MIPS userland uses the same sigaction structure with a full signal mask for old_sigaction and new_sigaction and does does not have an sa_restorer field. These changes have been tested on MIPS O32 big/little endian, MIPS N64 big endian and x86-64. * signal.c (old_sigaction) [MIPS]: Add definition for MIPS. (decode_old_sigaction) [MIPS]: Print sa_mask according to its definition. (new_sigaction) [MIPS]: Add definition for MIPS. Signed-off-by: Chris Dearman <chris.dearman@imgtec.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* Factor out struct sigaction printing codeDmitry V. Levin2014-01-08
| | | | | | | * signal.c [HAVE_SIGACTION] (decode_old_sigaction): New function. [HAVE_SIGACTION] (sys_sigaction): Use it. (decode_new_sigaction): New function. (sys_rt_sigaction): Use it.
* tests: add a test for rt_sigaction outputDmitry V. Levin2014-01-08
| | | | | | | | | | | | | | | | Since "struct sigaction" varies between architectures, rt_sigaction decoding sometimes produces incorrect output. This test is expected to catch basic rt_sigaction decoding bugs. Based on a patch proposed by Chris Dearman. * tests/sigaction.c: New file. * tests/sigaction.awk: Likewise. * tests/sigaction.sh: New test. * tests/Makefile.am (check_PROGRAMS): Add sigaction. (TESTS): Add sigaction.sh. (EXTRA_DIST): Add sigaction.awk. * tests/.gitignore: Add sigaction.
* mem: add missed MAP_HUGETLB mmap flagKirill A. Shutemov2014-01-05
| | | | | | | * mem.c (mmap_flags): Add MAP_HUGETLB mmap flag. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Delete old PTRACE_{PEEK,POKE}USR logicMike Frysinger2013-12-31
| | | | | | | | | | | The code base has settled on PTRACE_{PEEK,POKE}USER (with an E) and has logic in defs.h to make sure it's set sanely. Delete this old logic as the defs.h takes care of it now. * process.c: Delete PTRACE_PEEKUSR/PTRACE_POKEUSR defines. * signal.c: Likewise. * syscall.c: Delete PTRACE_PEEKUSR define. * util.c: Likewise.
* Decode the O_PATH flagMike Frysinger2013-12-31
| | | | * file.c (open_mode_flags): Add O_PATH.
* Remove unused configure checksDmitry V. Levin2013-11-13
| | | | | * configure.ac (AC_CHECK_FUNCS): Remove _sys_siglist and sys_siglist. (AC_CHECK_DECLS): Likewise.
* Assume that <sys/ptrace.h> provides a valid ptrace prototypeDmitry V. Levin2013-11-13
| | | | | | | | | | | | We used to explicitly list architectures where <sys/ptrace.h> from glibc is known to provide a valid prototype for ptrace, and use a homegrown replacement for all the rest. Situation seems to be better nowadays, glibc is not the only libc available, so let's use ptrace prototype from <sys/ptrace.h> by default, leaving the replacement for rare broken cases if any. * defs.h: Use ptrace prototype workaround iff NEED_PTRACE_PROTOTYPE_WORKAROUND is defined.
* Stop using _LFS64_LARGEFILEDmitry V. Levin2013-11-12
| | | | | | | | | | | There is only one place left in the code where strace guesses whether libc provides LFS64 functions and structures. The most natural thing to do there is to check for _LARGEFILE64_SOURCE - the macro provided by glibc. Other libc implementations that provide nondegenerate LFS64 interfaces are expected to define this macro as well. * defs.h (_LFS64_LARGEFILE): Remove. * strace.c: Use _LARGEFILE64_SOURCE instead of _LFS64_LARGEFILE.
* Define truncate64, ftruncate64, and getdents64 decoders unconditionallyDmitry V. Levin2013-11-12
| | | | | | | | | These decoders are referenced by most architectures, there were no undefined references so far because _LFS64_LARGEFILE appears to be always defined by glibc when _GNU_SOURCE is defined. * file.c (sys_truncate64, sys_ftruncate64, sys_getdents64): Define unconditionally.
* Define printflock64 only if it is referenced by other codeDmitry V. Levin2013-11-12
| | | | | | | | | * configure.ac (AC_CHECK_TYPES): Add struct flock64. * desc.c (HAVE_F_SETLK64, HAVE_F_SETLKW64, HAVE_F_GETLK64): New macros. [!HAVE_STRUCT_FLOCK64] (struct flock64): Define. (printflock64): Define only if referenced by other code. (sys_fcntl): Handle F_FREESP64, F_SETLK64, F_SETLKW64, and F_GETLK64 iff these constants are defined and differ from their non-64bit versions.
* Make PTRACE_PEEKUSER/PTRACE_POKEUSER checks less glibc specificDmitry V. Levin2013-11-12
| | | | | | | | | * configure.ac (AC_CHECK_DECLS): Add PTRACE_PEEKUSER and PTRACE_POKEUSER. * defs.h: Define PTRACE_PEEKUSER and PTRACE_POKEUSER only if they are not provided by <sys/ptrace.h>. Reported by John Spencer.
* Remove unneeded redefinitions of IPPROTO_* macrosDmitry V. Levin2013-11-12
| | | | | | | | | | IPPROTO_* macros are defined by <netinet/in.h>, no need to redefine them. * net.c (IPPROTO_EGP, IPPROTO_PUP, IPPROTO_IDP, IPPROTO_IGMP, IPPROTO_RAW, IPPROTO_MAX): Remove. Reported by John Spencer.
* Remove unused AC_OFF_T_IS_LONG_LONG configure checkDmitry V. Levin2013-11-12
| | | | | * configure.ac: Remove AC_OFF_T_IS_LONG_LONG. * m4/long_long.m4: Likewise.
* Remove unused codeDmitry V. Levin2013-11-12
| | | | | | * configure.ac (AC_CHECK_TYPES): Remove struct opthdr and struct t_opthdr. * net.c (print_sock_optmgmt): Remove.
* Use struct sigcontext instead of struct sigcontext_structDmitry V. Levin2013-11-12
| | | | | | | | * configure.ac (AC_CHECK_TYPES): Remove struct sigcontext_struct. * signal.c (sys_sigreturn) [S390 || S390X || POWERPC || ALPHA): Replace struct sigcontext_struct with struct sigcontext. Reported by John Spencer.
* Use standard names of sched_param structure membersDmitry V. Levin2013-11-12
| | | | | | | | * process.c (sys_sched_setscheduler, sys_sched_getparam, sys_sched_setparam): Use portable struct sched_param member name sched_priority instead of glibc specific __sched_priority. Reported by John Spencer.
* Make SIGEV_THREAD_ID decoding less glibc specificDmitry V. Levin2013-11-12
| | | | | | | | | | | | | SIGEV_THREAD_ID decoding requires access to an internal member of struct sigevent. There seems to be no portable way to do it besides adding a configure check. * configure.ac (AC_CHECK_MEMBERS): Check for struct sigevent._sigev_un._pad and struct sigevent.__pad. * time.c (printsigevent): Use an appropriate struct sigevent member to print thread id. Reported by John Spencer.
* Remove unused configure checksDmitry V. Levin2013-11-11
| | | | | * configure.ac (AC_CHECK_MEMBERS): Remove T_conn_res.QUEUE_ptr, T_conn_res.ACCEPTOR_id, dqblk.dqb_curblocks, sigcontext.sc_hi2.
* Assume "long long" availabilityDmitry V. Levin2013-11-11
| | | | | | | | Most of the code already uses long long types unconditionally. * configure.ac: Remove the check for long long. * file.c (printstat64): Remove HAVE_LONG_LONG checks, use %llu format string unconditionally.
* Include <sys/poll.h> only if there is no <poll.h>Dmitry V. Levin2013-11-11
| | | | | * pathtrace.c: Do not include <sys/poll.h> if <poll.h> is available. * stream.c: Likewise.
* Move io_* syscalls decoding to a separate fileDmitry V. Levin2013-11-11
| | | | | | | * desc.c (sys_io_setup, sys_io_destroy, sys_io_submit, sys_io_cancel, sys_io_getevents, declarations from libaio.h): Move to ... * aio.c: new file. * Makefile.am (strace_SOURCES): Add aio.c.
* Stop using external libaio.h.Denys Vlasenko2013-11-11
| | | | | | | | | | | | | | | This change incorporates a partial copy instead of using external libaio.h. Why? Because we want to properly decode 32-bit aio calls by 64-bit strace. For that, we need more definitions than libaio.h provides. (These defs are not done yet, but will eventually be done). Keeping our local 32-bit compat defs in sync with libaio.h _without seeing libaio structs_ is hard/more bug prone. A smaller benefit is that we don't need libaio installed. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* sys_io_submit: simplify iocb_cmd_lookup() helper.Denys Vlasenko2013-11-11
| | | | | | | | | | | | | This helper returns two values (a string and an enum). The caller prints the string. It's simpler to just print the string in the caller itself. This eliminates "return by reference" and more importantly, an intermediate static string buffer for the string result. Since function of the helper is different now, it is renamed to tprint_lio_opcode(). Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* sys_io_submit: stop traversing iocb vector after first failure.Denys Vlasenko2013-11-11
| | | | | | | | | The program may use a very large nr but supply either outright invalid iocbpp[], or one with far fewer elements than nr. We used to try reading iocbpp[i] until i == nr. With this change, we stop on the first failure. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Fix pathtrace_match() to match recent fixes to select decoding.Denys Vlasenko2013-11-09
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Fix select decoding on e.g. 32-bit ppc process by 64-bit strace.Denys Vlasenko2013-11-09
| | | | | | | | | | Added next_set_bit() function which finds the next set bit, properly taking into account word size of the traced process. Use it in decode_select() instead of fd_isset(). Also, properly round fdsize up to word size of traced process, not to strace's word size. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Speed up and explain fd_isset()Denys Vlasenko2013-11-06
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Add a test for the latest select decoding fixDr. David Alan Gilbert2013-11-05
| | | | * test/select.c (main): Add a test for nfds larger than FD_SETSIZE.
* Fix select decoding for glibc in _FORTIFY_SOURCE modeDmitry V. Levin2013-11-05
| | | | | | | | | | | glibc in _FORTIFY_SOURCE mode raises SIGABRT when descriptor greater or equal to FD_SETSIZE is passed to FD_ISSET. Select family syscalls, however, can legitimately accept such descriptors. To overcome this limitation, we have to replace FD_ISSET with an equivalent that imposes no such restrictions. * desc.c (fd_isset): New function. (decode_select): Use it instead of FD_ISSET.
* More select decoding fixesDmitry V. Levin2013-11-05
| | | | | | | | * desc.c (decode_select): Actually print arg[0] as int on entering syscall. When arg[0] is negative, do not attempt to fetch and decode descriptor sets on entering syscall, kernel will reject it anyway. On exiting syscall, stop checking descriptor sets as soon as all returned descriptors are found.
* Truncate arg[0] to int in select decoding.Denys Vlasenko2013-11-05
| | | | | | This matches kernel's behavior. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* test/select.c: make comment more understandable.Denys Vlasenko2013-11-05
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>