freebsd-nq/usr.bin/truss
John Baldwin 1175b23f77 Rework syscall structure lookups.
Avoid always using an O(n^2) loop over known syscall structures with
strcmp() on each system call.  Instead, use a per-ABI cache indexed by
the system call number. The first 1024 system calls (which should cover
all of the normal system calls in currently-supported ABIs) use a flat array
indexed by the system call number to find system call structure.  For other
system calls, a linked list of structures storing an integer to structure
mapping is stored in the ABI.  The linked list isn't very smart, but it
should only be used by buggy applications invoking unknown system calls.

This also fixes handling of unknown system calls which currently trigger
a NULL pointer dereference.

Reviewed by:	kib
MFC after:	2 weeks
2016-12-06 00:39:00 +00:00
..
aarch64-cloudabi64.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
aarch64-freebsd.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
amd64-cloudabi64.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
amd64-freebsd32.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
amd64-freebsd.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
amd64-linux32.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
amd64-linux.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
arm-freebsd.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
extern.h Move mksubr from kdump into libsysdecode. 2016-10-17 22:37:07 +00:00
i386-freebsd.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
i386-linux.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
main.c Move mksubr from kdump into libsysdecode. 2016-10-17 22:37:07 +00:00
Makefile Move mksubr from kdump into libsysdecode. 2016-10-17 22:37:07 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2016-02-16 02:14:30 +00:00
mips-freebsd.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
powerpc64-freebsd32.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
powerpc64-freebsd.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
powerpc-freebsd.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
setup.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
sparc64-freebsd.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
syscall.h Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
syscalls.c Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00
truss.1 Add support for displaying thread IDs to truss(1). 2016-02-23 19:56:29 +00:00
truss.h Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00