aboutsummaryrefslogtreecommitdiff
path: root/lib/libsysdecode/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-231-1/+0
| | | | | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit d0b2dbfa0ecf)
* libsysdecode: Add preliminary support for decoding Linux syscallsDmitry Chagin2022-07-061-3/+9
| | | | | | | Differential revision: https://reviews.freebsd.org/D35354 MFC after: 2 weeks (cherry picked from commit b69ae1a34c6f918118693490f18a81ecd7163f83)
* libsysdecode: For future use extract common code to a separate filesDmitry Chagin2022-07-061-1/+1
| | | | | | | | Reviewed by: jhb, emaste Differential revision: https://reviews.freebsd.org/D35353 MFC after: 2 weeks (cherry picked from commit 9dac609629d4e0ba813df6169f8bd8383fca024f)
* libsysdecode: Add regression tests for sysdecode_cap_rights(3)Mark Johnston2022-04-221-0/+3
| | | | | | | Reviewed by: jhb, emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit d0f245d21f47c55ed40b34a17d5caf08aba1952f)
* Retire procfs-based process debugging.John Baldwin2020-04-011-5/+0
| | | | | | | | | | | | | | | | | | Modern debuggers and process tracers use ptrace() rather than procfs for debugging. ptrace() has a supserset of functionality available via procfs and new debugging features are only added to ptrace(). While the two debugging services share some fields in struct proc, they each use dedicated fields and separate code. This results in extra complexity to support a feature that hasn't been enabled in the default install for several years. PR: 244939 (exp-run) Reviewed by: kib, mjg (earlier version) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D23837 Notes: svn path=/head/; revision=359530
* Fix the workaround to ignore the #warning for GCC.John Baldwin2020-03-171-3/+5
| | | | | | | | | | | clang and gcc use different warning flags for #warning preprocessor directives. Reported by: Jenkins MFC after: 1 week Notes: svn path=/head/; revision=359054
* Mark procfs-based process debugging as deprecated for FreeBSD 13.John Baldwin2020-03-171-0/+3
| | | | | | | | | | | | | | 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. Reviewed by: emaste MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D23822 Notes: svn path=/head/; revision=359047
* pkgbase: Create a FreeBSD-utilities package and make it the default oneEmmanuel Vadot2019-09-051-1/+0
| | | | | | | | | | | | | The default package use to be FreeBSD-runtime but it should only contain binaries and libs enough to boot to single user and repair the system, it is also very handy to have a package that can be tranform to a small mfsroot. So create a new package named FreeBSD-utilities and make it the default one. Also move a few binaries and lib into this package when it make sense. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21506 Notes: svn path=/head/; revision=351858
* Rework r339635 to fix .depend.tables.h handling.Bryan Drewery2019-08-161-6/+3
| | | | | | | | | | | | | | | | | Avoid touching the tables.h file unless it has changed to avoid unneeded rebuilds. Also revert r350301's explicit dependencies. Reviewed by: emaste MFC after: 2 weeks X-MFC-With: r339635 (kevans request) PR: 238828 Sponsored by: DellEMC Differential Revision: https://reviews.freebsd.org/D21295 Notes: svn path=/head/; revision=351151
* libsysdecode: use the proper include directoryEd Maste2019-07-251-3/+4
| | | | | | | | | | Reported by: cy Reviewed by: lwhsu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21068 Notes: svn path=/head/; revision=350327
* libsysdecode: add explicit dependencies on recently changed headersEd Maste2019-07-241-1/+2
| | | | | | | | | | | | | | r349369 removed IP_MIN_MEMBERSHIPS and IPV6_MIN_MEMBERSHIPS, and r349893 removed TCP_RACK_SESS_CWV. libsysdecode lacked dependencies to trigger a rebuild of tables.h. Add explicit dependencies as a workaround to address these specific cases; a holistic solution is still needed. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=350301
* Fix regex for extracting SHM_* values for libsysdecodeAlex Richardson2018-10-231-2/+3
| | | | | | | | | | | | | | | | | There was an additional + after the {6} which is apparently ignored by the FreeBSD regex implementation but was giving me an error when compiling on MacOS. While changing this also make sure that tables.h is not created if mktables fails. The current rule would create a partial tables.h which causes following incremental builds to use that broken file and fail with an unrelated compilation error or even succeed even though they shouldn't. Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D17069 Notes: svn path=/head/; revision=339635
* Don't rebuild ioctl.c and relink libsysdecode if there are no changesAlex Richardson2018-08-201-2/+7
| | | | | | | | | | Instead generate a temporary file and only overwrite ioctl.c if the files are actually different. Approved By: jhb (mentor) Notes: svn path=/head/; revision=338099
* Retire lmc(4)Ed Maste2018-05-011-3/+0
| | | | | | | | | | | | | | This driver supports legacy, 32-bit PCI devices, and had an ambiguous license. Supported devices were already reported to be rare in 2003 (when an earlier version of the driver was removed in r123201). Reviewed by: rgrimes Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15245 Notes: svn path=/head/; revision=333144
* Add support for decoding the nxt_flags, rcv_flags, and snd_flags ofMichael Tuexen2018-01-151-0/+3
| | | | | | | SCTP level cmsgs. Notes: svn path=/head/; revision=328014
* Add support for decoding the type of a cmsg.Michael Tuexen2018-01-151-0/+1
| | | | Notes: svn path=/head/; revision=327995
* Add a function is decode the sinfo_flags of struct sctp_sndrcvinfo.Michael Tuexen2018-01-141-0/+1
| | | | Notes: svn path=/head/; revision=327966
* Add suppor for the supported PR-SCTP policies.Michael Tuexen2018-01-141-0/+1
| | | | Notes: svn path=/head/; revision=327962
* Decode kevent structures logged via ktrace(2) in kdump.John Baldwin2017-11-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=326184
* Decode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode.John Baldwin2017-09-041-0/+3
| | | | | | | | | | 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. Notes: svn path=/head/; revision=323151
* Handle WITH/WITHOUT_PF in libsysdecodeKristof Provost2017-07-221-1/+1
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=321370
* Utilize SYSROOT from r320119 in places where DESTDIR may be wanting WORLDTMP.Bryan Drewery2017-06-191-2/+2
| | | | | | | | | | | | | | Since buildenv exports SYSROOT all of these uses will now look in WORLDTMP by default. sys/boot/efi/loader/Makefile A LIBSTAND hack is no longer required for buildenv. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=320122
* Decode the 'who' argument passed to getrusage().John Baldwin2017-06-031-0/+1
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=319520
* Improve the decoding of the third argument of the socket() call.Michael Tuexen2017-05-251-0/+1
| | | | | | | | | | 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. Notes: svn path=/head/; revision=318879
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-281-1/+1
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* Use SRCTOP-relative paths to other directories instead of .CURDIR-relative onesEnji Cooper2017-01-201-2/+2
| | | | | | | | | | This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312476
* Update libsysdecode for getfsstat() 'flags' argument changing to 'mode'.John Baldwin2017-01-031-1/+1
| | | | | | | | | | 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. Notes: svn path=/head/; revision=311151
* Move libsysdecode-specific hack out of buildworld.Bryan Drewery2016-11-131-1/+6
| | | | | | | | | | | | | 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. Reported by: jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308603
* Generate and use a proper .depend file for tables.h.Bryan Drewery2016-11-131-1/+2
| | | | | | | | | Reported by: jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308602
* Move mksubr from kdump into libsysdecode.John Baldwin2016-10-171-5/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Reviewed by: kib (several older versions), wblock (manpages) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D7847 Notes: svn path=/head/; revision=307538
* Move defines common between rtld and libsysdecode into the header,Konstantin Belousov2016-08-121-0/+1
| | | | | | | | | | instead of copying inline into sources. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=304016
* MFHGlen Barber2016-02-241-1/+3
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295957
| * Add handling for non-native error values to libsysdecode.John Baldwin2016-02-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=295931
* | First pass through library packaging.Glen Barber2016-02-041-0/+1
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
* Add support to libsysdecode for decoding system call names.John Baldwin2016-01-261-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=294849
* Move the mkioctls script to libsysdecode and use it to generate aJohn Baldwin2015-12-221-1/+22
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=292622
* Start on a new library (libsysdecode) that provides routines for decodingJohn Baldwin2015-12-151-0/+13
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 Notes: svn path=/head/; revision=292236