]> granicus.if.org Git - strace/log
strace
13 years agoMake a few variables static.
Denys Vlasenko [Fri, 24 Jun 2011 20:49:58 +0000 (22:49 +0200)]
Make a few variables static.

* defs.h: Remove tcbtab declaration.
* strace.c: Make run_uid, run_gid, outf, tcbtab, progname
  global variables static

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoAdd debug output in initial attachment code
Denys Vlasenko [Fri, 24 Jun 2011 14:51:16 +0000 (16:51 +0200)]
Add debug output in initial attachment code

* strace.c (startup_attach): If -d, report pid and success/failure
  of every attach attempt.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoBetter debug logging of allocations and waitpit results
Denys Vlasenko [Fri, 24 Jun 2011 14:41:35 +0000 (16:41 +0200)]
Better debug logging of allocations and waitpit results

* strace.c (alloc_tcb): Print number of allocated tcb's if -d.
  (droptcb): Likewise.
  (handle_ptrace_event): Remove PTRACE_EVENT_EXEC debug message.
  (trace): Improve logging of waitpid: show WIFxxx, exitcode/signal,
  ptrace event name, WCOREDUMP - all on one line.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoOptimize arrays of register indexes in syscall_enter
Denys Vlasenko [Thu, 23 Jun 2011 20:22:34 +0000 (22:22 +0200)]
Optimize arrays of register indexes in syscall_enter

* syscall.c (syscall_enter) [BFIN]: Make register no array "static const".
  [SH]: Make register no array "const", pre-multiply it by 4.
  [SH64]: Make register no array "const".
  [X86_64]: Make register no array "const", pre-multiply it by 8.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoDeindent syscall_enter by removing unnecessary braces. No code changes.
Denys Vlasenko [Thu, 23 Jun 2011 20:10:54 +0000 (22:10 +0200)]
Deindent syscall_enter by removing unnecessary braces. No code changes.

syscall_enter has many long (>80 columns) lines.
It is aggravated by the fact that it has a lot of {} blocks
which are not necessary (the code is the same without them).
This patch removes {}s and deindents affected lines.
While at it, it indents ifdefs so that nesting is easier to track,
and adds a few spaces in the expressions, such as
"tcp->u_nargs*sizeof..." -> "tcp->u_nargs * sizeof...".
There is no actual changes to the code here.

* syscall.c (syscall_enter): Remove unnecessary {} blocks.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoRemove dead "ifndef CLONE_PTRACE" branch
Denys Vlasenko [Thu, 23 Jun 2011 20:06:39 +0000 (22:06 +0200)]
Remove dead "ifndef CLONE_PTRACE" branch

process.c defines CLONE_PTRACE for Linux, so it can't be undefined.
Therefore ifndef CLONE_PTRACE code is dead (since at least 2004).
This patch removes it.

* process.c (handle_new_child): Remove ifdef CLONE_PTRACE/endif (but not
  the code inside) and entire ifndef CLONE_PTRACE/endif block.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoAdd a comment about setbpt. No code changes.
Denys Vlasenko [Thu, 23 Jun 2011 20:05:50 +0000 (22:05 +0200)]
Add a comment about setbpt. No code changes.

* defs.h: Add a comment about setbpt().

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoUntangle a particularly badly obfuscated bit of code. No logic changes.
Denys Vlasenko [Thu, 23 Jun 2011 19:57:54 +0000 (21:57 +0200)]
Untangle a particularly badly obfuscated bit of code. No logic changes.

* util.c (setbpt): Calculate new arg0 in more readable way.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoRemove TCB_FOLLOWFORK
Denys Vlasenko [Thu, 23 Jun 2011 19:46:37 +0000 (21:46 +0200)]
Remove TCB_FOLLOWFORK

TCB_FOLLOWFORK flag seems to be unnecessary, because we either follow
all [v]forks/clones or don't follow any, therefore global variable
followfork is an already existing indicator of what we want to do.
This patch drops all setting/clearing of TCB_FOLLOWFORK bit,
and replaces checks for this bit by checks of followfork value.
In internal_fork, check is moved to in front of if(), since
the check is needed on both "entering" and "exiting" branch.

* defs.h: Remove TCB_FOLLOWFORK define.
* process.c (internal_fork): Do not set/clear TCB_FOLLOWFORK,
  test followfork instead of tcp->flags & TCB_FOLLOWFORK.
  (handle_new_child): Likewise.
* strace.c (startup_attach): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years ago* system.c (sys_capget, sys_capset): Fix pointer arithmetics
Dmitry V. Levin [Thu, 23 Jun 2011 13:25:09 +0000 (13:25 +0000)]
* system.c (sys_capget, sys_capset): Fix pointer arithmetics

13 years agoMake initial tcb allocation more readable. No logic changes.
Denys Vlasenko [Thu, 23 Jun 2011 11:16:23 +0000 (13:16 +0200)]
Make initial tcb allocation more readable. No logic changes.

* strace.c (main): Make initial tcb allocation more readable.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoDo not allocate tiny cap_user_header/data structures, place them on stack.
Denys Vlasenko [Thu, 23 Jun 2011 11:10:28 +0000 (13:10 +0200)]
Do not allocate tiny cap_user_header/data structures, place them on stack.

This allows us to avoid having code to malloc them, and code to check
for malloc failure. Resulting code decrease:
   text    data     bss     dec     hex filename
  10175       0      16   10191    27cf system.o.old
   9797       0       0    9797    2645 system.o

* system.c (sys_capget): Put cap_user_header_t and cap_user_data_t
  on stack, rather than allocating them in heap. These structures
  are very small (a few integer fields), stack is a better place
  for them.
  (sys_capset): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoUse [p]error_msg[_and_die] where appropriate. No logic changes.
Denys Vlasenko [Thu, 23 Jun 2011 11:05:29 +0000 (13:05 +0200)]
Use [p]error_msg[_and_die] where appropriate. No logic changes.

Resulting size changes:
   text    data     bss     dec     hex filename
  17445      16    8572   26033    65b1 strace.o.old
  16850      16    8572   25438    635e strace.o

* strace.c: Replace fprintf[+cleanup]+exit with [p]error_msg_and_die,
  fprintf("progname: ...") with [p]error_msg where appropriate.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoWhitespace cleanups. No code changes.
Denys Vlasenko [Wed, 22 Jun 2011 12:32:43 +0000 (14:32 +0200)]
Whitespace cleanups. No code changes.

* count.c: Place opening curly brace after if (),
  not on the next line. Almost all strace code alredy
  uses this style.
