]> granicus.if.org Git - strace/log
strace
11 years agoGet rid of TCB_INUSE and TCB_STRACE_CHILD
Denys Vlasenko [Wed, 26 Jun 2013 12:14:29 +0000 (14:14 +0200)]
Get rid of TCB_INUSE and TCB_STRACE_CHILD

We can use tcb::pid == 0 as an indicator of free tcb,
and we already have strace_child variable which holds
pid of our child, if any.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agoFix debug output of wait4 result (was reusing buf[] on unknown events)
Denys Vlasenko [Fri, 21 Jun 2013 14:41:50 +0000 (16:41 +0200)]
Fix debug output of wait4 result (was reusing buf[] on unknown events)

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agoShow PTRACE_EVENT_STOP correctly in debug output
Denys Vlasenko [Fri, 21 Jun 2013 14:33:56 +0000 (16:33 +0200)]
Show PTRACE_EVENT_STOP correctly in debug output

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agoPanic a bit less when we see an unknown pid
Denys Vlasenko [Fri, 21 Jun 2013 14:19:46 +0000 (16:19 +0200)]
Panic a bit less when we see an unknown pid

I stumbeld over this case when I used "exec stace ...".

* strace.c (trace): Do not exit if we see an unknown pid in wait4.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agodetach(): Reorganize code. Logic is the same.
Denys Vlasenko [Fri, 21 Jun 2013 14:11:10 +0000 (16:11 +0200)]
detach(): Reorganize code. Logic is the same.

* strace.c (detach): Use goto's instead of excessive nesting.
Drop sigstop_expected and interrupt_done variables.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agoEat pending SIGSTOP _before_ PTRACE_DETACH in detach()
Denys Vlasenko [Fri, 21 Jun 2013 13:50:41 +0000 (15:50 +0200)]
Eat pending SIGSTOP _before_ PTRACE_DETACH in detach()

* strace.c (detach): If TCB_IGNORE_ONE_SIGSTOP is set,
di not PTRACE_DETACH - wait for SIGSTOP first.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agodetach(): warn if we see ECHILD from waitpid
Denys Vlasenko [Thu, 20 Jun 2013 10:10:21 +0000 (12:10 +0200)]
detach(): warn if we see ECHILD from waitpid

* strace.c (detach): Warn if we see ECHILD from waitpid.
Explain in comments that we don't normally expect !WIFSTOPPED
either, and also that PTRACE_CONT failure isn't expected
(the "break" there is a "I'm confused, bailing out" code style)..

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agoImprove error messages in detach()
Denys Vlasenko [Thu, 20 Jun 2013 09:20:23 +0000 (11:20 +0200)]
Improve error messages in detach()

* strace.c (detach): Change return type from int to void.
Improve error meesages: show PID, tell exactly which operation fails.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agoRemove workarounds for ancient kernels lacking __WALL
Denys Vlasenko [Thu, 20 Jun 2013 09:06:58 +0000 (11:06 +0200)]
Remove workarounds for ancient kernels lacking __WALL

__WALL is available and working at least since 2.4 kernels: 10 years ago.

* strace (detach): Remove workarounds for ancient kernels lacking __WALL.
Add missing EINTR check.
(trace): Remove workarounds for ancient kernels lacking __WALL.
Remove redundant double error printout.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agoUSE_SEIZE: fix detaching from stopped processes
Denys Vlasenko [Wed, 19 Jun 2013 13:31:39 +0000 (15:31 +0200)]
USE_SEIZE: fix detaching from stopped processes

V3: split SEIZE/!SEIZE code paths to reduce confusion.
Extensively comment every possible case.
Verified that all tests/detach* tests work in both SEIZE and !SEIZE
cases.

* strace.c (detach): If PTRACE_SEIZE API is in use, stop the tracee
using PTRACE_INTERRUPT instead of sending it a SIGSTOP.
In a subsequent waitpid loop, correctly wait and suppress SIGSTOP
on detach if PTRACE_INTERRUPT wasn't used, or wait for any ptrace
stop and detach without suppressing signals.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agotests: disable /proc based checks when /proc is not mounted
Dmitry V. Levin [Wed, 19 Jun 2013 14:57:05 +0000 (14:57 +0000)]
tests: disable /proc based checks when /proc is not mounted

* tests/detach-running: Disable /proc based checks when
/proc/self/status is not available.
* tests/detach-sleeping: Likewise.
* tests/detach-stopped: Likewise.

11 years agotests/detach-{running,sleeping,stopped}: check post-detach state
Denys Vlasenko [Wed, 19 Jun 2013 14:37:24 +0000 (16:37 +0200)]
tests/detach-{running,sleeping,stopped}: check post-detach state

Check that traced process still exists and is in a right state
after strace detached from it.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agotests: ensure that strace can detach from running processes
Dmitry V. Levin [Wed, 19 Jun 2013 10:22:18 +0000 (10:22 +0000)]
tests: ensure that strace can detach from running processes

* tests/detach-running: New test.
* tests/Makefile.am (TESTS): Add it.

11 years agotests: ensure that strace does not leave sleeping processes stopped
Dmitry V. Levin [Wed, 19 Jun 2013 01:05:30 +0000 (01:05 +0000)]
tests: ensure that strace does not leave sleeping processes stopped

* tests/detach-sleeping: Do not send SIGCONT to the sleeping process.

11 years agotests: fix parallel-tests support in detach-* tests
Dmitry V. Levin [Tue, 18 Jun 2013 22:31:58 +0000 (22:31 +0000)]
tests: fix parallel-tests support in detach-* tests

* tests/detach-sleeping: Use $LOG file for set_ptracer_any output.
* tests/detach-stopped: Likewise.

11 years agotests: parametrize "sleep 1"
Dmitry V. Levin [Tue, 18 Jun 2013 20:51:49 +0000 (20:51 +0000)]
tests: parametrize "sleep 1"

* tests/init.sh (SLEEP_A_BIT): New variable.
* tests/detach-sleeping: Use it.
* tests/detach-stopped: Likewise.

11 years agotests: ensure that strace can detach from sleeping and stopped processes
Dmitry V. Levin [Tue, 18 Jun 2013 16:50:18 +0000 (16:50 +0000)]
tests: ensure that strace can detach from sleeping and stopped processes

