freebsd-skq/usr.bin/truss
John Baldwin ffb6607984 Decode kevent structures logged via ktrace(2) in kdump.
- Add a new KTR_STRUCT_ARRAY ktrace record type which dumps an array of
  structures.

  The structure name in the record payload is preceded by a size_t
  containing the size of the individual structures.  Use this to
  replace the previous code that dumped the kevent arrays dumped for
  kevent().  kdump is now able to decode the kevent structures rather
  than dumping their contents via a hexdump.

  One change from before is that the 'changes' and 'events' arrays are
  not marked with separate 'read' and 'write' annotations in kdump
  output.  Instead, the first array is the 'changes' array, and the
  second array (only present if kevent doesn't fail with an error) is
  the 'events' array.  For kevent(), empty arrays are denoted by an
  entry with an array containing zero entries rather than no record.

- Move kevent decoding tables from truss to libsysdecode.

  This adds three new functions to decode members of struct kevent:
  sysdecode_kevent_filter, sysdecode_kevent_flags, and
  sysdecode_kevent_fflags.

  kdump uses these helper functions to pretty-print kevent fields.

- Move structure definitions for freebsd11 and freebsd32 kevent
  structures to <sys/event.h> so that they can be shared with userland.
  The 32-bit structures are only exposed if _WANT_KEVENT32 is defined.
  The freebsd11 structures are only exposed if _WANT_FREEBSD11_KEVENT is
  defined.  The 32-bit freebsd11 structure requires both.

- Decode freebsd11 kevent structures in truss for the compat11.kevent()
  system call.

- Log 32-bit kevent structures via ktrace for 32-bit compat kevent()
  system calls.

- While here, constify the 'void *data' argument to ktrstruct().

Reviewed by:	kib (earlier version)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D12470
2017-11-25 04:49:12 +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 spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
amd64-freebsd.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
amd64-linux32.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
amd64-linux.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
arm-freebsd.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
extern.h spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
i386-freebsd.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
i386-linux.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
main.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
Makefile Adopt SRCTOP in usr.bin 2017-03-12 18:58:44 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mips-freebsd.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +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
riscv64-freebsd.c Add RISC-V support for truss(1) 2017-01-24 09:41:44 +00:00
setup.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
sparc64-freebsd.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
syscall.h Decode kevent structures logged via ktrace(2) in kdump. 2017-11-25 04:49:12 +00:00
syscalls.c Decode kevent structures logged via ktrace(2) in kdump. 2017-11-25 04:49:12 +00:00
truss.1 Make truss(1) cross-reference dtrace(1) and bump .Dd. 2017-07-21 13:58:51 +00:00
truss.h Rework syscall structure lookups. 2016-12-06 00:39:00 +00:00