* desc.c: Likewise.
* file.c: Likewise.
* net.c: Likewise.
* pathtrace.c: Likewise.
* process.c: Likewise.
* quota.c: Likewise.
* signal.c: Likewise.
* strace.c: Likewise.
* syscall.c: Likewise.
* time.c: Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoMake strace_fopen abort on error
Denys Vlasenko [Wed, 22 Jun 2011 11:17:16 +0000 (13:17 +0200)]
Make strace_fopen abort on error

Error from strace_fopen in main results in call to exit(1).
Error from strace_fopen in newoutf is propagated to newoutf
callers: startup_attach (where it results in exit(1))
and alloc_tcb (where error is ignored). In second case,
the behavior doesn't seem to be right: it means with -ff
on open error for new LOGFILE.PID the output will continue
to go into *the same file as the previous process* - which
would be confusing. Moreover, on droptcb outf may be closed
and the output of other, still running process outputting
to the same outf will be lost. I don't think this is sane.
IOW: in all cases, error in strace_fopen should be fatal.

* strace.c (strace_fopen): Abort on error instead of returning NULL.
  (newoutf): Change return type to void.
  (startup_attach): Remove error check on newoutf return value.
  (main): Remove error check on strace_fopen return value.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoMake set_cloexec_flag abort on error
Denys Vlasenko [Wed, 22 Jun 2011 11:11:23 +0000 (13:11 +0200)]
Make set_cloexec_flag abort on error

set_cloexec_flag() may fail only if we pass it a bad fd,
such as -1 or non-opened one. If we do, we have a bug
in the caller. It makes no sense to try to continue
running when we detect such a blatant bug in our own code.

* strace (set_cloexec_flag): Abort instead of returning error
  indicator. Change function to return void.
  (strace_fopen): Remove error check on set_cloexec_flag return value.
  (proc_open): Likewise.
  (proc_poll_open): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoMake strace_popen abort on error
Denys Vlasenko [Wed, 22 Jun 2011 11:03:56 +0000 (13:03 +0200)]
Make strace_popen abort on error

It makes no sense to postpone abort on strace_popen error
unti it returns. Moreover, out-of-memory error was exiting
without any message.
While at it, use 0 as "none" for popen_pid, as optimization.

* strace: Initialize popen_pid to 0 - this puts it in bss.
  (trace): Reset popen_pid to 0 instead of -1.
  (strace_popen): Never return NULL as error indicator,
  abort with good error message instead.
  (main): Remove NULL check of strace_popen result.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoDelete fork_tcb()
Denys Vlasenko [Wed, 22 Jun 2011 10:45:25 +0000 (12:45 +0200)]
Delete fork_tcb()

Get rid of fork_tcb() function. It used to do what the comment
above it says, but now it doesn't do much:
it only sets tcp->flags |= TCB_FOLLOWFORK and maybe calls
expand_tcbtab(). The second operation is not necessary, since
alloc_tcp() will do it itself when needed.
This patch deletes fork_tcb(), open-coding tcp->flags |= TCB_FOLLOWFORK
where it was formerly called. It also makes nprocs, tcbtabsize and
expand_tcbtab() static. (While at it, I nuked redundant
extern char **environ declaration: strace.c had *two* of them...)

* defs.h: Remove declarations of nprocs, tcbtabsize and
  expand_tcbtab.
* process.c (fork_tcb): Remove this function.
  (internal_fork): Open-code fork_tcb.
  (handle_new_child): Likewise.
* strace.c: Remove redundant "extern char **environ". Declare
  nprocs and tcbtabsize static.
  (expand_tcbtab): Make it static.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoSimplify expand_tcbtab and alloc_tcb
Denys Vlasenko [Wed, 22 Jun 2011 10:41:57 +0000 (12:41 +0200)]
Simplify expand_tcbtab and alloc_tcb

Get rid of a few intermediate variables, simplifies a few expressions,
and uses error_msg_and_die instead of more verbose
fprintf+cleanup+exit sequence.
In alloc_tcp, I use memset to clear entire new tcp.
This not only saves a few bytes of code, but lowers the chances
of future bugs where some data "leaks out" into new tcb's
from old ones because we forgot to re-initialize it.

* strace.c (expand_tcbtab): Simplify this function. No logic changes.
  (alloc_tcb): Likewise.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoTrivial fixes
Denys Vlasenko [Tue, 21 Jun 2011 22:09:25 +0000 (00:09 +0200)]
Trivial fixes

* process.c (internal_fork): Remove conditionals which make no difference
  (we return 0 on both branches of these ifs).
* util.c: Fix indentation of an ifdef.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoFix build when libaio-devel is not available
Dmitry V. Levin [Tue, 21 Jun 2011 15:11:57 +0000 (15:11 +0000)]
Fix build when libaio-devel is not available

* desc.c: Do not compile code that uses struct iocb unless
HAVE_LIBAIO_H is set.

Reported-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agotests: finish ptrace_setoptions_* merge
Dmitry V. Levin [Thu, 9 Jun 2011 18:23:09 +0000 (18:23 +0000)]
tests: finish ptrace_setoptions_* merge

* tests/Makefile.am (TESTS): Merge ptrace_setoptions_*.
* tests/ptrace_setoptions: Check for Linux kernel > 2.6.

13 years agoRemove write-only nchildren member from struct tcb
Denys Vlasenko [Tue, 21 Jun 2011 14:06:28 +0000 (16:06 +0200)]
Remove write-only nchildren member from struct tcb

* defs.h: Remove nchildren member from struct tcb.
* process.c (handle_new_child): Remove inc/decrements of tcp->nchildren.
  (internal_fork): Likewise.
* strace.c (startup_attach): Likewise.
  (droptcb): Likewise.
  (alloc_tcb): Remove initialization of tcp->nchildren.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoFix tests/ptrace_setoptions_* to match last fix in ptrace options code
Denys Vlasenko [Tue, 21 Jun 2011 13:55:07 +0000 (15:55 +0200)]
Fix tests/ptrace_setoptions_* to match last fix in ptrace options code

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoRemove write-only nzombies member from struct tcb
Denys Vlasenko [Tue, 21 Jun 2011 13:34:40 +0000 (15:34 +0200)]
Remove write-only nzombies member from struct tcb

