History log of /freebsd-10.1-release/usr.bin/truss/syscall.h
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 266719 26-May-2014 smh

MFC r264881

Add Linux socket call decoding to truss

Sponsored by: Multiplay


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 255708 19-Sep-2013 jhb

Extend the support for exempting processes from being killed when swap is
exhausted.
- Add a new protect(1) command that can be used to set or revoke protection
from arbitrary processes. Similar to ktrace it can apply a change to all
existing descendants of a process as well as future descendants.
- Add a new procctl(2) system call that provides a generic interface for
control operations on processes (as opposed to the debugger-specific
operations provided by ptrace(2)). procctl(2) uses a combination of
idtype_t and an id to identify the set of processes on which to operate
similar to wait6().
- Add a PROC_SPROTECT control operation to manage the protection status
of a set of processes. MADV_PROTECT still works for backwards
compatability.
- Add a p_flag2 to struct proc (and a corresponding ki_flag2 to kinfo_proc)
the first bit of which is used to track if P_PROTECT should be inherited
by new child processes.

Reviewed by: kib, jilles (earlier version)
Approved by: re (delphij)
MFC after: 1 month


# 255493 12-Sep-2013 jhb

- Decode the idtype argument passed to wait6() in kdump and truss.
- Don't treat an options argument of 0 to wait4() as an error in
kdump.
- Decode the wait options passed to wait4() and wait6() in truss
and decode the returned rusage and exit status.

Approved by: re (kib)
MFC after: 1 week


# 253850 01-Aug-2013 markj

Properly print arguments to vfork(2) and rfork(2).

PR: 180976
Submitted by: Yuri <yuri@tsoft.com> (original patch)
MFC after: 1 week


# 240005 02-Sep-2012 zont

- Style(9) cleanup.

Approved by: kib (mentor)


# 192025 12-May-2009 dds

Add -c option to summarize number of calls, errors, and system time.

Reviewed by: alfred


# 181061 31-Jul-2008 des

Try to make this code slightly less painful to read.


# 168569 10-Apr-2007 delphij

Make use of ptrace(2) instead of procfs in truss(1), eliminating
yet another need of an available /proc/ mount.

Tested with: make universe
Submitted by: howardsu
Reviewed by: alfred


# 158630 15-May-2006 pav

- Add decoding of kse_release, kevent, sigprocmask, unmount, socket, getrusage,
rename, __getcwd, shutdown, getrlimit, setrlimit, _umtx_lock, _umtx_unlock,
pathconf, truncate, ftruncate, kill

- Decode more arguments of open, mprot, *stat, and fcntl.

- Convert all constant-macro and bitfield decoding to lookup tables; much
cleaner than previous code.

- Print the timestamp of process exit and signal reception when -d or -D are in
use

- Try six times with 1/2 second delay to debug the child

PR: bin/52190 (updated)
Submitted by: Dan Nelson <dnelson@allantgroup.com>
Approved by: alfred


# 153963 02-Jan-2006 brian

Add a -s flag for the same functionality as strace. Introduce a Name
type which is a String type that has no -s limitations applied to it.
Change most Strings in the code to Names and add a few extra syscalls,
namely munmap, read, rename and symlink. This was enough to facilitate
following file descriptor allocations in the code more easily and
getting a hint at what's being read/written from/to files. More
syscalls should really be added.

While here, fix an off-by-one bug in the buffer truncation code and
add a fflush so that truss's output reflects the syscall that the
program is stuck in.

Sponsored by: Sophos/Activestate
MFC after: 2 weeks


# 132308 17-Jul-2004 alfred

Support readlink(2) better. Readlink does not nul terminate the
result buffer, so we need to format it ourselves. The problem is
that the length is stored as the return value from readlink, so we
need to pass the return value from our syscall into print_arg.

Motivated by: truss garbage on my screen from reading /etc/malloc.conf.


# 131893 10-Jul-2004 alfred

Decode the "wence" arg to lseek and linux_lseek.


# 127332 23-Mar-2004 dwmalone

Add support for decoding Timespec, Timeval, Itimerval, Pollfd,
Fd_set and Sigaction structures. Use these for printing the arguments
to sigaction(), nanosleep(), select(), poll(), gettimeofday(),
clock_gettime(), recvfrom(), getitimer() and setitimer().

This is based on Dan's patch from the PR but I've hacked it for
style and some other issues. While Dan has checked this patch, any
goofs are probably my fault.

(The PR also contains support for the dual return values of pipe().
These will follow once I've ported that support to platforms other
than i386.)

PR: 52190
Submitted by: Dan Nelson <dnelson@allantgroup.com>


# 127328 23-Mar-2004 alfred

decode fcntl and mmap arguments.


# 122348 09-Nov-2003 marcel

Port truss(1) to 64-bit architectures:
o Syscall return values do not fit in int on 64-bit architectures.
Change the type of retval in <arch>_syscall_exit() to long and
change the prototype of said function to return a long as well.
o Change the prototype of print_syscall_ret() to take a long for
the return address and change the format string accordingly.
o Replace the code sequence
tmp = malloc(X);
sprintf(tmp, format, ...);
with X by definition too small on 64-bit platforms by
asprintf(&tmp, format, ...);

With these changes the output makes sense again, although it does
mess up the tabulation on ia64. Go widescreen...

Not tested on: alpha, sparc64.


# 101289 04-Aug-2002 mdodd

Add options to print the argument and environment string parameters to
execve().

This could be done in a more general manner but it still wouldn't
be very pretty.

MFC after: 3 weeks


# 101282 03-Aug-2002 mdodd

Parameterize globals.

PR: bin/25587 (in part)
MFC after: 3 weeks


# 87703 11-Dec-2001 markm

Partial WARNS=1 fizes with NO_WERROR set to prevent world breakage.
Use __FBSDID().


# 85292 21-Oct-2001 des

Teach truss(1) to display sockaddrs. It currently knows about AF_INET,
AF_INET6 and AF_UNIX sockaddrs, and will recognize accept(), bind(),
connect(), getpeername() and getsockname() as syscalls taking sockaddr
arguments. Some enterprising soul might want to add (and test) support
for the send() / recv() family of syscalls as well.

MFC after: 1 week


# 58224 18-Mar-2000 sef

Change the output of truss to more closely resemble SysV's. (Yes, it
really is much nicer looking.)

Submitted by: "Matthew N. Dodd" <winter@jurai.net>


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49609 10-Aug-1999 des

Teach truss to print symbolic signal names (e.g. SIGHUP instead of 0x01).


# 31899 20-Dec-1997 sef

Add some copyright and license terms, at Jordan's request. Note that
syscall.h just refers to another file for the copyright notice.


# 31571 06-Dec-1997 sef

First cut at printing out ioctl names intelligently. Note that this doesn't
handle linux ioctls (yet?). This uses the mkioctl script from kdump,
bless its little heart.

Reviewed by: Mike Smith


# 31567 06-Dec-1997 sef

Truss program. Requires procfs.