aboutsummaryrefslogtreecommitdiffstats
path: root/linux
Commit message (Collapse)AuthorAgeFilesLines
* Disable STREAMS syscalls for non-SPARCDenys Vlasenko2013-03-051-2/+8
| | | | | | | | text data bss dec hex filename 3002 0 1024 4026 fba stream.o.old 1729 0 1024 2753 ac1 stream.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix printstrbufarg's address argument to be long, not intDenys Vlasenko2013-03-051-8/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* metag,or1k: whitesace style fix. no code changesDenys Vlasenko2013-03-052-517/+519
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Assorted fixes to syscallent.hDenys Vlasenko2013-03-0523-97/+97
| | | | | | | | | | | | | | or1k was missing TM on many memory-related syscalls sys_lookup_dcookie is 3-arg on 64-bit arches, and isn't TF sys_recvmsg is 3-arg on all arches sys_nfsservctl is 3-arg on all arches sys_timerfd_create is 2-arg on all arches sys_[f]truncate64 is 4-arg or 3-arg, never 5-arg truncate64 is TF sys_[l]lseek is TD fstat[64] is TD Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Add support for Imagination Technologies MetaJames Hogan2013-03-052-0/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Imagination Technologies Meta architecture (the architecture/ABI is usually referred to as metag in code). The Meta Linux kernel port is in the process of being upstreamed for v3.9 so it uses generic system call numbers. sys_lookup_dcookie writes a filename to buffer argument, so I've set TF flag. nfsservctl appears to be set to sys_ni_syscall in asm-generic/unistd.h so I've left it blank. truncate64/ftruncate64/pread64/pwrite64/readahead have unaligned 64bit args which are packed tightly on metag, so less arguments on metag. fchdir/llseek takes a file descriptor so s/TF/TD/ sync_file_range has 2 64bit args so uses 6 args, so s/4/6/ timerfd_create/msgget/msgctl/msgrcv/semget/segtimedop/semop/shmget/ shmctl/shmat/shmdt/recvmsg/migrate_pages have different number of args. oldgetrlimit is just getrlimit for metag. add TM flag to various memory syscalls. metag doesn't directly use sys_mmap_pgoff for mmap2. prlimit64/process_vm_readv/process_vm_writev take a pid so add TP flag. fanotify_init doesn't appear to take a file descriptor so remove TD. Add kcmp syscall. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Christian Svensson <blue@cmd.nu> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ARM: make it one-personality archDenys Vlasenko2013-02-215-22/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ARM in fact _is_ one personality. We had two personalities for it because it has a handful of syscalls with huge scnos (0x000f00xx). Extending syscall table to have [0x000f0005] index is of course not a good idea. Someone decided to handle that by having a separate personality just for these syscalls. But multi-personality arch does a bit more work in other parts. This patch is another alternative: "move" 0x000f00nn syscalls down to the entries just above last ordinary syscall, by manipulating scno if it falls into the 0x000f00xx range. In order to not worsen genuine undefined scnos' printing, the code remaps scno back to actual value before printing "syscall_NNN" string. * defs.h: Remove multi-reprsonality defines from ARM. * syscall.c (shuffle_scno): New function. (undefined_scno_name): New function. (get_scno): [ARM] Replace personality setting with scno shuffling. (trace_syscall_entering): Print unknown syscall name using undefined_scno_name(). (trace_syscall_exiting): Likewise. * linux/arm/syscallent.h: Add ARM specific syscalls at the end. * linux/arm/errnoent1.h: Deleted. * linux/arm/ioctlent1.h: Deleted. * linux/arm/signalent1.h: Deleted. * linux/arm/syscallent1.h: Deleted. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* arm: shorten syscall table for EABI - no point in storing NULL entriesDenys Vlasenko2013-02-202-3/+3
| | | | | | | Also, reformatted ARM code in get_scno(), mostly improved comments, without code changes. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Use the same style of includes in linux/*/* filesDenys Vlasenko2013-02-2021-26/+26
| | | | | | | | While at it, fix some comments which say "we use i386 syscalls/ioctls/errnos" but in reality common ones are used. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Clean up mmap decodingDenys Vlasenko2013-02-1918-33/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous code merges too many similar, but different ways of decoding mmap. For example, sys_old_mmap is "params in memory" API... except SH[64], where it is "params in regs", i.e. what sys_mmap ("new mmap") function does on other arches! It's much simpler when every mmap handler has same API regardless of arch. Where API means whether params are in regs or in memory, and whether offset is in bytes, pages, or 4k blocks. Then we just insert correct function pointers into arch syscall tables. It turns out there are four common mmap APIs over all architectures which exist in Linux kernel, and one outlier for S390. A number of mmap decoders were plain wrong in arch tables. For example, BFIN has no old_mmap. It returns ENOSYS. I checked kernel sources for all arches nad fixed the tables. There was dead code for x86_64 for old_mmap: x86_64 has no old_mmap. * mem.c: Refactor mmap functions so that we have five mmap syscall handlers, each with the fixed API (not varying by arch). * pathtrace.c (pathtrace_match): Adjust sys_func == mmap_func checks. * linux/syscall.h: Declare new mmap syscall handler functions. * linux/arm/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/avr32/syscallent.h: mmap is sys_mmap_pgoff. * linux/bfin/syscallent.h: old_mmap is ENOSYS, mmap2 is sys_mmap_pgoff. * linux/hppa/syscallent.h: mmap2 is sys_mmap_4koff. * linux/i386/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/ia64/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/m68k/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/microblaze/syscallent.h: old_mmap is sys_mmap, mmap2 is sys_mmap_pgoff. * linux/mips/syscallent.h: mmap is sys_mmap_4kgoff. * linux/or1k/syscallent.h: mmap2 is sys_mmap_pgoff. * linux/powerpc/syscallent.h: mmap2 is sys_mmap_4kgoff. * linux/s390/syscallent.h: mmap2 is sys_old_mmap_pgoff. * linux/s390x/syscallent.h: mmap is sys_old_mmap and thus has 1 arg. * linux/sh/syscallent.h: old_mmap2 is sys_mmap, mmap2 is sys_mmap_4koff. * linux/sh64/syscallent.h: Likewise. * linux/sparc/syscallent1.h: mmap is TD|TM. * linux/tile/syscallent1.h: mmap2 is sys_mmap_4koff. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove wrong x32-specific lseekDenys Vlasenko2013-02-172-5/+0
| | | | | | | | | | | | Testing confirmed what I suspected: x32 lseek uses kernel-sized (i.e. wide) long for offset parameter. * file.c: Delete sys_lseek32. * linux/syscall.h: Likewise. * linux/x32/syscallent1.h: Likewise. * test/x32_lseek.c: New file. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Cosmetic fixes to syscall tables, no code changesDenys Vlasenko2013-02-174-30/+27
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Make linux/mips/syscallent.h smallerDenys Vlasenko2013-02-161-5356/+195
| | | | | | | * linux/mips/syscallent.h: Remove trailing empty elements. Compactify huge stretches of NULL elements in the middle. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Whitespace fix, no code changesDenys Vlasenko2013-02-142-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Add support for the OpenRISC 1000 platformChristian Svensson2013-02-143-0/+265
| | | | | | | | | | | | | | | | | | | | | * configure.ac: Added or1k architecture.. * defs.h: Added or1k to use register reading system. * linux/or1k/ioctlent.h.in: Use i386 ioctls. * linux/or1k/syscallent.h: New file. * process.c: Added or1k register defs to struct_user_offsets[]. * syscall.c: Added or1k_io iovec for or1k GETREGSET,   regset structure for or1k.   (printcall): Added handling for or1k.   (get_regs): Likewise.   (get_scno): Likewise.   (get_syscall_args): Likewise.   (get_syscall_result): Likewise. (get_error): Likewise. * util.c (change_syscall): Added dummy handling for or1k. * system.c (sys_or1k_atomic): New function (or1k specific syscall). Signed-off-by: Christian Svensson <blue@cmd.nu> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Improve perf_event_open argument decodingBen Noordhuis2013-02-052-1/+1
| | | | | | | | | | | | * configure.ac (AC_CHECK_HEADERS): Add linux/perf_event.h. * desc.c [HAVE_LINUX_PERF_EVENT_H]: Include <linux/perf_event.h>. (perf_event_open_flags): New xlat structure. (sys_perf_event_open): New function. * linux/dummy.h (sys_perf_event_open): Remove. * linux/syscall.h (sys_perf_event_open): New prototype. Signed-off-by: Ben Noordhuis <info@bnoordhuis.nl> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* Add tilegx support to straceChris Metcalf2013-02-055-302/+550
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tilegx support has been in the kernel since 3.0. In addition, fix some issues with the tilepro support already present in strace, primarily the decision to use the <asm/unistd.h> numbering space for system calls. * defs.h [TILE]: Include <asm/ptrace.h> and provide an extern struct pt_regs tile_regs for efficiency. Provide compat 32-bit personality via SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE, PERSONALITY1_WORDSIZE, and DEFAULT_PERSONALITY. * linux/tile/errnoent1.h: New file, includes linux/errnoent.h. * linux/tile/ioctlent1.h: New file, includes linux/ioctlent.h. * linux/tile/signalent1.h: New file, includes linux/signalent.h. * linux/tile/syscallent.h: Update with new asm-generic syscalls. The version previously committed was the from the first tile patch to LKML, which subsequently was changed to use <asm-generic/unistd.h>. * linux/tile/syscallent1.h: Copy from linux/tile/syscallent.h. * mem.c (addtileflags) [TILE]: use %ld properly for a "long" variable. * process.c [TILE]: Choose clone arguments correctly and properly suppress all "struct user" related offsets in user_struct_offsets. * signal.c [TILE]: Use tile_regs not upeek. * syscall.c (update_personality) [TILE]: Print mode. (PT_FLAGS_COMPAT) [TILE]: Provide if not in system headers. (tile_regs) [TILE]: Define 'struct pt_regs' variable to hold state. (get_regs) [TILE]: use PTRACE_GETREGS to set tile_regs rather than using upeek. (get_scno) [TILE]: Set personality. (get_syscall_args) [TILE]: Use tile_regs. (get_syscall_result) [TILE]: Update tile_regs. (get_error) [TILE]: Use tile_regs. (printcall) [TILE]: Print pc. (arg0_offset, arg1_offset, restore_arg0, restore_arg1) [TILE]: Properly handle tile call semantics and support tilegx. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Add support for tracing 32-bit ARM EABI binaries on AArch64Steve McIntyre2012-11-125-330/+335
| | | | | | | | | | | | | | | | | | | | | | | | * defs.h [AARCH64]: Copy in the definition of arm_pt_regs and the accessor macros, so it's possible to build on AArch64 without ARM system headers. Set SUPPORTED_PERSONALITIES to 2. Define PERSONALITY0_WORDSIZE and PERSONALITY1_WORDSIZE. Set DEFAULT_PERSONALITY to 1. * linux/aarch64/errnoent1.h: New file, includes generic errnoent.h. * linux/aarch64/ioctlent1.h: New file, includes generic ioctlent.h. * linux/aarch64/signalent1.h: New file, includes generic signalent.h. * linux/aarch64/syscallent1.h: Rename from linux/aarch64/syscallent.h. * linux/aarch64/syscallent.h: New file, includes arm/syscallent.h. * syscall.c [AARCH64]: Define aarch64_regs. (update_personality) [AARCH64]: Add debug output. (get_scno) [AARCH64]: Determine if we're in ARM or AArch64 mode by checking the size of the returned uio structure from PTRACE_GETREGSET and interpret the structure accordingly. (get_syscall_result): Likewise. (get_syscall_args): Merge the AArch64 and ARM sections so that on AArch64 we can fall back to supporting the ARM personality. (get_error): Likewise. Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
* Move asm-generic ioctl definitions to linux/ioctlent.h.inDmitry V. Levin2012-11-126-314/+80
| | | | | | | | | | * linux/ioctlent.h.in: Add asm-generic ioctl entries from all linux/*/ioctlent.h.in files. * linux/bfin/ioctlent.h.in: Remove asm-generic ioctl entries. * linux/i386/ioctlent.h.in: Likewise. * linux/powerpc/ioctlent.h.in: Likewise. * linux/s390/ioctlent.h.in: Likewise. * linux/sparc/ioctlent.h.in: Likewise.
* Filter out redundant "*32" ioctl entriesDmitry V. Levin2012-10-272-14/+19
| | | | | | * linux/ioctlent-filter.awk: New file. * Makefile.am: Use it. * linux/ioctlent.h.in: Removed redundant "*32" entries.
* Enhance quotactl decodingDmitry V. Levin2012-10-2620-27/+27
| | | | | | * quota.c (sys_quotactl): Decode 2nd syscall argument using printpath. * pathtrace.c (pathtrace_match): Add quotactl support. * linux/*/syscallent.h: Add TF flag to quotactl entry.
* Add AArch64 support to straceSteve McIntyre2012-10-262-0/+331
| | | | | | | | | | | | | | | | | | | AArch64 has been included in linux from 3.7 onwards. Add support for AArch64 in strace, tested on linux in a simulator. * configure.ac: Support AArch64. * defs.h [AARCH64]: Include <sys/ptrace.h>, define TCB_WAITEXECVE. * ipc.c (indirect_ipccall): Support AArch64. * process.c (struct_user_offsets): Likewise. * syscall.c [AARCH64]: Include <asm/ptrace.h>, <sys/uio.h>, and <elf.h>. Define struct user_pt_regs regs. (get_scno, get_syscall_result): Support AArch64 using PTRACE_GETREGSET. (get_syscall_args, get_error): Support AArch64. * linux/aarch64/ioctlent.h.in: New file. * linux/aarch64/syscallent.h: New file, based on linux 3.7 version of asm-generic/unistd.h. Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
* linux: add new errno values for EPROBE_DEFER and EOPENSTALESteve McIntyre2012-10-261-2/+2
| | | | | | | | | New definitions match updates in Linux 3.4 and Linux 3.5 respectively. * linux/errnoent.h (ERRNO_517): Change to EPROBE_DEFER. (ERRNO_518): Change to EOPENSTALE. Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
* Add -e trace=memory optionNamhyung Kim2012-10-2619-467/+467
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new 'memory' category for tracing memory mapping related syscalls. Affected syscalls are: break, brk, get_mempolicy, madvise, mbind, migrate_pages, mincore, mlock, mlockall, mmap, move_pages, mprotect, mremap, msync, munlock, munlockall, munmap, remap_file_pages, and set_mempolicy. * defs.h (TRACE_MEMORY): New macro. * syscall.c (lookup_class): Handle trace=memory option. * strace.1: Document it. * linux/alpha/syscallent.h: Add TM flag to memory mapping related syscalls. * linux/arm/syscallent.h: Likewise. * linux/avr32/syscallent.h: Likewise. * linux/bfin/syscallent.h: Likewise. * linux/hppa/syscallent.h: Likewise. * linux/i386/syscallent.h: Likewise. * linux/ia64/syscallent.h: Likewise. * linux/m68k/syscallent.h: Likewise. * linux/microblaze/syscallent.h: Likewise. * linux/mips/syscallent.h: Likewise. * linux/powerpc/syscallent.h: Likewise. * linux/s390/syscallent.h: Likewise. * linux/s390x/syscallent.h: Likewise. * linux/sh/syscallent.h: Likewise. * linux/sh64/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. * linux/tile/syscallent.h: Likewise. * linux/x32/syscallent.h: Likewise. * linux/x86_64/syscallent.h: Likewise. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
* x32: add 64bit annotation tooMike Frysinger2012-09-281-42/+42
| | | | | | | | | | Since someone can invoke these entry points directly with syscall(), at least decode their name and show that they're 64bit versions rather than just showing syscall_###. * linux/x32/syscallent.h: Sync all missing entries below 312 with x86_64. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* x32: update {g,s}etsockopt syscall numbersMike Frysinger2012-08-241-2/+4
| | | | | | | | | | | Starting with linux 3.6 (and backported to earlier kernels), these two syscalls have changed numbers (moving from native to compat entry points). Update the strace syscall list accordingly. * linux/x32/syscallent.h: Move setsockopt from 54 to 541, and move getsockopt from 55 to 542. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* x32: update syscall tableMike Frysinger2012-06-051-12/+12
| | | | | | | | | | | | This syncs with the syscall table as it is in linux 3.4. * linux/x32/syscallent.h (59): Fix comment typo. (78): Add missing getdents entry. (174): Delete create_module entry (not in the kernel). (181, 182, 183, 184, 185): Add missing entries. (524, 536, 539, 540): Fix spacing. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* x32: add ia32 supportH.J. Lu2012-04-185-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent1.h, linux/x32/ioctlent1.h, linux/x32/signalent1.h and linux/x32/syscallent1.h. * configure.ac: Remove AC_GNU_SOURCE, obsoleted by AC_USE_SYSTEM_EXTENSIONS. * defs.h (SUPPORTED_PERSONALITIES): Set to 2 for X32. (PERSONALITY1_WORDSIZE): Set to 4 for X32. * file.c (stat64): New struct for X32. (sys_lseek32): New function for X32. (stat64): Undef. (sys_fstat64): Likewise. (sys_stat64): Likewise. (realprintstat64): New function for X32. (sys_fstat64): Likewise. (sys_stat64): Likewise. * mem.c (sys_old_mmap): New function for X32. * pathtrace.c (pathtrace_match): Also check sys_old_mmap for X32. * syscall.c (update_personality): Add X32 support. (get_scno): Support currpers == 1 for X32. * linux/syscall.h (sys_lseek32): New function prototype for X32. * linux/x32/errnoent1.h: New file. * linux/x32/ioctlent1.h: Likewise. * linux/x32/signalent1.h: Likewise. * linux/x32/syscallent1.h: Likewise.
* Add x32 support to straceH.J. Lu2012-04-168-0/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | X32 support is added to Linux kernel 3.4. In a nutshell, x32 is x86-64 with 32bit pointers. At system call level, x32 is also identical to x86-64, as shown by many changes like "defined(X86_64) || defined(X32)". The main differerence bewteen x32 and x86-64 is off_t in x32 is long long instead of long. This patch adds x32 support to strace. Tested on Linux/x32. * configure.ac: Support X32. * defs.h: Set SUPPORTED_PERSONALITIES to 3 for X86_64, Set PERSONALITY2_WORDSIZE to 4 for X86_64. Add tcb::ext_arg for X32. * file.c (stat): New for X32. (sys_lseek): Use 64-bit version for X32. (printstat64): Check current_personality != 1 for X86_64. * ipc.c (indirect_ipccall): Check current_personality == 1 for X86_64. * mem.c (sys_mmap64): Also use tcp->u_arg for X32. Print NULL for zero address. Call printllval for offset for X32. * pathtrace.c (pathtrace_match): Don't check sys_old_mmap for X32. * process.c (ARG_FLAGS): Defined for X32. (ARG_STACK): Likewise. (ARG_PTID): Likewise. (change_syscall): Handle X32. (struct_user_offsets): Support X32. (sys_arch_prctl): Likewise. * signal.c: Include <asm/sigcontext.h> for X32. (SA_RESTORER): Also define for X32. * syscall.c (update_personality): Support X32 for X86_64. (is_restart_error): Likewise. (syscall_fixup_on_sysenter): Likewise. (get_syscall_args): Likewise. (get_syscall_result): Likewise. (get_error): Likewise. (__X32_SYSCALL_BIT): Define if not defined. (__X32_SYSCALL_MASK): Likewise. (get_scno): Check DS register value for X32. Use __X32_SYSCALL_MASK on X32 system calls. * util.c (printllval): Use ext_arg for X32. (printcall): Support X32. (change_syscall): Likewise. (arg0_offset): Likewise. (arg1_offset): Likewise. * Makefile.am (EXTRA_DIST): Add linux/x32/errnoent.h, linux/x32/ioctlent.h.in, linux/x32/signalent.h, linux/x32/syscallent.h, linux/x86_64/errnoent2.h, linux/x86_64/ioctlent2.h, linux/x86_64/signalent2.h and linux/x86_64/syscallent2.h. * linux/x32/errnoent.h: New. * linux/x32/ioctlent.h.in: Likewise. * linux/x32/signalent.h: Likewise. * linux/x32/syscallent.h: Likewise. * linux/x86_64/errnoent2.h: Likewise. * linux/x86_64/ioctlent2.h: Likewise. * linux/x86_64/signalent2.h: Likewise. * linux/x86_64/syscallent2.h: Likewise. Signed-off-by: H.J. Lu <hongjiu.lu@intel.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Decode mtd ioctlsMike Frysinger2012-04-061-0/+278
| | | | | | | | | | | | | | | | I got tired of figuring out mtd structures (which show up a lot in the embedded space), so add decoders for those ioctls. * defs.h (mtd_ioctl): New prototype. (print_loff_t): Likewise. * io.c (print_loff_t): Delete static keyword * ioctl.c (ioctl_decode): Call mtd_ioctl when code is 'M'. * Makefile.am (strace_SOURCES): Add mtd.c. (EXTRA_DIST): Add linux/mtd-abi.h. * mtd.c: New file. * linux/mtd-abi.h: New file. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* powerpc: Add syscall entries for direct socket system callsAnton Blanchard2012-03-271-19/+19
| | | | * linux/powerpc/syscallent.h: Add direct socket system calls.
* Shrink space needed by undefined syscalls in syscall tables.Denys Vlasenko2012-03-1918-6745/+6745
| | | | | | | | | | | | | | | | | | | | | | | | Undefined syscall looked like this before this change: { 5, 0, printargs, "SYS_53" }, That is, "SYS_53" string had to be allocated and stored in strace binary. Since now SCNO_IN_RANGE() macro requires sysent[scno].sys_func != NULL for valid syscalls, we can replace printargs with NULL in such lines and make them "invalid", thus not requiring syscall name string. Savings on i386: text data bss dec hex filename 237389 704 18944 257037 3ec0d strace.before 236973 704 18944 256621 3ea6d strace Savings on mips: 336551 153692 38320 528563 810b3 strace.before 275543 153688 38320 467551 7225f strace Tested to still decode undefined syscalls correctly (syscall no. 222 on i386). * linux/*/syscallent.h: Replace 'printargs, "SYS_nnn"' with 'NULL, NULL'. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix mips64 build failure: sys_pwrite64 doesn't exist.Denys Vlasenko2012-03-181-1/+1
| | | | | | | | | sys_pwrite seems to do the same thing as sys_pwrite64 which we deleted when we removed non-Linux code. * linux/mips/syscallent.h: s/sys_pwrite64/sys_pwrite/ Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Revert "Remove underscores from a few syscall names which have them"Denys Vlasenko2012-03-1717-38/+38
| | | | This reverts commit 31972d52b1059d8faca1c5f417c2db1a90b868ae.
* Remove underscores from a few syscall names which have themDenys Vlasenko2012-03-1717-38/+38
| | | | | | | | | | | | | | | | | | | | Affected names are "_newselect", "_llseek", "_sysctl". I see no apparent reason why they have leading underscores. Moreover, some arches have underscored names and some have non-underscored ones. This is not consistent. I verified that every architectire I touched did not have a similarly named syscall without underscore, thus this change does not introduce new ambiquities. I left "_exit" untouched for now, but the same points stand for it too: some architectures use "exit" and no one complains. So why many arches are using "_exit"? * linux/*/syscallent.h: Remove underscores from displayed syscall names for _newselect, _llseek, _sysctl. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Implement prlimit64 decoding, rewrite [gs]etrlimit decodingDmitry V. Levin2012-03-162-3/+3
| | | | | | | | | | | | | | | * configure.ac: Remove AC_RLIM_T_IS_LONG_LONG call. Define SIZEOF_RLIM_T. * m4/long_long.m4 (AC_RLIM_T_IS_LONG_LONG): Remove. * linux/dummy.h (sys_prlimit64): Remove. * linux/syscall.h (sys_prlimit64): New prototype. * resource.c (resources): Reindent, add RLIMIT_RTTIME. (sprintrlim, print_rlimit32, sys_getrlimit, sys_setrlimit): Remove. [HAVE_LONG_LONG_RLIM_T]: Remove dead code. [_LFS64_LARGEFILE || HAVE_LONG_LONG_RLIM_T]: Likewise. (sprint_rlim64, print_rlimit64, decode_rlimit64, sprint_rlim32, print_rlimit32, decode_rlimit, sys_getrlimit, sys_setrlimit, sys_prlimit64): New functions.
* Tidy up includes and copyright notices, fix indentationDenys Vlasenko2012-03-1620-43/+0
| | | | | | | | | | | | | | | The files not mentioned in changelog below had only copyright notices fixes and indentation fixes. * defs.h: Include <stdint.h> and <inttypes.h>. * file.c: Do not include <inttypes.h>. Move struct kernel_dirent declaration below top include block. * block.c: Do not include <stdint.h> and <inttypes.h>. * quota.c: Likewise. * desc.c: Likewise. * signal.c: Likewise. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* alpha: fix decode of osf_sigprocmaskMike Frysinger2012-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The alpha sigprocmask syscall is special in that it comes from OSF rather than the style that everyone else uses. Tested with this simple code: $ cat test.c #include <signal.h> main() { sigset_t set, oldset; sigemptyset(&set); sigaddset(&set, SIGINT); sigaddset(&set, SIGHUP); sigprocmask(SIG_SETMASK, &set, &oldset); sigprocmask(SIG_UNBLOCK, &oldset, &set); sleep(3); } $ gcc test.c && ./strace ./a.out ... osf_sigprocmask(SIG_SETMASK, [HUP INT]) = 0 (old mask []) osf_sigprocmask(SIG_UNBLOCK, []) = 0x3 (old mask [HUP INT]) osf_sigprocmask(SIG_BLOCK, [CHLD]) = 0x3 (old mask [HUP INT]) ... * linux/alpha/syscallent.h: Call sys_sigprocmask for osf_sigprocmask, and change number of arguments to two. * signal.c (sys_sigprocmask): Fix decoding of alpha osf sigprocmask. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* ia64: fix compilation warningsDmitry V. Levin2012-03-151-6/+0
| | | | | | * linux/ia64/syscallent.h: Remove improper defines and undefs. Reported-by: Mike Frysinger <vapier@gentoo.org>
* Implement sys_rt_tgsigqueueinfo syscall decoderDmitry V. Levin2012-03-132-1/+1
| | | | | | | | | * linux/dummy.h (sys_rt_tgsigqueueinfo): Remove. * linux/syscall.h (sys_rt_tgsigqueueinfo): New prototype. * signal.c (print_sigqueueinfo): New function, based on sys_rt_sigqueueinfo. (sys_rt_sigqueueinfo): Use print_sigqueueinfo. (sys_rt_tgsigqueueinfo): New function.
* Implement syslog syscall decoderDmitry V. Levin2012-03-132-1/+1
| | | | | | | * linux/dummy.h (sys_syslog): Remove. * linux/syscall.h (sys_syslog): New prototype. * system.c (syslog_action_type): New xlat structure. (sys_syslog): New function.
* Implement sendmmsg syscall decoderDmitry V. Levin2012-03-112-1/+1
| | | | | | | | | | | * linux/dummy.h (sys_sendmmsg): Remove. * linux/syscall.h (sys_sendmmsg): New prototype. * net.c (printmmsghdr): Add index argument specifying the element in mmsghdr array to print. (decode_mmsg): New function, prints the whole mmsghdr array, its length and message flags. (sys_sendmmsg): New function. (sys_recvmmsg): Use decode_mmsg to fix mmsghdr array decoding.
* Implement sched_rr_get_interval syscall decoderDmitry V. Levin2012-03-112-1/+1
| | | | | | * linux/dummy.h (sys_sched_rr_get_interval): Remove. * linux/syscall.h (sys_sched_rr_get_interval): New prototype. * process.c (sys_sched_rr_get_interval): New function.
* Implement migrate_pages syscall decoderDmitry V. Levin2012-03-112-1/+1
| | | | | | * linux/dummy.h (sys_migrate_pages): Remove. * linux/syscall.h (sys_migrate_pages): New prototype. * mem.c (sys_migrate_pages): New function.
* Implement get_robust_list syscall decoderDmitry V. Levin2012-03-112-1/+1
| | | | | | * linux/dummy.h (sys_get_robust_list): Remove. * linux/syscall.h (sys_get_robust_list): New prototype. * process.c (sys_get_robust_list): New function.
* Define sys_set_robust_list as an alias to sys_munmapDmitry V. Levin2012-03-111-1/+1
| | | | * linux/dummy.h (sys_set_robust_list): Redefine to sys_munmap.
* Implement clock_adjtime syscall decoderDmitry V. Levin2012-03-112-1/+1
| | | | | | | | * linux/dummy.h (sys_clock_adjtime): Remove. * linux/syscall.h (sys_clock_adjtime): New prototype. * time.c (do_adjtimex): New function, based on sys_adjtimex. (sys_adjtimex): Use it. (sys_clock_adjtime): New function.
* Define sys_setns as an alias to sys_inotify_rm_watchDmitry V. Levin2012-03-111-1/+1
| | | | * linux/dummy.h (sys_setns): Redefine to sys_inotify_rm_watch.
* Sort definitions of dummy parsers. No code changesDmitry V. Levin2012-03-111-16/+16
| | | | * linux/dummy.h: Sort definitions of parsers implemented as aliases.
* Alias sys_fsync to sys_closeDmitry V. Levin2012-03-115-5/+5
| | | | | | | | | * file.c (sys_fsync): Remove. * linux/syscall.h (sys_fsync): Likewise. * linux/dummy.h (sys_fsync): Alias to sys_close. * linux/m68k/syscallent.h: Add TD flag to fsync entry. * linux/microblaze/syscallent.h: Likewise. * linux/mips/syscallent.h: Likewise.
* Update ioctl entriesDmitry V. Levin2012-03-102-58/+44
| | | | | * linux/ioctlent.h.in: Regenerate from v3.3 headers. * linux/i386/ioctlent.h.in: Likewise.