* defs.h: Remove nzombies member from struct tcb.
* strace.c (droptcb): Remove "tcp->parent->nzombies++".
  (alloc_tcb): Remove "tcp->nzombies = 0".

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoFix regression introduced by "Properly handle real SIGTRAPs" change
Denys Vlasenko [Tue, 21 Jun 2011 12:34:10 +0000 (14:34 +0200)]
Fix regression introduced by "Properly handle real SIGTRAPs" change

Commit 3454e4b463e6c22c7ea8c5461ef5a077f4650a54
introduced a bug: sometimes, TRACECLONE/TRACE[V]FORK opts were not set.
The check (tcp->parent == NULL) in old code was meant to check
"if we are not a child created by auto-attach" - in this case,
options need to be set on the child; otherwise they are inherited
and do not need to be set.
I misunderstood the check and if tcp->parent is not NULL, I was
setting only ptrace_setoptions_for_all bits.
This change fixes the problem. Since the fixed logic makes it
unnecessary to keep two sets of options in separate variables,
I merge them back into one variable, ptrace_setoptions.

* defs.h: Merge ptrace_setoptions_followfork and ptrace_setoptions_for_all
  into one variable, ptrace_setoptions.
* strace.c: Likewise.
  (test_ptrace_setoptions_followfork): Use ptrace_setoptions variable.
  (test_ptrace_setoptions_for_all): Likewise.
  (main): Likewise.
* process.c (internal_fork): Likewise.
  (internal_exec): Likewise.
* strace.c (trace): Fix the bug where different options were set
  depending on "tcp->parent == NULL" condition. Add a comment
  which makes it more clear why this condition is checked.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoDo not suspend waitpid.
Denys Vlasenko [Sat, 18 Jun 2011 09:29:10 +0000 (11:29 +0200)]
Do not suspend waitpid.

strace used to suspend waitpid until there is a child
for waitpid'ing process to collect status from.
Apparently, it was done because in some very old kernels
(circa 2002 or even earlier) there were ptrace bugs which
were making waitpid in real parent to not see children.
This kernel bug is fixed long ago. This change removes the workaround.
test/wait_must_be_interruptible.c is a test program which
illustrates why without this change strace changes
programs's behavior.

* defs.h: Delete waitpid and nclone_waiting members from from struct tcb.
  Remove declaration of internal_wait().
* process.c (internal_wait): Remove this function.
* strace.c (alloc_tcb): Do not set tcp->nclone_waiting.
  (resume): Remove this function.
  (resume_from_tcp): Remove this function.
  (detach): Do not call resume_from_tcp().
  (handle_group_exit): Do not call resume_from_tcp().
* syscall.c (internal_syscall): Do not call internal_wait().

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoEnhance io_submit() decoding
Andi Kleen [Mon, 13 Jun 2011 22:05:44 +0000 (22:05 +0000)]
Enhance io_submit() decoding

strace didn't decode important fields in the iocb passed to io_submit.
This patch changes the code to dump them all.  Also it prefixes the fields
with names to make it easier to read.

* desc.c (iocb_cmd_lookup, print_common_flags): New functions.
(sys_io_submit): New iocb decoder.

13 years agoAdd argument to tprint_iov() specifying whether to decode each iovec
Dmitry V. Levin [Mon, 13 Jun 2011 22:58:44 +0000 (22:58 +0000)]
Add argument to tprint_iov() specifying whether to decode each iovec

* defs.h (tprint_iov): Add decode_iov argument.
* io.c (tprint_iov): Implement new decode_iov argument.
(sys_readv, sys_writev, sys_sendfile, sys_preadv, sys_pwritev): Update
tprint_iov calls.
* net.c (do_msghdr): Likewise.

13 years agoIntroduce ARRAY_SIZE() macro
Dmitry V. Levin [Mon, 13 Jun 2011 21:58:43 +0000 (21:58 +0000)]
Introduce ARRAY_SIZE() macro

* defs.h (ARRAY_SIZE): New macro.
* ioctl.c: Use it.
* pathtrace.c (pathmatch, storepath): Likewise.
* process.c (printpriv): Likewise.
* signal.c: Likewise.
* syscall.c: Likewise.

13 years agoFix decoding of timer id returned by timer_create
Andi Kleen [Mon, 13 Jun 2011 21:37:40 +0000 (21:37 +0000)]
Fix decoding of timer id returned by timer_create

* time.c (sys_timer_create): The kernel returns a integer, not a
pointer for the timer id in the memory pointed to by timer_id.

13 years agoAdd test for PTRACE_O_TRACESYSGOOD
Dmitry V. Levin [Thu, 9 Jun 2011 18:28:02 +0000 (18:28 +0000)]
Add test for PTRACE_O_TRACESYSGOOD

* tests/ptrace_setoptions_for_all: New file.
* tests/Makefile.am (TESTS): Add ptrace_setoptions_for_all.

13 years agotests: update test for linux kernel version
Dmitry V. Levin [Thu, 9 Jun 2011 18:23:09 +0000 (18:23 +0000)]
tests: update test for linux kernel version

* tests/ptrace_setoptions_followfork: Check for Linux kernel > 2.6.

13 years agoUpdate ptrace_setoptions test
Dmitry V. Levin [Thu, 9 Jun 2011 16:10:07 +0000 (16:10 +0000)]
Update ptrace_setoptions test

The test have to be adjusted after commit v4.6-5-g3454e4b.

* ptrace_setoptions: Update grep pattern, rename to
ptrace_setoptions_followfork.
* tests/Makefile.am (TESTS): Rename ptrace_setoptions to
ptrace_setoptions_followfork.

13 years ago* strace.c (verror_msg): Rewrite without use of heap memory allocation
Dmitry V. Levin [Thu, 9 Jun 2011 15:50:41 +0000 (15:50 +0000)]
* strace.c (verror_msg): Rewrite without use of heap memory allocation

13 years agoFix MIPS syscall entries
Dmitry V. Levin [Thu, 9 Jun 2011 15:16:01 +0000 (15:16 +0000)]
Fix MIPS syscall entries

* linux/mips/syscallent.h: Remove duplicate entries for 4336, 4337,
and 4338 syscall numbers.

Reported-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoDon't display bogus parameter for sigreturn syscall
Denys Vlasenko [Wed, 8 Jun 2011 23:43:22 +0000 (01:43 +0200)]
Don't display bogus parameter for sigreturn syscall