* tests/set_ptracer_any.c: New file.
* tests/detach-sleeping: New test.
* tests/detach-stopped: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add set_ptracer_any.
(TESTS): Add detach-sleeping and detach-stopped.
* tests/.gitignore: Add set_ptracer_any.

11 years agotests: enhance timeout checks
Dmitry V. Levin [Tue, 18 Jun 2013 15:28:47 +0000 (15:28 +0000)]
tests: enhance timeout checks

Run each test using a wrapper that does all necessary timeout checks.

* tests/run.sh: New file.
* tests/Makefile.am (EXTRA_DIST, LOG_COMPILER): Add it.
* tests/init.sh (check_strace, check_timeout): Remove.
* tests/detach-stopped: Update callers.
* tests/net: Likewise.
* tests/ptrace_setoptions: Likewise.
* tests/qual_syscall: Likewise.
* tests/stat: Likewise.
* tests/strace-f: Likewise.

11 years agotests: enable parallel-tests support
Dmitry V. Levin [Tue, 18 Jun 2013 14:31:57 +0000 (14:31 +0000)]
tests: enable parallel-tests support

* configure.ac (AM_INIT_AUTOMAKE): Add parallel-tests.

11 years agotests: prepare for parallel-tests support
Dmitry V. Levin [Tue, 18 Jun 2013 13:35:29 +0000 (13:35 +0000)]
tests: prepare for parallel-tests support

* tests/Makefile.am (CLEANFILES): Calculate dynamically from TESTS.
* tests/init.sh (LOG): New variable.
* tests/detach-stopped: Use it.
* tests/net: Likewise.
* tests/qual_syscall: Likewise.
* tests/stat: Likewise.
* tests/strace-f: Likewise.

11 years agoCleanups. No logic changes.
Denys Vlasenko [Tue, 18 Jun 2013 16:09:39 +0000 (18:09 +0200)]
Cleanups. No logic changes.

* defs.h: Define new ptrace constants unconditionally.
* strace.c (detach): Fix comment.
(trace): Remove now unnecessary "if USE_SEIZE".

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agomaint: post-release administrivia
Dmitry V. Levin [Wed, 5 Jun 2013 21:33:45 +0000 (21:33 +0000)]
maint: post-release administrivia

* NEWS: Add header line for next release.

11 years agoioctlent: add UAPI support v4.8
Dmitry V. Levin [Mon, 3 Jun 2013 16:24:53 +0000 (16:24 +0000)]
ioctlent: add UAPI support

* Makefile.am (IOCTLSORT_INCLUDEDIR): Define.
(ioctlsort): Use it.
* linux/ioctlent.sh (lookup_ioctls): Look into uapi directory tree.
Strip "uapi/" prefix from output path names.
* linux/ioctlent.h.in: Regenerate from v3.9 headers.
* NEWS: Mention it.

11 years agoPrepare for 4.8 release
Dmitry V. Levin [Mon, 3 Jun 2013 12:34:56 +0000 (12:34 +0000)]
Prepare for 4.8 release

* NEWS: Update for 4.8 release.
* debian/changelog: 4.8-1.
* strace.spec: 4.8-1.

11 years agoFix "make dist" on recently added architectures
Dmitry V. Levin [Sun, 2 Jun 2013 18:12:44 +0000 (18:12 +0000)]
Fix "make dist" on recently added architectures

* Makefile.am (EXTRA_DIST): Add linux/aarch64/errnoent1.h,
linux/aarch64/ioctlent.h.in, linux/aarch64/ioctlent1.h,
linux/aarch64/signalent1.h, linux/aarch64/syscallent.h,
linux/aarch64/syscallent1.h, linux/metag/ioctlent.h.in,
linux/metag/syscallent.h, linux/or1k/ioctlent.h.in,
linux/or1k/syscallent.h, linux/tile/errnoent1.h, linux/tile/ioctlent1.h,
linux/tile/signalent1.h, linux/tile/syscallent1.h, linux/ubi-user.h,
linux/xtensa/ioctlent.h.in, and linux/xtensa/syscallent.h.

11 years agoFix "make dist" regression introduced by commit v4.7-184-gd648f29
Dmitry V. Levin [Sun, 2 Jun 2013 18:09:44 +0000 (18:09 +0000)]
Fix "make dist" regression introduced by commit v4.7-184-gd648f29

* Makefile.am (EXTRA_DIST): Add linux/ubi-user.h.

11 years agoDo not suppress signal delivery messages with -qq
Dmitry V. Levin [Tue, 28 May 2013 20:27:10 +0000 (20:27 +0000)]
Do not suppress signal delivery messages with -qq

Current implementation of -qq does not allow suppressing exit status
messages without suppressing signal delivery messages, which is not
good.  There is a traditional "-e signal=none" syntax that can be used
to suppress all signal delivery messages.
This partially reverts commit v4.7-222-g01997cf.

* strace.c (trace): Do not suppress signal delivery messages with -qq.
* strace.1: Update documentation about -qq option.

11 years agotile: use siginfo_t, not struct siginfo
Chris Metcalf [Wed, 22 May 2013 00:25:22 +0000 (20:25 -0400)]
tile: use siginfo_t, not struct siginfo

As of glibc 2.16, "struct siginfo" is no longer supported,
and "siginfo_t" must be used instead.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agotile: remove MAP_CACHE_xxx support in mem.c
Chris Metcalf [Tue, 21 May 2013 20:40:50 +0000 (16:40 -0400)]
tile: remove MAP_CACHE_xxx support in mem.c

These flags support functionality in mmap() that has not been
pushed back to the community, and which may or may not eventually
end up being the final community model.  In the interim, having
these flags unconditionally present for "#ifdef TILE" just means
that the TILE build breaks if using the community versions of
the kernel and glibc, so just revert the code until such time
as it may end up in the community.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agoRename COPYRIGHT to COPYING
Mike Frysinger [Wed, 15 May 2013 20:33:09 +0000 (16:33 -0400)]
Rename COPYRIGHT to COPYING

The standard name people have adopted is "COPYING" rather than
"COPYRIGHT".  Use that as a lot of license scanning tools look for it.

* COPYRIGHT: Rename to ...
* COPYING: ... this.
* Makefile.am (EXTRA_DIST): Rename COPYRIGHT to COPYING.
* README: Likewise.
* strace.spec (%files): Likewise.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoSync strace.spec and debian/ with packages
Dmitry V. Levin [Fri, 17 May 2013 23:16:39 +0000 (23:16 +0000)]
Sync strace.spec and debian/ with packages

