Currently, get_scno does *much* more than "get syscall no". It checks for post-execve SIGTRAP. It checks for changes in personality. It retrieves params on entry and registers on exit. Worse still, it is different in different architectures: for example, for AVR32 regs are fetched in get_scno(), while for e.g. I386 it is done in syscall_enter(). Another problem is that get_scno() is called on both syscall entry and syscall exit, which is stupid: we don't need to know scno on syscall exit, it is already known from last syscall entry and stored in tcp->scno! In essence, get_scno() does two completely different things on syscall entry and on exit, they are just mixed into one bottle, like shampoo and conditioner. The following patches will try to improve this situation. This change duplicates get_scno into identical get_scno_on_sysenter, get_scno_on_sysexit functions. Call them in syscall enter and syscall exit, correspondingly. * defs.h: Rename get_scno to get_scno_on_sysenter; declare it only if USE_PROCFS. * strace.c (proc_open): Call get_scno_on_sysenter instead of get_scno. * syscall.c (get_scno): Split into two (so far identical) functions get_scno_on_sysenter and get_scno_on_sysexit. (trace_syscall_entering): Call get_scno_on_sysenter instead of get_scno. (trace_syscall_exiting): Call get_scno_on_sysexit instead of get_scno. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This is strace 4.0, a system call tracer for SunOS 4.x, Linux, System V release 4, Solaris 2.x and Irix 5.x. strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file COPYRIGHT for details. Read the INSTALL file for generic instructions on how to install strace. If configure cannot guess your system configuration, you can specify it on the command line after the other options like this: ./configure --prefix=/usr i486-linux A single sunos4.1 binary should work on all the sun4, sun4c and sun4m kernel architectures. Let me know if sun4d doesn't work. Other i486-*-sysv4 systems may work with little or no tweaking. See the file NEWS for information on what has changed in recent versions. See the file PORTING if you like strace but it doesn't work on an operating system you use frequently. See the file CREDITS to see who has contributed to strace. See the file TODO if you feel like helping out. You can get the latest version of strace from its homepage at http://sourceforge.net/projects/strace/ . Please send bug reports and enhancements to the strace mailinglist at strace-devel@lists.sourceforge.net, or directly to Wichert Akkerman <wakkerma@debian.org>
Description
Languages
C
92.2%
Shell
3.4%
M4
1.4%
Makefile
0.8%
Roff
0.7%
Other
1.5%