* linux/*/syscallent.h: For those arches which use sys_sigreturn,
not printargs, to show [rt_]sigreturn syscall, change number of arguments
from 1 to 0: sys_sigreturn function doesn't use syscall parameters.
(I guess kernel doesn't actually _have_ any parameters for this syscall,
at least on these architectures). Do the same change for I386 and x86-64
even though they use printargs: I looked at kernel code and syscall
definitely doesn't have any parameters on these arches.
(I hesitate to change 1 to 0 params for arches I don't know -
it is remotely possible some of them do have a parameter for this syscall).

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoOptimize sigreturn handling
Denys Vlasenko [Wed, 8 Jun 2011 23:36:29 +0000 (01:36 +0200)]
Optimize sigreturn handling

* signal.c (sys_sigreturn): move stack pointer variables,
and for SPARC and MIPS, stack pointer and sigmask reading code
into "if (entering) ..." block, because it is only needed
in this branch; load tcp->u_arg[1] into sigmask for display
_after_ we know for sure u_arg[1] does contain valid sigmask
(IOW: perform operation only when we know we will need the result)

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoDo not call umoven to fetch parameters if we have zero params
Denys Vlasenko [Wed, 8 Jun 2011 23:32:23 +0000 (01:32 +0200)]
Do not call umoven to fetch parameters if we have zero params

* syscall.c [I386] (syscall_enter): Do not call umoven
to fetch zero bytes. This is just an optimization.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years ago"Modernize" four old-style function parameter declarations
Denys Vlasenko [Wed, 8 Jun 2011 23:28:11 +0000 (01:28 +0200)]
"Modernize" four old-style function parameter declarations

* signal.c (signame, long_to_sigset, printsigmask, printsignal):
Convert old-style C function definitions to a "modern" form.
This does not change any actual code.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoFix sigreturn decoding on MIPS
Denys Vlasenko [Wed, 8 Jun 2011 23:22:10 +0000 (01:22 +0200)]
Fix sigreturn decoding on MIPS

The "return 0" line was accidentally deleted circa 2007,
which made sigreturn on MIPS always display "= 0" return
instead of more informative " = ? (mask now [MASK])".

* strace.c (sys_sigreturn): Add wrongly deleted "return 0" line

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoPrint at least one space between SYSCALL(ARGS) and = RESULT if tracee is killed
Denys Vlasenko [Wed, 8 Jun 2011 14:15:04 +0000 (16:15 +0200)]
Print at least one space between SYSCALL(ARGS) and = RESULT if tracee is killed

We already do it in the normal case, but in rare code path where
tracee is gone (SIGKILLed?) sometimes we were printing this:
"SYSCALL(ARGS <unavailable>)= ? <unavailable>" - note jammed together ")=".
test/sigkill_rain.c can be used to verify the fix.

* strace.c (printleader): add a space after ")" in " <unavailable>)"

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoAdd fflush after printf in test/sigkill_rain.c
Denys Vlasenko [Wed, 8 Jun 2011 14:07:03 +0000 (16:07 +0200)]
Add fflush after printf in test/sigkill_rain.c

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoUpdate test/* directory, it seem to be a bit bit-rotted
Denys Vlasenko [Wed, 8 Jun 2011 12:08:59 +0000 (14:08 +0200)]
Update test/* directory, it seem to be a bit bit-rotted

Added README; modified sigkill_rain.c to be more understandable,
made clone.c compile; added wait_must_be_interruptible.c test;
updated Makefile and .gitignore.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoWhitespace cleanups. no code changes.
Denys Vlasenko [Tue, 7 Jun 2011 10:13:24 +0000 (12:13 +0200)]
Whitespace cleanups. no code changes.

* bjm.c: Fix tabulation (such as extra spaces before tabs),
convert punctuation where it deviates from prevalent form
elsewhere in strace code, convert sizeof and offsetof where
it deviates from from prevalent form, remove space between
function/macro/array names and (parameters) or [index],
add space between "if" and (condition), correct non-standard
or wrong indentaion.
* defs.h: Likewise
* desc.c: Likewise
* file.c: Likewise
* ipc.c: Likewise
* linux/arm/syscallent.h: Likewise
* linux/avr32/syscallent.h: Likewise
* linux/hppa/syscallent.h: Likewise
* linux/i386/syscallent.h: Likewise
* linux/ioctlsort.c: Likewise
* linux/m68k/syscallent.h: Likewise
* linux/microblaze/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/tile/syscallent.h: Likewise
* linux/x86_64/syscallent.h: Likewise
* mem.c: Likewise
* net.c: Likewise
* pathtrace.c: Likewise
* process.c: Likewise
* signal.c: Likewise
* sock.c: Likewise
* strace.c: Likewise
* stream.c: Likewise
* sunos4/syscall.h: Likewise
* sunos4/syscallent.h: Likewise
* svr4/syscall.h: Likewise
* svr4/syscallent.h: Likewise
* syscall.c: Likewise
* system.c: Likewise
* test/childthread.c: Likewise
* test/leaderkill.c: Likewise
* test/skodic.c: Likewise
* time.c: Likewise
* util.c: Likewise

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoARM EABI: fix 64-bit syscall's arguments decoding
Dmitry V. Levin [Sat, 28 May 2011 20:47:43 +0000 (20:47 +0000)]
ARM EABI: fix 64-bit syscall's arguments decoding

ARM OABI and ARM EABI have different function parameters passing rules.
With EABI, 64-bit function parameters passed in registers are aligned to
an even-numbered register instead of using the next available pair, see
http://lkml.org/lkml/2006/1/12/175
This rule also applies to syscall's arguments.

* linux/arm/syscallent.h (pread, pwrite, truncate64, ftruncate64,
readahead, preadv, pwritev): Fix number of arguments.
* util.c (printllval): Align 64bit argument to 64bit boundary on
__ARM_EABI__.

Reported-by: Damir Shayhutdinov <damir@altlinux.org>
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
13 years agoLinux: implement decoding of preadv and pwritev syscalls
Damir Shayhutdinov [Thu, 12 May 2011 12:57:40 +0000 (16:57 +0400)]
Linux: implement decoding of preadv and pwritev syscalls

* io.c [LINUX && HAVE_SYS_UIO_H] (sys_preadv, sys_pwritev): New functions.
* linux/syscall.h (sys_preadv, sys_pwritev): Declare them.
* linux/*/syscallent.h: Use them.

Signed-off-by: Damir Shayhutdinov <damir@altlinux.ru>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
13 years ago"Modernize" all old-style function parameter declarations
Denys Vlasenko [Mon, 30 May 2011 12:00:14 +0000 (14:00 +0200)]
"Modernize" all old-style function parameter declarations