* debian/changelog: Sync with 4.7-1.
* debian/strace.docs: Likewise.
* strace.spec: Sync with 4.7-3.

11 years agoUpdate PTRACE_O_* constants
Dmitry V. Levin [Fri, 17 May 2013 22:22:19 +0000 (22:22 +0000)]
Update PTRACE_O_* constants

* process.c (ptrace_setoptions_flags): Sync with Linux 3.9.

11 years agoUpdate AF_*, PF_*, MSG_*, and TCP_* constants
Dmitry V. Levin [Thu, 16 May 2013 22:19:30 +0000 (22:19 +0000)]
Update AF_*, PF_*, MSG_*, and TCP_* constants

* net.c (domains, addrfams, protocols, socktcpoptions): Sync with
Linux 3.9.

11 years agoNOMMU: do not hide startup syscalls unless in -D mode
Dmitry V. Levin [Tue, 14 May 2013 22:35:46 +0000 (22:35 +0000)]
NOMMU: do not hide startup syscalls unless in -D mode

On NOMMU systems in "strace PROG" case, we have no way to attach to
the tracee before it calls execve unless in -D mode.  That is, the
first execve call is very likely to be missed, and setting
hide_log_until_execve just results to empty log.

* strace.c (init) [NOMMU_SYSTEM]: Do not set hide_log_until_execve
unless in -D mode.

11 years agoMake -D mode work when the Yama LSM is enabled
Dmitry V. Levin [Mon, 13 May 2013 18:43:28 +0000 (18:43 +0000)]
Make -D mode work when the Yama LSM is enabled

* strace.c [HAVE_PRCTL]: Include sys/prctl.h.
(startup_child) [HAVE_PRCTL && PR_SET_PTRACER && PR_SET_PTRACER_ANY]:
In -D mode, allow tracing the process that is going to become the
tracee.

11 years agoUpdate PR_* constants
Dmitry V. Levin [Mon, 13 May 2013 18:34:15 +0000 (18:34 +0000)]
Update PR_* constants

* process.c (prctl_options): Add PR_SET_PTRACER.

11 years agoHide startup syscalls.
Denys Vlasenko [Tue, 14 May 2013 14:07:46 +0000 (16:07 +0200)]
Hide startup syscalls.

Tested with "./strace [-D] [-q] [-bexecve] env true",
all cases seem to work.

* defs.h: Declare new variable: bool hide_log_until_execve.
* strace.c: Define hide_log_until_execve.
Rename skip_startup_execve to skip_one_b_execve.
(startup_child): Do not set skip_one_b_execve = 1 here.
(init): If "strace PROG" case (as opposed to "strace -pPID"),
set skip_one_b_execve and hide_log_until_execve to 1.
(trace): Don't print signal messages if hide_log_until_execve == 1.
* syscall.c (trace_syscall_entering):
Skip syscall printing if hide_log_until_execve == 1.
Reset hide_log_until_execve if we enter execve syscall.
(trace_syscall_exiting): Skip syscall printing if hide_log_until_execve == 1.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
11 years agoAllow -q to be repeated for very quiet output
Daniel P. Berrange [Mon, 13 May 2013 10:30:55 +0000 (11:30 +0100)]
Allow -q to be repeated for very quiet output

Even with the -q flag specified, tracing output is still mixed
with messages about signals and process exit status, which is
often irrelevant.  Allow the -q option to be repeated to force
the suppression of signals / exit status info too.

* defs.h: Change 'qflag' from 'bool' to 'unsigned int'.
* strace.1: Document ability to repeat '-q' option.
* strace.c: Allow '-q' to be repeated to quieten process
exit status and signal messages.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agomips o32: fix syscall table
Dmitry V. Levin [Sat, 11 May 2013 21:57:28 +0000 (21:57 +0000)]
mips o32: fix syscall table

* linux/mips/syscallent-o32.h: Add entries for getpmsg, putpmsg,
get_mempolicy, set_mempolicy and vserver.  Fix names for umount,
umount2, mmap, mmap2, pread64, pwrite64, sigaltstack and fstatat64
syscalls.

11 years agomips n64: fix syscall table
Dmitry V. Levin [Fri, 10 May 2013 22:51:23 +0000 (22:51 +0000)]
mips n64: fix syscall table

* linux/mips/syscallent-n64.h: Add entries for get_mempolicy,
set_mempolicy and timerfd syscalls.  Fix entry for socket syscall.
Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack
and umount2 syscalls.

11 years agomips n32: fix syscall table
Dmitry V. Levin [Fri, 10 May 2013 22:03:33 +0000 (22:03 +0000)]
mips n32: fix syscall table

* linux/mips/syscallent-n32.h: Add entries for mbind, get_mempolicy,
set_mempolicy and timerfd syscalls.  Fix entry for socket syscall.
Fix handlers for truncate, ftruncate and getdents64 syscalls.
Fix names for pread64, pwrite64, shmat, rt_sigsuspend, sigaltstack,
umount2, and getdents64 syscalls.

11 years agosync_file_range: fix number of syscall arguments
Dmitry V. Levin [Wed, 8 May 2013 17:03:24 +0000 (17:03 +0000)]
sync_file_range: fix number of syscall arguments

* linux/avr32/syscallent.h: Set the number of sync_file_range arguments
to 6.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/or1k/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Change sync_file_range to
sync_file_range2, set the number of sync_file_range2 arguments to 6.
* linux/tile/syscallent.h: Change sync_file_range to sync_file_range2,
set the number of sync_file_range2 arguments to 4.
* linux/tile/syscallent1.h: Change sync_file_range to sync_file_range2.
update handler.
* linux/xtensa/syscallent.h: Likewise.

11 years agoAdd syscall entries for new linux syscalls
Dmitry V. Levin [Wed, 8 May 2013 16:36:29 +0000 (16:36 +0000)]
Add syscall entries for new linux syscalls

