aboutsummaryrefslogtreecommitdiff
path: root/lib/libsysdecode
Commit message (Collapse)AuthorAgeFilesLines
...
* Handle WITH/WITHOUT_PF in libsysdecodeKristof Provost2017-07-222-2/+8
| | | | | | | | | | | 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
* Remove special handling for 'disk*.h'John Baldwin2017-07-181-3/+1
| | | | | | | | | | | This was originally added so that only one of diskmbr.h or diskpc98.h was chosen and is no longer needed after PC98's removal. However, the special handling was also broken as it effectively prevented the decoding of ioctls declared in other headers such as <sys/disk.h> or <sys/disklabel.h>. Notes: svn path=/head/; revision=321176
* DIRDEPS_BUILD: Connect more libraries.Bryan Drewery2017-07-111-0/+2
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=320884
* Tweak r320206: Still create the TABLE but not the .depend entry for missing ↵Bryan Drewery2017-06-211-9/+10
| | | | | | | | | | | headers. X-MFC-With: r320206 MFC after: 3 days Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=320207
* Follow-up r308602: Don't add missing headers to .depend.tables.h.Bryan Drewery2017-06-211-0/+1
| | | | | | | | | | | | | | | This also avoids an error from egrep when a header is missing. This can happen with something like WITHOUT_BLUETOOTH set when searching for $include_dir/netgraph/bluetooth/include/ng_btsocket.h. The warning was not an error (from set -e) due to being on the left side of a pipe. Now the all_headers list is only filled with existing headers. Reviewed by: ngie MFC after: 3 days Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=320206
* 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
* Improve decoding of RB_AUTOBOOT in the 'howto' argument to reboot().John Baldwin2017-06-101-1/+12
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=319765
* Decode the 'who' argument passed to getrusage().John Baldwin2017-06-035-1/+15
| | | | | | | | | | | | | 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
* Add a cross-reference to sysdecode_socket_protocol(3).John Baldwin2017-06-031-1/+2
| | | | Notes: svn path=/head/; revision=319517
* Improve the decoding of the third argument of the socket() call.Michael Tuexen2017-05-254-0/+69
| | | | | | | | | | 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
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-05-091-0/+115
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318000
* Add support for socket option names related to the level IPPROTO_UDPLITE.Michael Tuexen2017-05-042-0/+4
| | | | Notes: svn path=/head/; revision=317789
* Add support for socket option names related to the IPPROTO_IPV6 level.Michael Tuexen2017-05-032-0/+3
| | | | Notes: svn path=/head/; revision=317748
* Add support for socket option names related to the IPPROTO_SCTP level.Michael Tuexen2017-05-032-0/+4
| | | | Notes: svn path=/head/; revision=317747
* Fix libsysdecode vmprot flag decodingSteven Hartland2017-03-162-1/+2
| | | | | | | | | | | | | | | Fix the regex used to find vmprot table entries and add the missing include. This fixes kdumps output of PFLT arguments which would previously look like: 5202 101546 ktrace PFLT 0x5ae000 0x2<><invalid>2 They now display correctly: 5202 101546 ktrace PFLT 0x5ac000 0x2<VM_PROT_WRITE> MFC after: 1 week Notes: svn path=/head/; revision=315423
* Spell "const" properly.Maxim Konovalov2017-03-151-1/+1
| | | | | | | | PR: 217797 Submitted by: tobik Notes: svn path=/head/; revision=315310
* Fix sysdecode_cap_rights which currently prints bogus capability rightsTobias Kortkamp2017-03-141-9/+1
| | | | | | | | | PR: 217787 Reviewed by: jhb, emaste Approved by: jhb Notes: svn path=/head/; revision=315283
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=314436
* Extend LD_UTRACE by also generating utrace(2) log events for runtime linkerPeter Jeremy2017-01-301-0/+4
| | | | | | | | | | | | errors. Reviewed by: kib, jhb Approved by: jhb(mentor) MFC after: 1 week Differential Revision: D9347 Notes: svn path=/head/; revision=312984
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-282-10/+2
| | | | | | | | | 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
* Unbreak lib/libsysdecode after r311568 by decoding MSG_MORETOCOME flagEnji Cooper2017-01-071-1/+1
| | | | | | | | | | | | | | in msgflags MFC after: 1 month X-MFC with: r311568 Pointyhat to: jhb Reported by: cy Submitted by: Michael Butler <imb@protected-networks.net> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=311584
* Update libsysdecode for getfsstat() 'flags' argument changing to 'mode'.John Baldwin2017-01-036-10/+15
| | | | | | | | | | 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-132-2/+18
| | | | | | | | | Reported by: jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308602
* Use binary and (&) instead of logical to extract the mask of a capability.John Baldwin2016-10-251-1/+1
| | | | | | | | CID: 1365227 Submitted by: cem Notes: svn path=/head/; revision=307948
* Move mksubr from kdump into libsysdecode.John Baldwin2016-10-1721-10/+2316
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-122-27/+8
| | | | | | | | | | instead of copying inline into sources. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=304016
* Decode 32bit utrace records on the 64bit host.Konstantin Belousov2016-08-121-2/+54
| | | | | | | | | | | | | Suppose that ktrace is performed on 32bit binary running on 64bit host. In this case, the kernel records are 64bit, while utrace records from rtld and malloc are 32bit. Make kdump useful to see decoded utrace data in that case. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=303991
* MFHGlen Barber2016-04-041-1/+1
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=297567
| * Replace the CloudABI system call table by a machine generated version.Ed Schouten2016-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=297247
* | MFHGlen Barber2016-03-022-7/+4
|\| | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296318
| * errno(3) -> errno(2)Edward Tomasz Napierala2016-02-291-4/+4
| | | | | | | | | | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=296211
| * DIRDEPS_BUILD: Regenerate without local dependencies.Bryan Drewery2016-02-241-3/+0
| | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=295989
* | MFHGlen Barber2016-02-246-3/+312
|\| | | | | | | | | | | | | 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-236-3/+312
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions.John Baldwin2016-01-303-19/+19
| | | | | | | | | Suggested by: jmallett Reviewed by: bdrewery, jmallett Differential Revision: https://reviews.freebsd.org/D5123 Notes: svn path=/head/; revision=295056
* Add support to libsysdecode for decoding system call names.John Baldwin2016-01-265-2/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add in DIRDEPS_BUILD support.Bryan Drewery2016-01-071-0/+22
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=293287
* Move the mkioctls script to libsysdecode and use it to generate aJohn Baldwin2015-12-225-1/+178
| | | | | | | | | | | | | | 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-155-0/+344
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