IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
* syscall.c (syscall_enter): Rename to get_syscall_args.
Document its return values.
(trace_syscall_entering): Don't check get_syscall_args() return
value for 0, it never returns that.
(syscall_fixup_on_sysexit): Make it return void.
(trace_syscall_exiting): Fix up syscall_fixup_on_sysexit()
call site accordingly.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Thank you Dmitry for spotting it.
* ioctl.c (compare): Partially revert last change - the new
comparison logic was buggy.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
text data bss dec hex filename
236973 704 18944 256621 3ea6d strace.before
236929 704 18944 256577 3ea41 strace
* ioctl.c (compare): Simplify generation of compare result.
(ioctl_lookup): Pass key directly, not as part of dummy struct.
(ioctl_next_match): More readable code. No logic changes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Undefined syscall looked like this before this change:
{ 5, 0, printargs, "SYS_53" },
That is, "SYS_53" string had to be allocated and stored in strace binary.
Since now SCNO_IN_RANGE() macro requires sysent[scno].sys_func != NULL
for valid syscalls, we can replace printargs with NULL in such lines
and make them "invalid", thus not requiring syscall name string.
Savings on i386:
text data bss dec hex filename
237389 704 18944 257037 3ec0d strace.before
236973 704 18944 256621 3ea6d strace
Savings on mips:
336551 153692 38320 528563 810b3 strace.before
275543 153688 38320 467551 7225f strace
Tested to still decode undefined syscalls correctly (syscall no. 222 on i386).
* linux/*/syscallent.h: Replace 'printargs, "SYS_nnn"' with
'NULL, NULL'.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
sys_pwrite seems to do the same thing as sys_pwrite64
which we deleted when we removed non-Linux code.
* linux/mips/syscallent.h: s/sys_pwrite64/sys_pwrite/
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
text data bss dec hex filename
237917 672 18980 257569 3ee21 strace
237845 672 18980 257497 3edd9 strace_new
* defs.h: Remove declarations of internal_fork and internal_exec.
* process.c: Remove definitions of internal_fork and internal_exec.
* syscall.c: Move them here.
(internal_syscall): Return void instead of int. We were always
returning zero, and callers weren't checking it anyway.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Compile tested in qemu on armv4l,armv4tl,armv5l,armv6l,i686,
mipsel,mips,x86_64
* syscall.c: Remove code which handles RVAL_Lfoo constants.
* defs.h: Remove struct tcb::u_lrval member - it is never set.
Remove RVAL_Lfoo constants which signify return of "long" result -
they are never used.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
It is buggy: it returns RVAL_LUDECIMAL, which means the return value
is in tcp->u_lrval. But tcp->u_lrval is never set
(on Linux - it used to be set on other OSes).
* file.c (sys_lseek): Remove a version of this function which is
supposed to be used if off_t is long long. It appears to be buggy
and unused.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
It looks like sys_lseek64() is never used.
For one, it is buggy (always shows 0 return value), and no one complains.
From code inspection: sys_lseek64 name is not used anywhere.
It is defined to sys_lseek if HAVE_LONG_LONG_OFF_T is true.
Thus, if !HAVE_LONG_LONG_OFF_T, it is never used.
Therefore "if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T"
conditional it sits in can be simplified to
"if HAVE_LONG_LONG_OFF_T".
Therefore, we can move it a bit up and merge with
"if !HAVE_LONG_LONG_OFF_T, use this sys_lseek()" code block,
by addind an "else" clause to it.
To simplify it more, drop define and just rename sys_lseek64 ->
sys_lseek.
Since the function is buggy, I think it is unused and we can
just drop it. (I checked: at least I386 never uses it).
* file.c (sys_lseek64): Rename to sys_lseek; don't compile it
if _LFS64_LARGEFILE but !HAVE_LONG_LONG_OFF_T since in this case
it is never used.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Affected names are "_newselect", "_llseek", "_sysctl".
I see no apparent reason why they have leading underscores.
Moreover, some arches have underscored names and some have
non-underscored ones. This is not consistent.
I verified that every architectire I touched did not have
a similarly named syscall without underscore, thus this change
does not introduce new ambiquities.
I left "_exit" untouched for now, but the same points stand for it too:
some architectures use "exit" and no one complains. So why many
arches are using "_exit"?
* linux/*/syscallent.h: Remove underscores from displayed
syscall names for _newselect, _llseek, _sysctl.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* strace.c (newoutf): Set tcp->outf in non-ff mode too.
(alloctcb): This define is removed.
(alloc_tcb): Renamed to alloctcb. Does not set tcp->outf anymore.
Lost 'command_options_parsed' flag parameter.
(startup_attach): Do not say "interrupt to quit" in attach message -
^C does not work in all cases, we mislead users.
Call newoutf(tcp) after successful attach.
(startup_child): Call newoutf(tcp) after successful attach.
(trace): Call newoutf(tcp) when we picked up already attached child.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
The change is trivial. Diff is large because it is confused
by function definitions being moved around.
* defs.h: Remove declarations of alloc_tcb and droptcb.
* strace.c: Make alloc_tcb and droptcb static.
Shuffle functions around to make compiler happy.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
The files not mentioned in changelog below had only
copyright notices fixes and indentation fixes.
* defs.h: Include <stdint.h> and <inttypes.h>.
* file.c: Do not include <inttypes.h>.
Move struct kernel_dirent declaration below top include block.
* block.c: Do not include <stdint.h> and <inttypes.h>.
* quota.c: Likewise.
* desc.c: Likewise.
* signal.c: Likewise.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syscall.c (subcall_style, decode_subcall): Remove.
[SYS_socket_subcall] (decode_socket_subcall): New function, based on
decode_subcall in deref_style.
[SYS_ipc_subcall] (decode_ipc_subcall): New function, based on
decode_subcall in shift_style.
(trace_syscall_entering): Use decode_socket_subcall and
decode_ipc_subcall instead of decode_subcall.
* configure.ac: Define SIZEOF_LONG.
* signal.c (sys_rt_sigaction) [SUPPORTED_PERSONALITIES > 1]: Help
compiler to optimize out unreachable code that is not expected to work
on platforms where sizeof(long) <= 4.
Use the same ifdef logic around the call sites of decode_subcall()
to protect the definition of the func itself. This fixes warnings
for targets like hppa which don't use this func.
* syscall.c (decode_subcall): Wrap in SYS_socket_subcall and
SYS_ipc_subcall define checks.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
pathtrace_select() is only called for -P FILE options,
and FILE is never a NULL pointer.
text data bss dec hex filename
239453 672 19012 259137 3f441 strace.before
239329 672 19012 259013 3f3c5 strace
* pathtrace.c (pathtrace_select): Remove "if (path == NULL)...".
(pathtrace_select): Remove code which only executes if path == NULL.
The code was also buggy, it can free non-malloced pointer.
(getfdpath): Simplify snprintf to sprintf.
(pathmatch): Use strcmp() == 0 idiom for string equality test.
(pathtrace_match): Likewise.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
"A traced process ignores SIGSTOP" - fixed, expected to be in linux-3.4.x.
"A traced process which tries to block SIGTRAP will be sent a SIGSTOP
in an attempt to force continuation of tracing." - not needed
and no longer done.
"On Linux, exciting as it would be, tracing the init process is forbidden"
- not true anymore.
"When a traced process receives a SIGTRAP signal not
associated with tracing, strace will not report that signal correctly."
- not true anymore.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* strace.c (init): Set SIGCHLD to SIG_DFL earlier.
(startup_child): Do not bother restoring SIGCHLD handler.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
The code "os_release[0] >= '3'" is not good for any
finer-grained checks such as "kernel >= 3.2.1".
Let's proactively fix it.
* strace.c: Change os_release from string to integer.
(get_os_release): Parse uname.release to KERNEL_VERSION
representation.
(init): Convert kernel version check to KERNEL_VERSION.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* strace.c: Define new detach_on_execve, skip_startup_execve bool variables.
(init): Set detach_on_execve on -b, set skip_startup_execve if
"strace PROG" form is used.
(trace): Detach from process if -b and we see PTRACE_EVENT_EXEC event.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>