* linux/dummy.h: Add printargs aliases for sys_finit_module, sys_kcmp
and sys_sync_file_range2.
* linux/alpha/syscallent.h: Add entries for process_vm_readv
and process_vm_writev.
* linux/bfin/syscallent.h: Likewise.
* linux/arm/syscallent.h: Add entries for sync_file_range2, kcmp
and finit_module.
* linux/hppa/syscallent.h: Add entries for process_vm_readv,
process_vm_writev, kcmp and finit_module.
* linux/tile/syscallent.h: Likewise.
* linux/tile/syscallent1.h: Likewise.
* linux/ia64/syscallent.h: Add entry for finit_module.
* linux/i386/syscallent.h: Add entries for kcmp and finit_module.
* linux/m68k/syscallent.h: Likewise.
* linux/metag/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/or1k/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
* linux/s390/syscallent.h: Add entries for s390_runtime_instr, kcmp
and finit_module.
* linux/s390x/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Add entries for kern_features, kcmp
and finit_module.

11 years agotests/net: fix portability issues
Dmitry V. Levin [Wed, 8 May 2013 14:03:38 +0000 (14:03 +0000)]
tests/net: fix portability issues

* tests/net-accept-connect.c: Fix address length passed to bind()
and connect().
* tests/net: Update regexps.

11 years agotests: add a test for basic network syscalls
Dmitry V. Levin [Tue, 7 May 2013 23:32:01 +0000 (23:32 +0000)]
tests: add a test for basic network syscalls

* tests/.gitignore: Add net-accept-connect, *.o and *.log.*.
* tests/Makefile.am (AM_CFLAGS): New variable.
(check_PROGRAMS): Add net-accept-connect.
(TESTS): Add net.
* tests/net-accept-connect.c: New file.
* tests/net: New file.

11 years agotests: do not skip tests when timeout utility is not available
Dmitry V. Levin [Wed, 8 May 2013 01:39:55 +0000 (01:39 +0000)]
tests: do not skip tests when timeout utility is not available

* tests/init.sh (check_timeout): New function.
* tests/ptrace_setoptions: Use it.
* tests/qual_syscall: Likewise.
* tests/stat: Likewise.
* tests/strace-f: Likewise.

11 years agoMove subcall decoding configuration out of the common code
Dmitry V. Levin [Tue, 7 May 2013 14:38:01 +0000 (18:38 +0400)]
Move subcall decoding configuration out of the common code

* Makefile.am (EXTRA_DIST): Add linux/subcall.h.
* linux/syscall.h (SYS_socket_subcall): Remove.
(SYS_socket_nsubcalls, SYS_ipc_subcall, SYS_ipc_nsubcalls): Move to ...
* linux/subcall.h: ... new file.
* linux/arm/syscallent.h: Define SYS_socket_subcall, include subcall.h.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/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.

Suggested by Mike Frysinger and Chris Metcalf.

11 years agosparc: remove some unused declarations and macros
Dmitry V. Levin [Tue, 7 May 2013 15:03:26 +0000 (19:03 +0400)]
sparc: remove some unused declarations and macros

* linux/syscall.h [SPARC || SPARC64] (sys_msgsys, sys_semsys,
sys_shmsys): Remove declarations.
[SPARC || SPARC64] (SYS_semsys_subcall, SYS_semsys_nsubcalls,
SYS_msgsys_subcall, SYS_msgsys_nsubcalls, SYS_shmsys_subcall,
SYS_shmsys_nsubcalls): Remove macros.

11 years agomips: fix build regression
Mike Frysinger [Tue, 7 May 2013 14:50:20 +0000 (10:50 -0400)]
mips: fix build regression

The recent commit (2690fadc8b35190dddd29274a7405bac13adc469) shuffled
the mips headers around causing it to check the ABI defines before it
included the header which set those up.  Now all mips builds fail with:
In file included from count.c:36:0:
defs.h:48:4: error: #error Unsupported _MIPS_SIM

* defs.h [MIPS]: Move sgidefs.h above _MIPS_SIM check.

11 years agometag: rename llseek syscall to _llseek
James Hogan [Tue, 7 May 2013 12:09:27 +0000 (13:09 +0100)]
metag: rename llseek syscall to _llseek

The raw llseek syscall is called _llseek from userland, so fix the
naming of it for metag to allow the stat test to pass.

* linux/metag/syscallent.h: Rename llseek syscall to _llseek.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
11 years agometag: disable socket and ipc subcall support
James Hogan [Tue, 7 May 2013 12:09:16 +0000 (13:09 +0100)]
metag: disable socket and ipc subcall support

The metag architecture also uses dedicated syscalls and doesn't need to
multiplex ipc and socket subcalls.

* linux/syscall.h [METAG]: Do not define SYS_socket_subcall and
SYS_ipc_subcall.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
11 years agopread, pwrite: fix number of syscall arguments
Dmitry V. Levin [Tue, 7 May 2013 09:35:18 +0000 (09:35 +0000)]
pread, pwrite: fix number of syscall arguments

The number of pread and pwrite arguments depends on architecture and
personality.  For 64bit and ilp32 it equals to 4, for unaligned
32bit it equals to 5, and for aligned 32bit it equals to 6.

* linux/aarch64/syscallent1.h: Change the number of pread and pwrite
arguments to 4.
* linux/alpha/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/tile/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/or1k/syscallent.h: Change the number of pread and pwrite
arguments to 5.

11 years agopreadv, pwritev: fix number of syscall arguments
Dmitry V. Levin [Tue, 7 May 2013 09:21:07 +0000 (09:21 +0000)]
preadv, pwritev: fix number of syscall arguments

The number of preadv and pwritev arguments depends on architecture and
personality.  For 64bit and ilp32 it equals to 4, for unaligned 32bit
it equals to 5, and for aligned 32bit it equals to 6.

* linux/aarch64/syscallent1.h: Change the number of preadv and pwritev
arguments to 4.
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/tile/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Change the number of preadv and pwritev
arguments to 6.
* linux/sh/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.

11 years agoftruncate64, truncate64: fix number of syscall arguments
Dmitry V. Levin [Tue, 7 May 2013 08:47:46 +0000 (08:47 +0000)]
ftruncate64, truncate64: fix number of syscall arguments

The number of ftruncate64/truncate64 arguments depends on architecture
and personality.  For 64bit and ilp32 it equals to 2, for unaligned
32bit it equals to 3, and for aligned 32bit it equals to 4.

