1. 22 Jun, 2022 5 commits
  2. 11 May, 2022 1 commit
  3. 03 Mar, 2022 1 commit
  4. 15 Nov, 2021 1 commit
  5. 21 Sep, 2021 1 commit
  6. 16 Jun, 2021 1 commit
  7. 09 Dec, 2020 1 commit
    • Kyle Evans's avatar
      kdump/truss: decode new _umtx_op flags · c2679dd7
      Kyle Evans authored
      In both cases, print the flag bits first followed by the command.
      Output now looks something like this:
      _umtx_op(0x7fffffffda50,UMTX_OP_WAKE,0x1,0x0,0x0) = 0 (0x0)
      _umtx_op(0x9fffdd08,UMTX_OP__32BIT|UMTX_OP_WAKE,0x1,0x0,0x0) = 0 (0x0)
      Reviewed by:	kib
      Differential Revision:	https://reviews.freebsd.org/D27325
  8. 19 Feb, 2020 2 commits
    • Kyle Evans's avatar
      kdump: decode shm_open2 · c1b0c847
      Kyle Evans authored
      This is the kdump counterpart of the truss support added in r358116, and
      also a part of D23733. shm_open2 is the successor to shm_open.
      Reviewed by:	kaktus
    • Kyle Evans's avatar
      kdump: decode SHM_ANON as first arg to legacy shm_open(2) · 550bec4f
      Kyle Evans authored
      The first argument to shm_open(2) as well as shm_open2(2) may be a path or
      SHM_ANON. Decode SHM_ANON, at least- paths will show up as namei results in
      kdump output, which may be sufficient; in those cases, we'll have printed an
      Future commits will add support for shm_open2() to libsysdecode/truss/kdump.
      Reported by:	kaktus
      MFC after:	3 days
  9. 25 Sep, 2019 1 commit
  10. 18 Feb, 2019 1 commit
  11. 18 Aug, 2018 1 commit
  12. 07 Aug, 2018 1 commit
    • John Baldwin's avatar
      Remove spurious ABI tags from kdump output. · 7cf2ca3b
      John Baldwin authored
      The abidump routine output an ABI tag when -A was specified for records
      that were not displayed due to type or pid filtering.  To fix, split
      the code to lookup the ABI from the code to display the ABI, move the
      code to display the ABI into dumpheader(), and move dumpheader() later
      in the main loop as a simplification.  Previously dumpheader() was
      called under a condition that repeated conditions made later in the
      main loop.
      Reviewed by:	kib
      MFC after:	1 month
      Sponsored by:	DARPA / AFRL
      Differential Revision:	https://reviews.freebsd.org/D16608
  13. 19 Jun, 2018 1 commit
  14. 24 Apr, 2018 1 commit
    • Ed Maste's avatar
      kdump: simplify/remove per-arch #ifdefs · fc7d33b4
      Ed Maste authored
      It is acceptable for syscallabi to map SV_ABI to SYSDECODE_ABI on all
      architectures; libsysdecode will return not-found sentinel values if
      it does not have a syscall name or errno mapping for a given
      Also, use __LP64__ for the SV_ILP32 -> SYSDECODE_ABI_LINUX32 mapping,
      for any future 32- on 64-bit linuxulator implementation.
      Reviewed by:	jhb
      Sponsored by:	Turing Robotic Industries Inc.
  15. 03 Jan, 2018 1 commit
  16. 25 Nov, 2017 1 commit
    • John Baldwin's avatar
      Decode kevent structures logged via ktrace(2) in kdump. · ffb66079
      John Baldwin authored
      - Add a new KTR_STRUCT_ARRAY ktrace record type which dumps an array of
        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
        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
  17. 20 Nov, 2017 1 commit
    • Pedro F. Giffuni's avatar
      General further adoption of SPDX licensing ID tags. · 8a16b7a1
      Pedro F. Giffuni authored
      Mainly focus on files that use BSD 3-Clause license.
      The Software Package Data Exchange (SPDX) group provides a specification
      to make it easier for automated tools to detect and summarize well known
      opensource licenses. We are gradually adopting the specification, noting
      that the tags are considered only advisory and do not, in any way,
      superceed or replace the license texts.
      Special thanks to Wind River for providing access to "The Duke of
      Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
      starting point.
  18. 21 Sep, 2017 1 commit
  19. 04 Sep, 2017 1 commit
  20. 10 Jun, 2017 2 commits
  21. 03 Jun, 2017 1 commit
    • John Baldwin's avatar
      Decode the 'who' argument passed to getrusage(). · ee8aa41d
      John Baldwin authored
      Add a new sysdecode_getrusage_who() which decodes the RUSAGE_* constant
      passed as the first argument to getrusage().  Use this function in both
      kdump and truss to decode the first argument to getrusage().
      PR:		215448
      Submitted by:	Anton Yuzhaninov <citrin+pr@citrin.ru>
      MFC after:	1 month
  22. 23 May, 2017 1 commit
    • Konstantin Belousov's avatar
      Commit the 64-bit inode project. · 69921123
      Konstantin Belousov authored
      Extend the ino_t, dev_t, nlink_t types to 64-bit ints.  Modify
      struct dirent layout to add d_off, increase the size of d_fileno
      to 64-bits, increase the size of d_namlen to 16-bits, and change
      the required alignment.  Increase struct statfs f_mntfromname[] and
      f_mntonname[] array length MNAMELEN to 1024.
      ABI breakage is mitigated by providing compatibility using versioned
      symbols, ingenious use of the existing padding in structures, and
      by employing other tricks.  Unfortunately, not everything can be
      fixed, especially outside the base system.  For instance, third-party
      APIs which pass struct stat around are broken in backward and
      forward incompatible ways.
      Kinfo sysctl MIBs ABI is changed in backward-compatible way, but
      there is no general mechanism to handle other sysctl MIBS which
      return structures where the layout has changed. It was considered
      that the breakage is either in the management interfaces, where we
      usually allow ABI slip, or is not important.
      Struct xvnode changed layout, no compat shims are provided.
      For struct xtty, dev_t tty device member was reduced to uint32_t.
      It was decided that keeping ABI compat in this case is more useful
      than reporting 64-bit dev_t, for the sake of pstat.
      Update note: strictly follow the instructions in UPDATING.  Build
      and install the new kernel with COMPAT_FREEBSD11 option enabled,
      then reboot, and only then install new world.
      Credits: The 64-bit inode project, also known as ino64, started life
      many years ago as a project by Gleb Kurtsou (gleb).  Kirk McKusick
      (mckusick) then picked up and updated the patch, and acted as a
      flag-waver.  Feedback, suggestions, and discussions were carried
      by Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles),
      and Rick Macklem (rmacklem).  Kris Moore (kris) performed an initial
      ports investigation followed by an exp-run by Antoine Brodin (antoine).
      Essential and all-embracing testing was done by Peter Holm (pho).
      The heavy lifting of coordinating all these efforts and bringing the
      project to completion were done by Konstantin Belousov (kib).
      Sponsored by:	The FreeBSD Foundation (emaste, kib)
      Differential revision:	https://reviews.freebsd.org/D10439
  23. 25 Apr, 2017 1 commit
  24. 15 Mar, 2017 1 commit
  25. 28 Feb, 2017 1 commit
    • Warner Losh's avatar
      Renumber copyright clause 4 · fbbd9655
      Warner Losh authored
      Renumber cluase 4 to 3, per what everybody else did when BSD granted
      them permission to remove clause 3. My insistance on keeping the same
      numbering for legal reasons is too pedantic, so give up on that point.
      Submitted by:	Jan Schaumann <jschauma@stevens.edu>
      Pull Request:	https://github.com/freebsd/freebsd/pull/96
  26. 03 Jan, 2017 1 commit
  27. 17 Oct, 2016 1 commit
    • John Baldwin's avatar
      Move mksubr from kdump into libsysdecode. · 9289f547
      John Baldwin authored
      Restructure this script so that it generates a header of tables instead
      of a source file.  The tables are included in a flags.c source file which
      provides functions to decode various system call arguments.
      For functions that decode an enumeration, the function returns a pointer
      to a string for known values and NULL for unknown values.
      For functions that do more complex decoding (typically of a bitmask), the
      function accepts a pointer to a FILE object (open_memstream() can be used
      as a string builder) to which decoded values are written.  If the
      function operates on a bitmask, the function returns true if any bits
      were decoded or false if the entire value was valid.  Additionally, the
      third argument accepts a pointer to a value to which any undecoded bits
      are stored.  This pointer can be NULL if the caller doesn't care about
      remaining bits.
      Convert kdump over to using decoder functions from libsysdecode instead of
      mksubr.  truss also uses decoders from libsysdecode instead of private
      lookup tables, though lookup tables for objects not decoded by kdump remain
      in truss for now.  Eventually most of these tables should move into
      libsysdecode as the automated table generation approach from mksubr is
      less stale than the static tables in truss.
      Some changes have been made to truss and kdump output:
      - The flags passed to open() are now properly decoded in that one of
        O_RDONLY, O_RDWR, O_WRONLY, or O_EXEC is always included in a decoded
      - Optional arguments to open(), openat(), and fcntl() are only printed
        in kdump if they exist (e.g. the mode is only printed for open() if
        O_CREAT is set in the flags).
      - Print argument to F_GETLK/SETLK/SETLKW in kdump as a pointer, not int.
      - Include all procctl() commands.
      - Correctly decode pipe2() flags in truss by not assuming full
        open()-like flags with O_RDONLY, etc.
      - Decode file flags passed to *chflags() as file flags (UF_* and SF_*)
        rather than as a file mode.
      - Fix decoding of quotactl() commands by splitting out the two command
        components instead of assuming the raw command value matches the
        primary command component.
      In addition, truss and kdump now build without triggering any warnings.
      All of the sysdecode manpages now include the required headers in the
      Reviewed by:	kib (several older versions), wblock (manpages)
      MFC after:	2 months
      Differential Revision:	https://reviews.freebsd.org/D7847
  28. 07 Oct, 2016 1 commit
  29. 01 Oct, 2016 5 commits
    • John Baldwin's avatar
      Don't declare the 'temp' timeval as static. · dda41f20
      John Baldwin authored
    • John Baldwin's avatar
      Use timercmp() and timersub() in kdump. · 54b10c9e
      John Baldwin authored
      Previously, kdump used the kernel-only timervalsub() macro which required
      defining _KERNEL when including <sys/time.h>.  Now, kdump uses the existing
      userland API.  The timercmp() usage to check for a backwards timestamp is
      also clearer and simpler than the previous code which checked the result of
      the subtraction for a negative value.
      While here, take advantage of the 3-arg timersub() to store the subtraction
      results in a tempory timeval instead of overwriting the timestamp in the
      ktrace record and then having to restore it.
    • John Baldwin's avatar
      Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined. · 406d2926
      John Baldwin authored
      The kernel uses a few negative errno values for internal conditions
      such as requesting a system call restart.  Normally these errno values
      are not exposed to userland.  However, kdump needs access to these
      values as some of then can be present in a ktrace system call return
      record.  Previously kdump was defining _KERNEL to gain access to ehse
      values, but was then having to manually declare 'errno' (and doing it
      incorrectly).  Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL
      and uses the system-provided declaration of errno.
    • John Baldwin's avatar
      Decode arguments to truncate and ftruncate. · 8dec6942
      John Baldwin authored
      In particular, decode the off_t argument as a 64-bit argument to fix
      decoding for 32-bit processes.
    • John Baldwin's avatar
      Handle 64-bit system call arguments (off_t, id_t). · 71ed318e
      John Baldwin authored
      In particular, 64-bit system call arguments use up two register_t
      arguments for 32-bit processes.  They must also be aligned on a 64-bit
      boundary on 32-bit powerpc processes.  This fixes the decoding of
      lseek(), procctl(), and wait6() arguments for 32-bit processes (both
      native and via freebsd32).
      Note that the ktrace system call return record only returns a single
      register, so the return value of lseek is always truncated to the low
      32-bits for 32-bit processes.
  30. 12 Aug, 2016 1 commit