* bjm.c: Convert all remaining old-style C function definitions
to a "modern" form. This does not change any actual code.
* io.c: Likewise
* ioctl.c: Likewise
* net.c: Likewise
* proc.c: Likewise
* process.c: Likewise
* signal.c: Likewise
* sock.c: Likewise
* strace.c: Likewise
* stream.c: Likewise
* syscall.c: Likewise
* system.c: Likewise
* time.c: Likewise
* util.c: Likewise

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoCleanups on top of "handle SIGTRAP properly" change,
Denys Vlasenko [Fri, 27 May 2011 12:36:01 +0000 (14:36 +0200)]
Cleanups on top of "handle SIGTRAP properly" change,
based on Dmitry's comments.

* defs.h ([p]error_msg[_and_die]): Declare new functions.
* strace.c (SYSCALLTRAP): Rename to syscall_trap_sig.
([p]error_msg[_and_die]): Define new functions.
(strace_tracer_pid): New variable, it controls which pid will
do cleanup on exit via [p]error_msg_and_die.
(main): Set strace_tracer_pid to our initial pid.
(startup_attach): Change strace_tracer_pid if we are in -D mode.
(test_ptrace_setoptions_for_all): Minor changes to logic,
such as better diagnostic messages.

13 years agoIdentifier "errno" may be a macro, it's unsafe to use it
Denys Vlasenko [Wed, 25 May 2011 13:33:26 +0000 (15:33 +0200)]
Identifier "errno" may be a macro, it's unsafe to use it

* strace.c (strerror): Rename parameter errno to err_no

13 years agoDon't perform TCB_WAITEXECVE wait if not needed.
Denys Vlasenko [Tue, 24 May 2011 18:30:24 +0000 (20:30 +0200)]
Don't perform TCB_WAITEXECVE wait if not needed.

* defs.h (ptrace_setoptions_for_all): Expose this variable.
* strace.c (ptrace_setoptions_for_all): Remove "static".
* process.c (internal_exec): Don't set TCB_WAITEXECVE bit
if we know that post-execve SIGTRAP is not going to happen.

13 years agoProperly handle real SIGTRAPs.
Denys Vlasenko [Mon, 23 May 2011 19:29:03 +0000 (21:29 +0200)]
Properly handle real SIGTRAPs.

* defs.h (ptrace_setoptions): Variable renamed to ptrace_setoptions_followfork.
* process.c (internal_fork): Ditto.
* strace.c (ptrace_setoptions_for_all): New variable.
(SYSCALLTRAP): New variable.
(error_msg_and_die): New function.
(test_ptrace_setoptions_for_all): New function.
(main): Call test_ptrace_setoptions_for_all() at init.
(handle_ptrace_event): Handle PTRACE_EVENT_EXEC (by ignoring it).
(trace): Check events and set ptrace options without -f too.
Check WSTOPSIG(status) not for SIGTRAP, but for SYSCALLTRAP.

13 years agoBlackfin: update syscall list
Mike Frysinger [Thu, 21 Apr 2011 09:19:35 +0000 (05:19 -0400)]
Blackfin: update syscall list

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* linux/bfin/syscallent.h: Add name_to_handle_at, open_by_handle_at,
clock_adjtime, and syncfs syscalls.

13 years agolinux: add new EHWPOISON errno
Mike Frysinger [Thu, 21 Apr 2011 09:19:20 +0000 (05:19 -0400)]
linux: add new EHWPOISON errno

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* linux/errnoent.h: Change ERRNO_133 to EHWPOISON.

13 years agoAdd ability to print file descriptor paths and filter by those paths
Grant Edwards [Thu, 7 Apr 2011 20:25:40 +0000 (20:25 +0000)]
Add ability to print file descriptor paths and filter by those paths

* pathtrace.c: New file, implements matching syscall arguments to
user-specified file paths.
* Makefile.am (strace_SOURCES): Add pathtrace.c.
* defs.h (TCB_FILTERED, filtered): New defines.
(getfdpath, pathtrace_select, pathtrace_match, show_fd_path,
tracing_paths): New declarations.
* strace.c (show_fd_path, tracing_paths): New global variables.
(usage, main): Implement handling of -y and -P options.
* strace.1: Add descriptions of -y and -P options.
* syscall.c (trace_syscall_entering): Add path matching logic to the
print/noprint decision and set the TCB_FILTERED bit appropriately.
(trace_syscall_exiting): Use filtered() macro that checks the
TCB_FILTERED bit to determine print/noprint status.
* util.c (printfd): Use getfdpath().

13 years agoFix BLKTRACESTOP definition
Dmitry V. Levin [Thu, 7 Apr 2011 19:58:10 +0000 (19:58 +0000)]
Fix BLKTRACESTOP definition

* block.c: Fix typo in the check for BLKTRACESTOP.
Reported by Gabor Z. Papp.

13 years agoEnsure that PTRACE_GETSIGINFO et al are always defined on Linux v4.6
Dmitry V. Levin [Tue, 15 Mar 2011 17:19:09 +0000 (17:19 +0000)]
Ensure that PTRACE_GETSIGINFO et al are always defined on Linux

* configure.ac (AC_CHECK_DECLS): Add PTRACE_* constants.
* defs.h [LINUX]: Define those PTRACE_* constants that are not provided
by <sys/ptrace.h>.

13 years ago* CREDITS.in: Fix typo.
Dmitry V. Levin [Tue, 15 Mar 2011 15:46:52 +0000 (15:46 +0000)]
* CREDITS.in: Fix typo.

13 years agoUpdate PTRACE_* constants
Dmitry V. Levin [Mon, 14 Mar 2011 21:58:59 +0000 (21:58 +0000)]
Update PTRACE_* constants

* process.c (ptrace_cmds): Add PTRACE_GETREGSET and PTRACE_SETREGSET.

13 years agoPrepare for 4.6 release
Dmitry V. Levin [Mon, 21 Feb 2011 22:58:59 +0000 (22:58 +0000)]
Prepare for 4.6 release

* NEWS: Update for 4.6 release.
* configure.ac: Version 4.6.
* debian/changelog: 4.6-1.
* strace.spec: 4.6-1.

13 years agolinux/ioctlent: unify them all
Mike Frysinger [Mon, 21 Feb 2011 04:24:22 +0000 (23:24 -0500)]
linux/ioctlent: unify them all

This unifies all the ioctlent.h's in the linux subdir while still
allowing each arch to maintain its own minor list.

The basic method is:
- each arch has linux/<arch>/ioctlent.h.in which defines only the
arch-specific ioctls;
- linux/ioctlent.h.in which defines only the common ioctls;
- at build time, these two headers are combined and sorted to produce
the linux/ioctlent.h file.

