367457 |
07-Nov-2020 |
dim |
MFC r344855 (by jhb):
Drop "All rights reserved" from my copyright statements.
Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D19485 |
361020 |
13-May-2020 |
jhb |
MFC 359047,359054: Deprecate procfs-based process debugging.
359047: Mark procfs-based process debugging as deprecated for FreeBSD 13.
Attempting to use ioctls on /proc/<pid>/mem to control a process will trigger warnings on the console. The <sys/pioctl.h> include file will also now emit a compile-time warning when used from userland.
359054: Fix the workaround to ignore the #warning for GCC.
clang and gcc use different warning flags for #warning preprocessor directives.
For both 12 and 11, adjust the GCC warning flags to only be added in 4.7 and later since 4.2.1 does not support -Wno-cpp. For 11, add the needed warning suppression to procctl's build. procctl was removed in 12.0. |
351891 |
05-Sep-2019 |
bdrewery |
MFC r339635,r350301,r350327,r351151:
r339635: Fix regex for extracting SHM_* values for libsysdecode r350301: libsysdecode: add explicit dependencies on recently changed headers r350327: libsysdecode: use the proper include directory r351151: Rework r339635 to fix .depend.tables.h handling. |
346827 |
28-Apr-2019 |
dchagin |
MFC r331356 (by emaste@):
Share Linux errno table with libsysdecode. |
346823 |
28-Apr-2019 |
dchagin |
MFC r331056: Share a single bsd-linux errno table across MD consumers
Three copies of the linuxulator linux_sysvec.c contained identical BSD to Linux errno translation tables, and future work to support other architectures will also use the same table. Move the table to a common file to be used by all. Make it 'const int' to place it in .rodata.
(Some existing Linux architectures use MD errno values, but x86 and Arm share the generic set.)
This change should introduce no functional change; a followup will add missing errno values.
MFC r331057: linux_errno.c: add newer errno values
Also introduce a static assert to ensure the list is kept up to date.
MFC r331060: Chase r331057 in libsysdecode erno table |
340056 |
02-Nov-2018 |
bz |
MFC r330795:
The vmresult table was missing most of the values apart from two due to extra "_" in the names we grep for. Add the "_" to the pattern.
Reviewed by: jhb Sponsored by: iXsystems, Inc. |
332250 |
07-Apr-2018 |
tuexen |
MFC r328033:
Bump date, which I missed in r328014. Thanks to jhb@ for reporting. |
332248 |
07-Apr-2018 |
tuexen |
MFC r328014:
Add support for decoding the nxt_flags, rcv_flags, and snd_flags of SCTP level cmsgs. |
332247 |
07-Apr-2018 |
tuexen |
MFC r327995:
Add support for decoding the type of a cmsg. |
332246 |
07-Apr-2018 |
tuexen |
MFC r327994:
Simplify table generation. |
332244 |
07-Apr-2018 |
tuexen |
MFC r327966:
Add a function is decode the sinfo_flags of struct sctp_sndrcvinfo. |
332243 |
07-Apr-2018 |
tuexen |
MFC r327962:
Add support for the supported PR-SCTP policies. |
331187 |
19-Mar-2018 |
eadler |
MFC r326183:
Add stdio.h to the synopsis for sysdecode functions that take a FILE *. |
328454 |
26-Jan-2018 |
jhb |
MFC 326184: 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().
Note that this version of the change for 11.x does not include freebsd11 kevent structures or _WANT_FREEBSD11_KEVENT. It also does not include the change to decode the compat11.kevent system call in truss. |
326810 |
12-Dec-2017 |
fsu |
MFC r326282, r326317: Remap ENOATTR to ENODATA in the linuxulator. In the linux ENOADATA is frequently #defined as ENOATTR. The change is required for an xattrs support implementation.
Sync bsd_to_linux_errno[] table with i386 and amd64 tables in the sys directory.
Discussed with: netchild Requested by: jhb Approved by: pfg (mentor) |
326044 |
21-Nov-2017 |
jhb |
MFC 319493,319509,319520,319595,319677,319679-319681,319688,319689, 319761-319768,320010,322899,322959,323020,323021,323151:
Sync libsysdecode, kdump, and truss with head (aside from changes such as ino64 that are not applicable to 11).
319493: Decode the arguments passed to __cap_rights_get() and cap_rights_limit().
319509: Decode the argument passed to cap_getmode().
The returned integer value is output.
319520: Decode the 'who' argument passed to getrusage().
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().
319595: Decode arguments to dup, dup2, getdirentries, pread, and pwrite.
- dup and dup2 print fd arguments in decimal. - pread and pwrite are similar to read and write with the addition of the file offset. - getdirentries displays the output entries as a string for now and also prints the value returned in *basep. Eventually the buffer for getdirentries should perhaps be decoded as an array of dirent structures.
319677: Decode arguments to ACL related system calls.
This only decodes the raw arguments but not the contents of the struct acl objects.
319679: Decode arguments passed to extended attribute related system calls.
The cmd argument passed to extattrctl() is not decoded as a string constant but is just printed in hex. The value is filesystem-specific but in practice is only used with UFS1 filesystems.
319680: Decode arguments to minherit().
319681: Decode arguments to mlock(), mlockall(), and munlock().
319688: Decode flags passed to mount(), nmount(), and unmount().
319689: Decode arguments passed to msync().
319761: Fix decoding of setpriority() arguments.
The PRIO_* 'which' value is stored in the first argument to setpriority(2), not the last. While here, decode the arguments to getpriority(2).
319762: Decode arguments to getpriority() and setpriority().
319763: Decode the arguments to ptrace().
This does not decode structures returned by ptrace().
319764: Decode the arguments to quotactl().
319765: Improve decoding of RB_AUTOBOOT in the 'howto' argument to reboot().
The reboot() system call accepts a mode (RB_AUTOBOOT, RB_HALT, RB_POWEROFF, or RB_REROOT) as well as zero or more optional flags in 'howto'. However, RB_AUTOBOOT was only displayed if 'howto' was exactly 0. Combinations like 'RB_AUTOBOOT | RB_DUMP' were decoded as 'RB_DUMP'. Instead, imply that RB_AUTOBOOT was specified if none of the other "mode" flags were specified.
319766: Decode the 'howto' argument to reboot().
319767: Decode arguments to rtprio_thread() (same as rtprio()).
319768: Decode arguments to rtprio() and rtprio_thread().
320010: Decode arguments to sched_* family of system calls.
This includes decoding both scheduler policy constants and the sched_param structure for sched_get_priority_max(), sched_get_priority_min(), sched_getparam(), sched_getscheduler(), sched_rr_get_interval(), sched_setparam(), and sched_setscheduler().
322899: Decode arguments passed to thr_set_name().
322959: Decode extra signal information for caught signals.
Decode fields from the siginfo_t stored in the PT_LWPINFO structure when a signal is caught by a traced process. This includes the signal code (si_code) as well as additional members such as si_addr, si_pid, etc.
323020: Trim stale prototype for ioctlname().
323021: Decode signal information returned by system calls.
Specifically, decode the siginfo structure returned by sigtimedwait(), sigwaitinfo(), and wait6(). While here, also decode the signal number returned in the second argument to sigwait().
323151: Decode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode.
Move tables that were previously in truss over to libsysdecode. truss output is unchanged, but kdump has been updated to decode these fields. In addition, sysdecode_sysarch_number() should support all platforms whereas the old table in truss only supported x86.
PR: 214885, 215448 |
325902 |
16-Nov-2017 |
jhb |
MFC 319517: Add a cross-reference to sysdecode_socket_protocol(3). |
324398 |
07-Oct-2017 |
emaste |
MFC r323675: libsysdecode: report invalid cap_rights_t
Previously we'd have an assertion failure in cap_rights_is_set if sysdecode_cap_rights is called with an invalid cap_rights_t, so test for validity first.
PR: 222258 Sponsored by: The FreeBSD Foundation |
321687 |
29-Jul-2017 |
kp |
MFC r321370
Handle WITH/WITHOUT_PF in libsysdecode
Only filter out the PF ioctls if we're building without pf support. Until now those were always filtered out, so truss did not show symbolic names for pf ioctls.
Differential Revision: https://reviews.freebsd.org/D11629 |
320299 |
23-Jun-2017 |
bdrewery |
MFC r320206,r320207:
r320206: Follow-up r308602: Don't add missing headers to .depend.tables.h. r320207: Tweak r320206: Still create the TABLE but not the .depend entry for missing headers.
Approved by: re (gjb) |
319417 |
01-Jun-2017 |
tuexen |
MFC r317730: Add support for listen() call.
MFC r317731: Add Socklent for handling args of type socklen_t.
MFC r317732: Decode the third argument of socket().
MFC r317736: Add support for [gs]etsockopt().
MFC r317737: Decode the fourth argument of sendto and recvfrom call.
MFC r317739: Add support for sendmsg() and recvmsg().
MFC r317747: Add support for socket option names related to the IPPROTO_SCTP level.
MFC r317748: Add support for socket option names related to the IPPROTO_IPV6 level.
MFC r317750: Add support for sctp_generic_sendmsg() and sctp_generic_recvmsg().
MFC r317789: Add support for socket option names related to the level IPPROTO_UDPLITE.
MFC r318879: Improve the decoding of the third argument of the socket() call.
Decoding of the third argument depends on the first one. For doing this, add a corresponding function to libsysdecode.
Thanks to jhb@ for suggesting this. |
318770 |
24-May-2017 |
jhb |
MFC 315310: Spell "const" properly.
PR: 217797 |
318764 |
24-May-2017 |
jhb |
MFC 315283: Fix sysdecode_cap_rights which currently prints bogus capability rights.
PR: 217787 |
315855 |
23-Mar-2017 |
smh |
MFC r315423:
Fix libsysdecode vmprot flag decoding
Sponsored by: Multiplay |
313567 |
10-Feb-2017 |
jhb |
MFC 311568,311584,312387: Set MORETOCOME for AIO write requests on a socket.
311568: Set MORETOCOME for AIO write requests on a socket.
Add a MSG_MOREOTOCOME message flag. When this flag is set, sosend* set PRUS_MOREOTOCOME when invoking the protocol send method. The aio worker tasks for sending on a socket set this flag when there are additional write jobs waiting on the socket buffer.
311584: Unbreak lib/libsysdecode after r311568 by decoding MSG_MORETOCOME flag in msgflags
(Actually, this change excludes MSG_MORETOCOME from being decoded)
312387: Fix regression from r311568: collision of MSG_NOSIGNAL with MSG_MORETOCOME lead to delayed send of data sent with sendto(MSG_NOSIGNAL).
Sponsored by: Chelsio Communications |
313538 |
10-Feb-2017 |
ngie |
MFC r312452-r312512:
r312452-r312512:
- Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output
- Use .CURDIR:H instead of .CURDIR to simplify pathing in output, etc |
311999 |
12-Jan-2017 |
jhb |
MFC 307538,307948,308602,308603,311151: Move kdump's mksubr into libsysdecode.
307538: Move mksubr from kdump into libsysdecode.
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 mask. - 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 synopsis.
307948: Use binary and (&) instead of logical to extract the mask of a capability.
308602: Generate and use a proper .depend file for tables.h.
308603: Move libsysdecode-specific hack out of buildworld.
This should fix the lib32 build since it was not removing the generated ioctl.c. This file is generated by a find(1) call, so cannot use normal dependency tracking methods.
311151: Update libsysdecode for getfsstat() 'flags' argument changing to 'mode'.
As a followup to r310638, update libsysdecode (and kdump) to decode the 'mode' argument to getfsstat(). sysdecode_getfsstat_flags() has been renamed to sysdecode_getfsstat_mode() and now treats the argument as an enumerated value rather than a mask of flags. |
311198 |
03-Jan-2017 |
bdrewery |
Revert MFC of r308603.
This depends on unmerged r307538 still. |
311197 |
03-Jan-2017 |
bdrewery |
MFC r308603:
Move libsysdecode-specific hack out of buildworld. |
304453 |
19-Aug-2016 |
kib |
MFC r304016: Move defines common between rtld and libsysdecode into the header. |
304450 |
19-Aug-2016 |
kib |
MFC r303991: Decode 32bit utrace records on the 64bit host. |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
298107 |
16-Apr-2016 |
gjb |
Merge the projects/release-pkg branch to head.
This allows packaging the base system with pkg(8), including but not limited to providing the ability to provide upstream binary update possibilities for non-tier-1 architectures.
This merge is a requirement of the 11.0-RELEASE, and as such, thank you to everyone that has tested the project branch.
Documentation in build(7) etc. is still somewhat sparse, but updates to those parts will follow.
Sponsored by: The FreeBSD Foundation
|
297247 |
24-Mar-2016 |
ed |
Replace the CloudABI system call table by a machine generated version.
The type definitions and constants that were used by COMPAT_CLOUDABI64 are a literal copy of some headers stored inside of CloudABI's C library, cloudlibc. What is annoying is that we can't make use of cloudlibc's system call list, as the format is completely different and doesn't provide enough information. It had to be synced in manually.
We recently decided to solve this (and some other problems) by moving the ABI definitions into a separate file:
https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt
This file is processed by a pile of Python scripts to generate the header files like before, documentation (markdown), but in our case more importantly: a FreeBSD system call table.
This change discards the old files in sys/contrib/cloudabi and replaces them by the latest copies, which requires some minor changes here and there. Because cloudabi.txt also enforces consistent names of the system call arguments, we have to patch up a small number of system call implementations to use the new argument names.
The new header files can also be included directly in FreeBSD kernel space without needing any includes/defines, so we can now remove cloudabi_syscalldefs.h and cloudabi64_syscalldefs.h. Patch up the sources to include the definitions directly from sys/contrib/cloudabi instead.
|
296211 |
29-Feb-2016 |
trasz |
errno(3) -> errno(2)
MFC after: 1 month Sponsored by: The FreeBSD Foundation
|
295989 |
24-Feb-2016 |
bdrewery |
DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports skipping 'make depend'.
Sponsored by: EMC / Isilon Storage Division
|
295931 |
23-Feb-2016 |
jhb |
Add handling for non-native error values to libsysdecode.
Add two new functions, sysdecode_abi_to_freebsd_errno() and sysdecode_freebsd_to_abi_errno(), which convert errno values between the native FreeBSD ABI and other supported ABIs. Note that the mappings are not necessarily perfect meaning in some cases multiple errors in one ABI might map to a single error in another ABI. In that case, the reverse mapping will return one of the errors that maps, but which error is non-deterministic.
Change truss to always report the raw error value to the user but use libsysdecode to map it to a native errno value that can be used with strerror() to generate a description. Previously truss reported the "converted" error value. Now the user will always see the exact error value that the application sees.
Change kdump to report the truly raw error value to the user. Previously kdump would report the absolute value of the raw error value (so for Linux binaries it didn't output the FreeBSD error value, but the positive value of the Linux error). Now it reports the real (i.e. negative) error value for Linux binaries. Also, use libsysdecode to convert the native FreeBSD error reported in the ktrace record to the raw error used by the ABI. This means that the Linux ABI can now be handled directly in ktrsysret() and removes the need for linux_ktrsysret().
Reviewed by: bdrewery, kib Helpful notes: wblock (manpage) Differential Revision: https://reviews.freebsd.org/D5314
|
295056 |
30-Jan-2016 |
jhb |
Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions.
Suggested by: jmallett Reviewed by: bdrewery, jmallett Differential Revision: https://reviews.freebsd.org/D5123
|
294849 |
26-Jan-2016 |
jhb |
Add support to libsysdecode for decoding system call names.
A new sysdecode_syscallname() function accepts a system call code and returns a string of the corresponding name (or NULL if the code is unknown). To support different process ABIs, the new function accepts a value from a new sysdecode_abi enum as its first argument to select the ABI in use. Current ABIs supported include FREEBSD (native binaries), FREEBSD32, LINUX, LINUX32, and CLOUDABI64. Note that not all ABIs are supported by all platforms. In general, a given ABI is only supported if a platform can execute binaries for that ABI.
To simplify the implementation, libsysdecode's build reuses the existing pre-generated files from the kernel source tree rather than duplicating new copies of said files during the build.
kdump(1) and truss(1) now use these functions to map system call identifiers to names. For kdump(1), a new 'syscallname()' function consolidates duplicated code from ktrsyscall() and ktrsyscallret(). The Linux ABI no longer requires custom handling for ktrsyscall() and linux_ktrsyscall() has been removed as a result.
Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4823
|
293287 |
07-Jan-2016 |
bdrewery |
Add in DIRDEPS_BUILD support.
Sponsored by: EMC / Isilon Storage Division
|
292622 |
22-Dec-2015 |
jhb |
Move the mkioctls script to libsysdecode and use it to generate a sysdecode_ioctlname() function. This function matches the behavior of the truss variant in that it returns a pointer to a string description for known ioctls. The caller is responsible for displaying unknown ioctl requests. For kdump this meant moving the logic to handle unknown ioctl requests out of the generated function and into an ioctlname() function in kdump.c instead.
Differential Revision: https://reviews.freebsd.org/D4610
|
292236 |
15-Dec-2015 |
jhb |
Start on a new library (libsysdecode) that provides routines for decoding system call information such as system call arguments. Initially this will consist of pulling duplicated code out of truss and kdump though it may prove useful for other utilities in the future.
This commit moves the shared utrace(2) record parser out of kdump into the library and updates kdump and truss to use it. One difference from the previous version is that the library version treats unknown events that start with the "RTLD" signature as unknown events. This simplifies the interface and allows the consumer to decide how to handle all non-recognized events. Instead, this function only generates a string description for known malloc() and RTLD records.
Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4537
|