* linux/or1k/syscallent.h: Change the number of ftruncate64 and
truncate64 arguments to 3.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Change ftruncate64 and truncate64 handlers.
* linux/sparc/syscallent.h: Change ftruncate64 handler, change the
number of its arguments to 3.
* linux/xtensa/syscallent.h: Change the number of ftruncate64 and
truncate64 arguments to 4.

11 years agofallocate: fix number of syscall arguments
Dmitry V. Levin [Tue, 7 May 2013 08:18:44 +0000 (08:18 +0000)]
fallocate: fix number of syscall arguments

The number of fallocate arguments depends on architecture and
personality.  For 64bit and ilp32 it equals to 4,
for 32bit it equals to 6.

* linux/aarch64/syscallent1.h: Change the number of fallocate arguments
to 4.
* linux/alpha/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/tile/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Set fallocate handler and flags.

11 years agofadvise64, fadvise64_64: fix handlers and number of syscall arguments
Dmitry V. Levin [Tue, 7 May 2013 02:27:50 +0000 (02:27 +0000)]
fadvise64, fadvise64_64: fix handlers and number of syscall arguments

The number of fadvise64 arguments depends on architecture and
personality.  For 64bit and ilp32 it equals to 4, for unaligned
32bit it equals to 5, and for aligned 32bit it equals to 6.

The number of fadvise64_64 arguments is 4 for 64bit and ilp32, for
unaligned 32bit and most of aligned 32bit it equals to 6, and for
mips o32 it equals to 7.

* linux/alpha/syscallent.h: Set fadvise64 handler.
* linux/s390/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Set fadvise64_64 handler, change the number
of syscall arguments to 6.
* linux/ia64/syscallent.h: Change the number of fadvise64 arguments
to 4.
* linux/mips/syscallent-n32.h: Likewise.
* linux/tile/syscallent1.h: Change the number of fadvise64 arguments
to 5.
* linux/mips/syscallent-o32.h: Change the number of fadvise64_64
arguments to 7.
* linux/s390x/syscallent.h: Change fadvise64_64 handler.  Set fadvise64
handler.  Change numbers of fadvise64 and fadvise64_64 arguments to 4.
* linux/sh64/syscallent.h: Change fadvise64_64 handler.
Change numbers of fadvise64 and fadvise64_64 arguments to 4.
* linux/sparc/syscallent.h: Set fadvise64 and fadvise64_64 handlers,
change numbers of their arguments to 5 and 6.
* linux/x86_64/syscallent.h: Change fadvise64 handler.

11 years agomips o32: raise the max number of syscall arguments to 7
Dmitry V. Levin [Tue, 7 May 2013 08:03:41 +0000 (08:03 +0000)]
mips o32: raise the max number of syscall arguments to 7

On mips o32, fadvise64_64 takes 7 arguments.

* defs.h [LINUX_MIPSO32]: Raise MAX_ARGS to 7.

11 years agomips: split syscallent.h
Dmitry V. Levin [Tue, 7 May 2013 02:46:46 +0000 (02:46 +0000)]
mips: split syscallent.h

linux/mips/syscallent.h consisted of several parts that had little in
common.  Split them into separate files to ease maintenance.

* linux/mips/syscallent-compat.h: New file.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/mips/syscallent.h: Include them.
* Makefile.am (EXTRA_DIST): Add them.

11 years agoreadahead: fix number of syscall arguments
Dmitry V. Levin [Tue, 7 May 2013 01:25:11 +0000 (01:25 +0000)]
readahead: fix number of syscall arguments

The number of readahead arguments depends on architecture and
personality.  For 64bit and ilp32 it equals to 3, for unaligned 32bit it
equals to 4, and for aligned 32bit it equals to 5.

* linux/aarch64/syscallent1.h: Set number of readahead arguments to 3.
* linux/alpha/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/or1k/syscallent.h: Set number of readahead arguments to 4.
* linux/sh/syscallent.h: Likewise.
* linux/tile/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Set number of readahead arguments to 5.

11 years agolinux/syscall.h: make subcall decoding configuration more readable
Dmitry V. Levin [Mon, 6 May 2013 23:34:03 +0000 (23:34 +0000)]
linux/syscall.h: make subcall decoding configuration more readable

* linux/syscall.h: Inverse and sort the subcall ifdef,
add a comment why subcall decoding support is not enabled
on some architectures.

11 years agoxtensa: disable socket and ipc subcall support
Chris Zankel [Mon, 6 May 2013 22:21:38 +0000 (15:21 -0700)]
xtensa: disable socket and ipc subcall support

The Xtensa architecture also uses dedicated syscalls and doesn't
need to multiplex ipc and socket subcalls.

* linux/syscall.h [XTENSA]: Do not define SYS_socket_subcall and
SYS_ipc_subcall.

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoFix syscall flags
Dmitry V. Levin [Mon, 6 May 2013 01:09:15 +0000 (01:09 +0000)]
Fix syscall flags

