Exit trace loop if got ECHILD, not if nprocs == 0.

Comment gives a testcase which wasn't handled correctly
by the old code.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
If -o|logger is in use, exit trace loop if nprocs == 0.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
PTRACE_SEIZE can set ptrace options immediately, use this feature

This eliminates some rare bugs, such as post-execve SIGTRAP
generation when we attach to a process, and it manages to finish
execve'ing before we set TRACEEXEC option to suppress that.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
powerpc: fix iflag build issue (static -> extern)

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
powerpc: fix some compiler warnings

Fix a number of differing signedness warnings when building on
powerpc.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
powerpc: enhance 32/64bit detection

We were using uname to determine if userspace was 32 or 64bit.
This fails when we have a 64bit kernel and a 32bit userspace.

* configure.ac (powerpc*): Similar to x86, use a runtime test
to determine if we are 32 or 64bit.

Signed-off-by: Anton Blanchard <anton@samba.org>
Improve sigreturn decoding on x86 to show RT signal bits too.

This includes decoding of 32-bit sigreturn by 64-bit strace,
which previously wasn't done.

Added a test for it.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Group USE_CUSTOM_PRINTF define with other tweakables

No code changes.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>