This also requires a little tweaking of the include files since the
common ioctlent.h is a built file.

* linux/ioctlent.h: Split into linux/ioctlent.h.in and
linux/i386/ioctlent.h.in, remove asm entries from the former, remove
non-asm entries from the latter.
* linux/alpha/ioctlent.h: Rename to linux/alpha/ioctlent.h.in, remove
non-asm entries.
* linux/bfin/ioctlent.h: Rename to linux/bfin/ioctlent.h.in, remove
non-asm entries.
* linux/hppa/ioctlent.h: Rename to linux/hppa/ioctlent.h.in, remove
non-asm entries.
* linux/ia64/ioctlent.h: Rename to linux/ia64/ioctlent.h.in, remove
non-asm entries.
* linux/mips/ioctlent.h: Rename to linux/mips/ioctlent.h.in, remove
non-asm entries.
* linux/powerpc/ioctlent.h: Rename to linux/powerpc/ioctlent.h.in,
remove non-asm entries.
* linux/s390/ioctlent.h: Rename to linux/s390/ioctlent.h.in, remove
non-asm entries.
* linux/sh/ioctlent.h: Rename to linux/sh/ioctlent.h.in, remove
non-asm entries.
* linux/sparc/ioctlent.h: Rename to linux/sparc/ioctlent.h.in, remove
non-asm entries.
* linux/arm/ioctlent.h.in: New file.
* linux/avr32/ioctlent.h.in: Likewise.
* linux/i386/ioctlent.h.in: Likewise.
* linux/m68k/ioctlent.h.in: Likewise.
* linux/microblaze/ioctlent.h.in: Likewise.
* linux/tile/ioctlent.h.in: Likewise.
* linux/x86_64/ioctlent.h.in: Likewise.
* linux/s390x/ioctlent.h.in: Include ioctlent.h.in instead of
ioctlent.h.
* linux/sh64/ioctlent.h.in: Likewise.
* linux/sparc64/ioctlent.h.in: Likewise.
* linux/arm/ioctlent1.h: Update ioctlent.h include.
* linux/powerpc/ioctlent1.h: Likewise.
* linux/sparc/ioctlent1.h: Likewise.
* linux/sparc64/ioctlent1.h: Likewise.
* linux/x86_64/ioctlent1.h: Likewise.
* Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS).
(EXTRA_DIST): Update.
[MAINTAINER_MODE && LINUX]: Convert from ioctlent_h to ioctlent_h_in.
[LINUX]: Add $(builddir)/$(OS)/ioctlent.h generation rules.
* .gitignore: Add linux/ioctlent.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoShow more details about signals received by traced processess
Dmitry V. Levin [Thu, 10 Mar 2011 21:20:35 +0000 (21:20 +0000)]
Show more details about signals received by traced processess

* strace.c [!USE_PROCFS] (trace): Differentiate output format depending
on PTRACE_GETSIGINFO success or failure.  In the former case, use
printsiginfo() to show more details about received signal.

13 years agoGet rid of PT_GETSIGINFO
Dmitry V. Levin [Thu, 10 Mar 2011 14:44:45 +0000 (14:44 +0000)]
Get rid of PT_GETSIGINFO

* strace.c [!USE_PROCFS] (trace): Assume that PTRACE_GETSIGINFO is
available.  Replace PT_GETSIGINFO with PTRACE_GETSIGINFO.  Use
PTRACE_GETSIGINFO for all signals.

13 years agoEnhance decoding of kernel-generated signals
Dmitry V. Levin [Thu, 10 Mar 2011 23:14:47 +0000 (23:14 +0000)]
Enhance decoding of kernel-generated signals

* signal.c (printsiginfo) [LINUX]: Do not print uninteresting
zero-initialized fields.

13 years agoFix decoding of user-generated signals
Dmitry V. Levin [Thu, 10 Mar 2011 22:18:56 +0000 (22:18 +0000)]
Fix decoding of user-generated signals

* signal.c [LINUX] (SI_FROMUSER): Define.
[LINUX || SVR4] (printsiginfo) [SI_FROMUSER]: Enhance decoding.

13 years agoRecognize SI_KERNEL and SI_ASYNCNL
Dmitry V. Levin [Thu, 10 Mar 2011 21:41:34 +0000 (21:41 +0000)]
Recognize SI_KERNEL and SI_ASYNCNL

* signal.c [LINUX] (SI_KERNEL, SI_ASYNCNL): Define.
[LINUX || SVR4] (siginfo_codes): Add entries for SI_KERNEL and
SI_ASYNCNL, reorder entries.

13 years agoTake all git branches into account for generation of CREDITS file
Sebastian Pipping [Fri, 4 Mar 2011 01:21:28 +0000 (02:21 +0100)]
Take all git branches into account for generation of CREDITS file

* Makefile.am: Make CREDITS target depend on all git branches.

13 years agoFix decoding of file descriptors
Dmitry V. Levin [Fri, 4 Mar 2011 02:08:02 +0000 (05:08 +0300)]
Fix decoding of file descriptors

* defs.h (printfd): New function prototype.
* util.c (printfd): New function.
* file.c (print_dirfd): Update prototype to use printfd().
(sys_openat, sys_faccessat, sys_newfstatat, sys_mkdirat, sys_linkat,
sys_unlinkat, sys_readlinkat, sys_renameat, sys_fchownat, sys_fchmodat,
sys_futimesat, sys_utimensat, sys_mknodat): Update use of print_dirfd().
(sys_lseek, sys_llseek, sys_readahead, sys_ftruncate, sys_ftruncate64,
sys_fstat, sys_fstat64, sys_oldfstat, sys_fstatfs, sys_fstatfs64,
sys_fchdir, sys_fchroot, sys_linkat, sys_fchown, sys_fchmod, sys_fsync,
sys_readdir, sys_getdents, sys_getdirentries, sys_fsetxattr,
sys_fgetxattr, sys_flistxattr, sys_fremovexattr, sys_fadvise64,
sys_fadvise64_64, sys_inotify_add_watch, sys_inotify_rm_watch,
sys_fallocate): Use printfd() for decoding of file descriptors.
* desc.c (sys_fcntl, sys_flock, sys_close, sys_dup, do_dup2,
decode_select, sys_epoll_ctl, epoll_wait_common): Use printfd() for
decoding of file descriptors.
* io.c (sys_read, sys_write, sys_readv, sys_writev, sys_pread,
sys_pwrite, sys_sendfile, sys_sendfile64, sys_pread64, sys_pwrite64,
sys_ioctl): Likewise.
* mem.c (print_mmap, sys_mmap64): Likewise.
* signal.c (do_signalfd): Likewise.
* stream.c (decode_poll): Likewise.
* time.c (sys_timerfd_settime, sys_timerfd_gettime): Likewise.
Based on patch from Grant Edwards <grant.b.edwards@gmail.com>.