* linux/aarch64/syscallent1.h: Fix syscall flags for send.
* linux/alpha/syscallent.h: Fix syscall flags for fchdir, getcwd,
oldumount, sigaltstack, umount, uselib, and utimes.
* linux/arm/syscallent.h: Fix syscall flags for close, creat, dup, dup2,
fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync, flock,
fsetxattr, fsync, getdents, getdents64, ioctl, oldfstat, oldselect,
open, pipe, poll, pread, pwrite, read, readahead, readdir, readv,
select, socketcall, write, and writev.
* linux/avr32/syscallent.h: Fix syscall flags for inotify_init and
unshare.
* linux/bfin/syscallent.h: Fix syscall flags for pread64 and pwrite64.
* linux/hppa/syscallent.h: Fix syscall flags for fchdir, flistxattr,
getcwd, pause, signal, umount2, uselib, utime, and vfork.
* linux/ia64/syscallent.h: Fix syscall flags for creat, fchdir,
lstat, umount, uselib, and utimes.  Fix syscall handlers for
fgetxattr, flistxattr, fremovexattr, and fsetxattr.
* linux/m68k/syscallent.h: Fix syscall flags for close, creat, dup,
dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64, fdatasync,
flock, fsetxattr, getdents, ioctl, oldfstat, oldselect, open, pipe,
poll, pread64, pwrite64, read, readahead, readdir, readv, select,
socketcall, write, and writev.
* linux/metag/syscallent.h: Fix syscall flags for fanotify_init,
prlimit64, process_vm_readv, process_vm_writev, and quotactl.
* linux/microblaze/syscallent.h: Fix syscall flags for close, creat,
dup, dup2, fchdir, fchmod, fchown, fchown32, fcntl, fcntl64,
fdatasync, flock, fsetxattr, getdents, ioctl, oldfstat, oldselect,
open, perf_event_open, pipe, poll, pread64, pwrite64, read, readahead,
readdir, readv, select, socketcall, write, and writev.
* linux/mips/syscallent.h: Fix syscall flags for close, creat, dup,
dup2, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync, flock,
fsetxattr, getdents, getdents64, getxattr, ioctl, lgetxattr,
listxattr, llistxattr, lremovexattr, lsetxattr, oldfstat, open, pipe,
pivot_root, poll, pread, pwrite, read, readahead, readv, removexattr,
select, setxattr, socketcall, statfs, write, and writev.
* linux/or1k/syscallent.h: Fix syscall flags for fchdir and quotactl.
* linux/powerpc/syscallent.h: Fix syscall flags for fchdir.
* linux/sh/syscallent.h: Fix syscall flags for getcwd.
* linux/sparc/syscallent.h: Fix syscall flags for getresgid, getresuid,
setresgid, setresgid32, and setresuid.
* linux/xtensa/syscallent.h: Fix syscall flags for close, creat, dup,
dup2, fallocate, fchdir, fchmod, fchown, fcntl, fcntl64, fdatasync,
flock, fsetxattr, fstatfs, fstatfs64, fsync, getdents, getdents64,
ioctl, open, pipe, pivot_root, poll, pread64, pwrite64, read,
readahead, readv, rt_sigreturn, select, setfsgid, setfsuid, setuid,
swapoff, times, utime, write, and writev.

11 years agotests/stat: enhance regexps
Dmitry V. Levin [Mon, 6 May 2013 18:50:48 +0000 (18:50 +0000)]
tests/stat: enhance regexps

* tests/stat: Enhance regexps that check tracing of stat/stat64 and
fstatat/fstatat64 syscalls.

11 years agotests/stat: support fstatat syscall for stat()
Chris Metcalf [Mon, 6 May 2013 15:21:13 +0000 (11:21 -0400)]
tests/stat: support fstatat syscall for stat()

Newer Linux architectures don't support the stat/stat64 syscalls.
Instead they use fstatat() with AT_FDCWD and an extra flags argument.
Support seeing this output in the 'strace -efile' test.

As part of this change, use "grep -E -x" syntax consistently for
all stat tests, since the number of \(foo\)\? expressions was becoming
pretty unwieldy.

* tests/stat: Update stat/stat64 check regexp to handle architectures
that use fstatat instead.  Use "grep -E -x" syntax consistently.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
11 years agoARM OABI: fix 64-bit arguments decoding
Dmitry V. Levin [Mon, 6 May 2013 18:23:01 +0000 (18:23 +0000)]
ARM OABI: fix 64-bit arguments decoding

ARM OABI and ARM EABI have different function parameters passing rules,
see commit v4.6-11-g7a5b08f for details.

* util.c (printllval): Do not align argument number in case of ARM OABI.
* file.c (sys_fadvise64_64): Likewise.

11 years agoprintllval: fix 64bit unpacking on mips/o32 and xtensa
Mike Frysinger [Sun, 5 May 2013 22:30:21 +0000 (18:30 -0400)]
printllval: fix 64bit unpacking on mips/o32 and xtensa

The mips/o32 ABI and xtensa arch also do 64bit aligning, so add it to the
printllval list for this.

Normally for sys_fadvise64_64 we'd handle the same list of arches, but
mips/o32 ABI is funky and doesn't shift -- it has 7 args.  So just add
xtensa to it.

* file.c (sys_fadvise64_64): Add XTENSA to the shifted list.
* util.c (printllval): Add LINUX_MIPSO32 and XTENSA to the shifted list.

11 years agotile: disable socket and ipc subcall support
Chris Metcalf [Mon, 6 May 2013 15:41:29 +0000 (11:41 -0400)]
tile: disable socket and ipc subcall support

The tile arch just has the dedicated syscalls, so disable
the logic for parsing subcalls.

* linux/syscall.h [TILE]: Do not define SYS_socket_subcall and
SYS_ipc_subcall.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
11 years agoBlackfin: disable socketcall and ipc subcall support
Mike Frysinger [Mon, 6 May 2013 05:49:41 +0000 (01:49 -0400)]
Blackfin: disable socketcall and ipc subcall support

The Blackfin arch does not have a socketcall or ipc subcall
(it has dedicated syscalls broken out), so disable the logic for it.

* linux/syscall.h [BFIN]: Do not define SYS_socket_subcall and
SYS_ipc_subcall.

11 years agos390: fix # of args truncate64/ftruncate64 takes
Mike Frysinger [Sun, 5 May 2013 21:03:23 +0000 (17:03 -0400)]
s390: fix # of args truncate64/ftruncate64 takes

* linux/s390/syscallent.h: Change nargs to 3 for truncate64/ftruncate64.

11 years agomtd: clamp ubi name strings
Mike Frysinger [Sun, 5 May 2013 05:21:54 +0000 (01:21 -0400)]
mtd: clamp ubi name strings

Since the length fields with the ubi volnames are signed 16bit values,
make sure we clamp that number to the size of the buffer we've allocated
on the stack to prevent buffer overflows.

* mtd.c (ubi_ioctl): Clamp length to string_quote to 0/UBI_MAX_VOLUME_NAME.
Check the return of string_quote and tweak the output accordingly.

11 years agoprintxval: support more architectures
Dmitry V. Levin [Sat, 4 May 2013 19:51:57 +0000 (19:51 +0000)]
printxval: support more architectures

* configure.ac: Define SIZEOF_LONG_LONG.
* util.c (printllval): Handle all architectures with sizeof(long) > 4
and sizeof(long) == sizeof(long long).

11 years agoFix building for sparc64 targets
Mike Frysinger [Sat, 4 May 2013 17:25:22 +0000 (13:25 -0400)]
Fix building for sparc64 targets

* util.c (printllval): Handle SPARC64 define.

11 years agoFix building for mips n64 targets
Mike Frysinger [Sat, 4 May 2013 05:42:54 +0000 (01:42 -0400)]
Fix building for mips n64 targets

* util.c (printllval): Handle LINUX_MIPSN64 define.