13 years agoPrint shutdown(2) modes as SHUT_* constants
Sebastian Pipping [Thu, 3 Mar 2011 00:12:25 +0000 (01:12 +0100)]
Print shutdown(2) modes as SHUT_* constants

* net.c (shutdown_modes): New xlat structure.
(sys_shutdown): Use shutdown_modes to decode 2nd syscall argument.

13 years agoFix decoding of inotify_init1() flags
Sebastian Pipping [Wed, 2 Mar 2011 23:50:55 +0000 (00:50 +0100)]
Fix decoding of inotify_init1() flags

* file.c (inotify_init_flags): New xlat structure.
(sys_inotify_init1): Use it instead of open_mode_flags.

13 years agoFix struct xlat initialization bugs
Dmitry V. Levin [Thu, 3 Mar 2011 01:02:41 +0000 (01:02 +0000)]
Fix struct xlat initialization bugs

* file.c (inotify_modes): Terminate with NULL entry.
* net.c (sock_type_flags): Make this array static.
(socketlayers): Add a comment that this array should remain not
NULL-terminated.

13 years agotests: avoid SIGPIPE
Dmitry V. Levin [Thu, 3 Mar 2011 00:10:20 +0000 (00:10 +0000)]
tests: avoid SIGPIPE

* tests/ptrace_setoptions: Replace "grep -q" with "grep > /dev/null".
The former may result to strace being killed by SIGPIPE, which in
certain configuratons may lead to generation of a core file.
Suggested by Mike Frysinger.

13 years agotests: do not make missing /usr/bin/time a failure
Mike Frysinger [Tue, 1 Mar 2011 00:57:24 +0000 (19:57 -0500)]
tests: do not make missing /usr/bin/time a failure

* tests/init.sh (framework_skip_): New function.
(check_prog): Use it instead of framework_failure_.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoGenerate an xz tar archive of the distribution
Dmitry V. Levin [Sun, 27 Feb 2011 14:05:58 +0000 (14:05 +0000)]
Generate an xz tar archive of the distribution

* configure.ac (AM_INIT_AUTOMAKE): Replace dist-bzip2 with dist-xz.
* Makefile.am: Update srpm target.
* make-dist: Update for dist-xz.
* strace.spec: Update Source tag.
* debian/watch: Update regexp.
* .gitignore: Add strace-*.tar.xz.

13 years agoUse "make check" in debian/rules and strace.spec
Dmitry V. Levin [Sun, 27 Feb 2011 10:16:41 +0000 (10:16 +0000)]
Use "make check" in debian/rules and strace.spec

* debian/control: Update Build-Depends.
* debian/rules: Run "make check".
* strace.spec: Update BuildRequires. Run "make check" in %check section.

13 years agoImplement two basic "strace -f" tests
Dmitry V. Levin [Sun, 27 Feb 2011 00:28:50 +0000 (00:28 +0000)]
Implement two basic "strace -f" tests

* Makefile.am (SUBDIRS): Add tests.
* configure.ac (AC_CONFIG_FILES): Add tests/Makefile.
* tests/.gitignore: New file.
* tests/Makefile.am: Likewise.
* tests/init.sh: Likewise.
* tests/ptrace_setoptions: Likewise.
* tests/strace-f: Likewise.

13 years agoppc, s390, sparc: regenerate ioctlent.h files
Dmitry V. Levin [Sat, 26 Feb 2011 14:39:21 +0000 (14:39 +0000)]
ppc, s390, sparc: regenerate ioctlent.h files

* linux/powerpc/ioctlent.h: Regenerated using Fedora 15 kernel headers.
* linux/s390/ioctlent.h: Likewise.
* linux/sparc/ioctlent.h: Likewise.

13 years agoRemove redundant ioctlent.h files
Dmitry V. Levin [Sat, 26 Feb 2011 14:32:12 +0000 (14:32 +0000)]
Remove redundant ioctlent.h files

* linux/s390x/ioctlent.h: Replace old contents with include of
s390/ioctlent.h file.
* linux/sparc64/ioctlent.h: Replace old contents with include of
sparc/ioctlent.h file.

13 years agoioctlsort: sync with ioctl_lookup()
Dmitry V. Levin [Fri, 25 Feb 2011 23:29:01 +0000 (23:29 +0000)]
ioctlsort: sync with ioctl_lookup()

* linux/ioctlsort.c (main): Use NR and TYPE bits only, to sync with
ioctl_lookup() which looks at these bits only.

13 years agoRemove obsolete .cvsignore files
Dmitry V. Levin [Fri, 25 Feb 2011 16:53:50 +0000 (16:53 +0000)]
Remove obsolete .cvsignore files