11 years agohppa: fix stat64 and fstat64 decoding
Dmitry V. Levin [Fri, 3 May 2013 22:10:41 +0000 (22:10 +0000)]
hppa: fix stat64 and fstat64 decoding

* file.c [HPPA]: Do not redefine stat64 to hpux_stat64.

11 years agoarm, aarch64, ppc: fix printllval-based decoders
Dmitry V. Levin [Fri, 3 May 2013 22:27:45 +0000 (22:27 +0000)]
arm, aarch64, ppc: fix printllval-based decoders

* util.c (printllval) [ARM || POWERPC]: Align argument number.
[AARCH64]: Align argument number in 32bit mode.
* file.c (sys_fadvise64_64) [ARM || POWERPC]: Remove no longer needed
printllval workaround.
[AARCH64]: Fix printing POSIX_FADV_* constants in 32bit mode.

11 years agoDecode mtd/ubi ioctls
Mike Frysinger [Thu, 2 May 2013 03:35:30 +0000 (23:35 -0400)]
Decode mtd/ubi ioctls

Been playing with UBI of late and it'd help if I could see what it was
doing.  Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes
a pointer to a 64bit value, not a strict.

* util.c (MAX, MIN): Move to ...
* defs.h (MAX, MIN): ... here.
(CLAMP): Define.
(ubi_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'.
* mtd.c: Include ubi user API header.
(ubi_volume_types): New enum decode.
(ubi_volume_props): Likewise.
(ubi_ioctl): Define.
* linux/ubi-user.h: Import from linux 3.8.

11 years agotest: add mtd/ubi test helpers
Mike Frysinger [Thu, 2 May 2013 19:44:42 +0000 (15:44 -0400)]
test: add mtd/ubi test helpers

I used these to develop the mtd/ubi ioctl decoders.

* test/.gitignore: Add mtd/ubi.
* test/Makefile: Declare all tests in a PROGS var.
Declare build targets .PHONY.
(all): Depend on $(PROGS) instead of hardcoded list.
(clean): Remove $(PROGS) instead of hardcoded list.
* test/mtd.c: New file.
* test/ubi.c: Likewise.

11 years agotest: include headers for used funcs
Mike Frysinger [Thu, 2 May 2013 19:43:45 +0000 (15:43 -0400)]
test: include headers for used funcs

These funcs use things like wait/write/read/strcmp but sometimes
don't include the right header for them.

* test/Makefile: Add -Wall to CFLAGS.
* test/clone.c: Include unistd.h.
* test/fork.c: Include sys/wait.h.
* test/sig.c: Include unistd.h.
* test/sigkill_rain.c: Include sys/wait.h.
* test/vfork.c: Include sys/wait.h.
* test/wait_must_be_interruptible.c: Include string.h

11 years agoia64: fix compilation warnings introduced by commit v4.7-174-g44f0ed1
Dmitry V. Levin [Thu, 2 May 2013 22:14:21 +0000 (22:14 +0000)]
ia64: fix compilation warnings introduced by commit v4.7-174-g44f0ed1

* linux/ia64/syscallent.h: Undefine sys_oldlstat, sys_lstat and
sys_lstat64 before redefining them to printargs.

Reported-by: Mike Frysinger <vapier@gentoo.org>
11 years agotests: stat: fix clean up of sample file
Mike Frysinger [Thu, 2 May 2013 19:35:40 +0000 (15:35 -0400)]
tests: stat: fix clean up of sample file

* tests/stat: Also rm the sample file at the end of the test.

11 years agoIgnore more files
Mike Frysinger [Thu, 2 May 2013 19:35:32 +0000 (15:35 -0400)]
Ignore more files

* .gitignore: Add gdb related files.
* tests/.gitignore: Ignore test logs.

11 years agox32: fix decoding of i386 truncate and ftruncate syscalls
Dmitry V. Levin [Thu, 2 May 2013 08:46:30 +0000 (08:46 +0000)]
x32: fix decoding of i386 truncate and ftruncate syscalls

* linux/x32/syscallent1.h: Remove sys_*truncate64 redirections.

11 years agox32: fix printllval-based decoders of i386 syscalls
Dmitry V. Levin [Thu, 2 May 2013 08:41:27 +0000 (08:41 +0000)]
x32: fix printllval-based decoders of i386 syscalls

* util.c (printllval) [X32]: Handle i386 personality.

11 years agotests: add basic test for ftruncate, lseek and stat family syscalls
Dmitry V. Levin [Thu, 2 May 2013 00:44:57 +0000 (00:44 +0000)]
tests: add basic test for ftruncate, lseek and stat family syscalls

* tests/stat: New test.
* tests/Makefile.am (TESTS): Add stat.

11 years agox32: fix build regressions introduced by commit v4.7-96-g8435d67
Dmitry V. Levin [Wed, 1 May 2013 16:37:08 +0000 (16:37 +0000)]
x32: fix build regressions introduced by commit v4.7-96-g8435d67

* desc.c (printflock) [X32]: Add special handling required for
this architecture with sizeof(long) < sizeof(off_t).
* file.c [X32] (struct stat64): Add __attribute__((packed)).
[X32] (HAVE_STAT64): Define.
(printstat) [X32]: Redirect to printstat64.
(printstat64) [X32]: Use "struct stat" instead of "struct stat64".
[X32] (realprintstat64): Rename to printstat64_x32.
(sys_stat64, sys_fstat64) [X32]: Remove second definitions of these
functions.  Call printstat64_x32 instead of printstat64
* linux/x32/syscallent.h: Fix handlers for truncate and ftruncate.

11 years agoAlias sys_*lstat* syscall printing functions
Dmitry V. Levin [Wed, 1 May 2013 15:56:22 +0000 (15:56 +0000)]
Alias sys_*lstat* syscall printing functions

* file.c (sys_lstat, sys_lstat64, sys_oldlstat): Remove.
* linux/dummy.h: Move !HAVE_STRUCT___OLD_KERNEL_STAT aliases forward.
(sys_lstat): Alias to sys_stat.
(sys_lstat64): Alias to sys_stat64.
(sys_oldlstat): Alias to sys_oldstat.
* linux/syscall.h (sys_lstat, sys_lstat64, sys_oldlstat): Remove.
* linux/x32/syscallent1.h (sys_lstat64): Remove.

11 years agox86_64: decode __old_kernel_stat based syscalls
Dmitry V. Levin [Wed, 1 May 2013 15:36:13 +0000 (15:36 +0000)]
x86_64: decode __old_kernel_stat based syscalls

* linux/x86_64/syscallent1.h: Remove sys_old*stat redirections.

11 years agox32: fix decoding of __old_kernel_stat based syscalls
Dmitry V. Levin [Wed, 1 May 2013 15:14:25 +0000 (15:14 +0000)]
x32: fix decoding of __old_kernel_stat based syscalls

* file.c [X32] (struct __old_kernel_stat): Define.
* linux/x32/syscallent1.h: Remove sys_old*stat redirections.

11 years agotest/threaded_execve: fix on metag
James Hogan [Wed, 1 May 2013 12:16:50 +0000 (13:16 +0100)]
test/threaded_execve: fix on metag

The metag ABI has stacks growing upwards so clone expects the stack
argument to point at the bottom of the stack instead of the top.

* test/threaded_execve.c [__metag__]: Define clone2 differently
to avoid a segfault at runtime.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
11 years agotest/skodic: make a bit more portable
James Hogan [Wed, 1 May 2013 12:16:49 +0000 (13:16 +0100)]
test/skodic: make a bit more portable

* test/skodic.c (main): Don't use MAP_FIXED since valid virtual addresses
vary between architectures (as far as I can tell the use of MAP_FIXED is
not relevant to the test).  Also don't assume the file desriptor returned
by open call is 3 when passing it to mmap.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
11 years agoprintllval: handle s390x
Mike Frysinger [Wed, 1 May 2013 03:48:07 +0000 (23:48 -0400)]
printllval: handle s390x

This is a 64bit arch w/no personalities, so fix printing.
It can now trace a simple call like readahead:
$ cat test.c
main(){readahead(-1, (unsigned long long)1 << 50, 0);}
$ gcc test.c
$ ./strace -ereadahead ./a.out
readahead(-1, 1125899906842624, 0)      = -1 EBADF (Bad file descriptor)

* util.c (printllval): Handle S390X define.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoStop using old AM_CONFIG_HEADER macro
Mike Frysinger [Wed, 1 May 2013 02:41:11 +0000 (22:41 -0400)]
Stop using old AM_CONFIG_HEADER macro

Building with automake-1.13 throws an error:
configure.ac:6: error: 'AM_CONFIG_HEADER': this macro is obsolete.
    You should use the 'AC_CONFIG_HEADERS' macro instead.

* configure.ac (AM_CONFIG_HEADER): Rename to AC_CONFIG_HEADERS.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agobuild: introduce git-version-gen
Dmitry V. Levin [Tue, 30 Apr 2013 23:52:12 +0000 (23:52 +0000)]
build: introduce git-version-gen

* .gitignore: Add .version.
* Makefile.am (EXTRA_DIST, BUILT_SOURCES): Add $(srcdir)/.version.
Add rules to check NEWS, generate $(srcdir)/.version and
$(distdir)/.tarball-version files.
Change ChangeLog and CREDITS generation rules to depend on
$(srcdir)/.version instead of $(srcdir)/.git/refs/heads/*.
* NEWS: Add dates to recent releases.
* configure.ac (AC_INIT): Use git-version-gen.
(AM_INIT_AUTOMAKE): Remove check-news.
* git-version-gen: Import from gnulib.
* make-dist: Check NEWS.

11 years agoMakefile.am: sort long lists to ease maintenance
Dmitry V. Levin [Tue, 30 Apr 2013 23:34:51 +0000 (23:34 +0000)]
Makefile.am: sort long lists to ease maintenance

* Makefile.am (strace_SOURCES, EXTRA_DIST): Sort, place one list element
per line.

11 years agobuild: fix "make dist" regression introduced by commit v4.7-105-g7270de5
Dmitry V. Levin [Tue, 30 Apr 2013 23:12:00 +0000 (23:12 +0000)]
build: fix "make dist" regression introduced by commit v4.7-105-g7270de5

* Makefile.am (EXTRA_DIST): Remove linux/arm/syscallent1.h,
linux/arm/signalent1.h, linux/arm/ioctlent1.h and linux/arm/errnoent1.h.

11 years agobuild: fix "make dist" regression introduced by commit v4.7-29-g17e3860
Dmitry V. Levin [Tue, 30 Apr 2013 23:18:22 +0000 (23:18 +0000)]
build: fix "make dist" regression introduced by commit v4.7-29-g17e3860

* Makefile.am (EXTRA_DIST): Add linux/ioctlent-filter.awk.

11 years agoBlackfin: tweak sram_alloc syscall decode
Mike Frysinger [Wed, 3 Apr 2013 04:19:31 +0000 (00:19 -0400)]
Blackfin: tweak sram_alloc syscall decode

* system.c (sys_sram_alloc): The 2nd argument of sram_alloc syscall
is a bit field, not a specific value, so decode it as such.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoPrint io_submit() offsets in decimal
Zev Weiss [Sun, 31 Mar 2013 00:19:50 +0000 (19:19 -0500)]
Print io_submit() offsets in decimal

This makes output formatting more consistent with pread()/pwrite(),
which print their offset parameters in decimal.

* desc.c (sys_io_submit): Change offset output format from %llx to %lld.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
11 years agoFix building outside source directory
Andreas Schwab [Sat, 30 Mar 2013 21:59:36 +0000 (22:59 +0100)]
Fix building outside source directory

The file linux/ioctlent.h is generated in the build directory, so
"../ioctlent.h" won't find it.

* linux/aarch64/ioctlent1.h: Remove "../" from include file name.
* linux/powerpc/ioctlent1.h: Likewise.
* linux/tile/ioctlent1.h: Likewise.
* linux/x32/ioctlent1.h: Likewise.
* linux/x86_64/ioctlent1.h: Likewise.
* linux/x86_64/ioctlent2.h: Likewise.

Signed-off-by: Andreas Schwab <schwab@suse.de>
11 years agoAArch64: Fix printing of long long value
Andreas Schwab [Sat, 30 Mar 2013 21:31:56 +0000 (22:31 +0100)]
AArch64: Fix printing of long long value

* util.c (printllval): Fix printing of long long values on
AArch64.

Signed-off-by: Andreas Schwab <schwab@suse.de>