* test/.cvsignore: Rename to test/.gitignore.
* */.cvsignore, */*/.cvsignore: Removed.

13 years agoIgnore generated intermediate header files
Dmitry V. Levin [Fri, 25 Feb 2011 16:47:51 +0000 (16:47 +0000)]
Ignore generated intermediate header files

* .gitignore: Add ioctls.h and ioctldefs.h.

13 years agoGenerate much of the CREDITS file from git log
Dmitry V. Levin [Thu, 24 Feb 2011 01:51:15 +0000 (01:51 +0000)]
Generate much of the CREDITS file from git log

* CREDITS.in: New file, derived from CREDITS, without names of
those who are listed as git log 'Author:'s.
* CREDITS: Remove file.
* Makefile.am [MAINTAINER_MODE] (CREDITS): New rule.
* .gitignore: Add CREDITS.
* .mailmap: New file, required to map git author names and email
addresses to canonical/preferred form.

13 years agosparc: fix compilation warning
Dmitry V. Levin [Wed, 23 Feb 2011 16:16:50 +0000 (16:16 +0000)]
sparc: fix compilation warning

* file.c [!HAVE_LONG_LONG_OFF_T] (realprintstat): Cast st_size
to unsigned long.

13 years agoUpdate the list of files that must be distributed
Dmitry V. Levin [Wed, 23 Feb 2011 12:43:46 +0000 (12:43 +0000)]
Update the list of files that must be distributed

* Makefile.am (EXTRA_DIST): Add debian/source/format, debian/watch,
linux/ia64/signalent.h, linux/powerpc/ioctlent1.h,
linux/powerpc/syscallent1.h, linux/powerpc/errnoent1.h,
linux/powerpc/signalent1.h.

13 years agoFix compilation warning reported by gcc -Wunused-but-set-variable
Dmitry V. Levin [Wed, 23 Feb 2011 00:27:12 +0000 (00:27 +0000)]
Fix compilation warning reported by gcc -Wunused-but-set-variable

* process.c (printwaitn) [!SUNOS4]: Do not define "exited" variable.

13 years agoioctlsort: zero pad ioctl codes to 4 places
Mike Frysinger [Tue, 22 Feb 2011 04:52:42 +0000 (23:52 -0500)]
ioctlsort: zero pad ioctl codes to 4 places

Zero padding the ioctl number will allow simple sorting via shell scripts.

* linux/ioctlsort.c (main): Output ioctl codes zero padded.
* linux/ioctlent.h: Regenerated.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoUpdate mount flags to latest linux
Mike Frysinger [Tue, 22 Feb 2011 04:04:30 +0000 (23:04 -0500)]
Update mount flags to latest linux

* system.c (MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION,
MS_STRICTATIME, MS_BORN): Define.
(mount_flags): Add MS_RELATIME, MS_KERNMOUNT, MS_I_VERSION,
MS_STRICTATIME, MS_BORN.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoSync debian/changelog and strace.spec with packages
Dmitry V. Levin [Mon, 21 Feb 2011 23:22:34 +0000 (23:22 +0000)]
Sync debian/changelog and strace.spec with packages

* debian/changelog: Sync with 4.5.20-2.
* strace.spec: Likewise.

13 years agoAdd TRACE_DESC|TRACE_FILE flags to fanotify_* sysentries
Dmitry V. Levin [Sun, 20 Feb 2011 20:24:52 +0000 (20:24 +0000)]
Add TRACE_DESC|TRACE_FILE flags to fanotify_* sysentries

* linux/*/syscallent.h: Add TD flag to fanotify_init.  Add TD|TF flags
to fanotify_mark.

13 years agoFix flags of fallocate sysentries
Dmitry V. Levin [Sun, 20 Feb 2011 20:17:00 +0000 (20:17 +0000)]
Fix flags of fallocate sysentries

* linux/*/syscallent.h: Fix sys_fallocate flags.

13 years agoAdd TRACE_DESC flag to epoll_create* sysentries
Dmitry V. Levin [Sun, 20 Feb 2011 19:58:09 +0000 (19:58 +0000)]
Add TRACE_DESC flag to epoll_create* sysentries

* linux/*/syscallent.h: Add TD flag to sys_epoll_create and
sys_epoll_create1.

13 years agoAdd TRACE_DESC flag to fgetxattr, flistxattr, and fremovexattr sysentries
Dmitry V. Levin [Sun, 20 Feb 2011 19:50:28 +0000 (19:50 +0000)]
Add TRACE_DESC flag to fgetxattr, flistxattr, and fremovexattr sysentries

* linux/*/syscallent.h: Add TD flag to sys_fgetxattr, sys_flistxattr,
and fremovexattr.

13 years agoAdd TRACE_FILE flag to swapoff sysentries
Dmitry V. Levin [Sun, 20 Feb 2011 19:14:10 +0000 (19:14 +0000)]
Add TRACE_FILE flag to swapoff sysentries

* linux/*/syscallent.h: Add TF flag to sys_swapoff.

13 years agoAdd TRACE_DESC flag to fadvise64* sysentries
Dmitry V. Levin [Sun, 20 Feb 2011 15:23:22 +0000 (15:23 +0000)]
Add TRACE_DESC flag to fadvise64* sysentries

* linux/*/syscallent.h: Add TD flag to sys_fadvise64 and
sys_fadvise64_64.

13 years agoAdd TRACE_DESC flag to mmap, mmap2, and old_mmap sysentries
Dmitry V. Levin [Sun, 20 Feb 2011 15:10:32 +0000 (15:10 +0000)]
Add TRACE_DESC flag to mmap, mmap2, and old_mmap sysentries

* linux/*/syscallent.h: Add TD flag to sys_mmap and sys_old_mmap.

13 years agoDo not initialize native_scno on platforms with only one personality
Dmitry V. Levin [Sun, 20 Feb 2011 13:25:04 +0000 (13:25 +0000)]
Do not initialize native_scno on platforms with only one personality

* linux/bfin/syscallent.h: Remove redundant native_scno initialization.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.

13 years agoAdd LOOP_* ioctls defined in linux/loop.h
Dmitry V. Levin [Sun, 20 Feb 2011 12:25:12 +0000 (12:25 +0000)]
Add LOOP_* ioctls defined in linux/loop.h

* linux/ioctlent.sh: Add LOOP_* ioctls (0x4C..) defined in linux/loop.h
header file.
* linux/ioctlent.h: Regenerated.
Reported by Mike Frysinger.

13 years agoFix PTRACE_GETEVENTMSG usage and enhance test_ptrace_setoptions()
Dmitry V. Levin [Sat, 19 Feb 2011 21:33:50 +0000 (21:33 +0000)]
Fix PTRACE_GETEVENTMSG usage and enhance test_ptrace_setoptions()

* strace.c (handle_ptrace_event): Fix PTRACE_GETEVENTMSG usage.
(test_ptrace_setoptions): Test that PTRACE_GETEVENTMSG works properly.

13 years agolinux/sparc: move to common syscall.h
Mike Frysinger [Sat, 19 Feb 2011 20:48:52 +0000 (15:48 -0500)]
linux/sparc: move to common syscall.h

Rather than constantly deal with the sparc/syscall.h going stale, merge
the few sparc-specific pieces into the linux/syscall.h header.

* linux/syscall.h: Add sparc-specific pieces from sparc/syscall.h.
* Makefile.am (EXTRA_DIST): Remove linux/sparc/syscall.h and
linux/sparc64/syscall.h.
* linux/sparc/syscall.h, linux/sparc64/syscall.h: Deleted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agosparc: add new funcs to syscall.h
Mike Frysinger [Sat, 19 Feb 2011 20:32:07 +0000 (15:32 -0500)]
sparc: add new funcs to syscall.h

Sync missing defs from the common syscall.h here.

* linux/sparc/syscall.h: Add sys_setfsuid, sys_pread64, and
sys_pwrite64 prototypes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>