aboutsummaryrefslogtreecommitdiff
path: root/lib/libsysdecode
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-2316-32/+0
| | | | | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit fa9896e082a1)
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-235-5/+0
| | | | | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit d0b2dbfa0ecf)
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-237-14/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in main: (cherry picked from commit 1d386b48a555)
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b3e7694832e8)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-251-1/+1
| | | | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* libsysdecode: Decode linux_clone syscall flagsDmitry Chagin2023-06-293-0/+20
| | | | | | | | Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40150 MFC after: 1 week (cherry picked from commit bd35e83bcf03a3650b5574f81201e8e55af4cdd7)
* linux(4): Rename linux_timer.h to linux_time.hDmitry Chagin2023-03-012-4/+4
| | | | | | | | | | | To avoid confusing people, rename linux_timer.h to linux_time.h, as linux_timer.c is the implementation of timer syscalls only, while linux_time.c contains implementation of all stuff declared in linux_time.h. MFC after: 2 weeks (cherry picked from commit c8a79231a5a74fc4263ec3d18c6519a974efb529)
* libsysdecode: Match socket option names containing underscoresMark Johnston2022-11-101-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. (cherry picked from commit 34c8598eb1bb101976d311051f9e630a6dfb6a0f)
* libsysdecode: Grab some more ioctl definitions from CAMMark Johnston2022-07-071-0/+1
| | | | | | Sponsored by: The FreeBSD Foundation (cherry picked from commit ec014502eee7a7d3a7e4d71e41a1e1dbc8a69dce)
* libsysdecode: Fix a typo in my emailDmitry Chagin2022-07-061-1/+1
| | | | | | | Reported by: Mikaël Urankar MFC after: 2 weeks (cherry picked from commit ed366c37d85a7ac7c58fcf3a0e8db980d099285c)
* libsysdecode: Decode Linux open() flagsDmitry Chagin2022-07-063-0/+37
| | | | | | MFC after: 2 weeks (cherry picked from commit fde775bc53de5b5abecdf8679f47bb3aa236e546)
* libsysdecode: Decode Linux *at() flagsDmitry Chagin2022-07-063-0/+10
| | | | | | MFC after: 2 weeks (cherry picked from commit d2b3237eebdfd46d54a9539acf13e3f24dc935b2)
* kdump: Decode Linux clock_nanosleep syscallDmitry Chagin2022-07-063-0/+9
| | | | | | MFC after: 2 weeks (cherry picked from commit 39de84b619b0d8bb27aa77e49b6134ca06370e1a)
* kdump: Decode Linux sigprocmask how argumentDmitry Chagin2022-07-063-0/+9
| | | | | | MFC after: 2 weeks (cherry picked from commit f587a2a765fb3bac352bedf6ef8b322eb3363339)
* libsysdecode: Decode setitimer, getitimer which argumentDmitry Chagin2022-07-064-1/+17
| | | | | | | | Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D35230 MFC after: 2 weeks (cherry picked from commit 2fc3a51db14f2be7fd1f5515c6adfc60d4880207)
* libsysdecode: Add method for decoding Linux signal namesDmitry Chagin2022-07-062-0/+80
| | | | | | | | Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D35215 MFC after: 2 weeks (cherry picked from commit f85848fc61752c3823825cdee34104a640d7f6e0)
* libsysdecode: Add preliminary support for decoding Linux syscallsDmitry Chagin2022-07-064-3/+232
| | | | | | | 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-064-159/+232
| | | | | | | | Reviewed by: jhb, emaste Differential revision: https://reviews.freebsd.org/D35353 MFC after: 2 weeks (cherry picked from commit 9dac609629d4e0ba813df6169f8bd8383fca024f)
* libsysdecode: Fix decoding of SCHED_ flagsDmitry Chagin2022-06-171-1/+1
| | | | | | | | | | Use sys/sched.h where SCHED_ flags are defined. Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D35208 MFC after: 2 weeks (cherry picked from commit 41068268ec480e58811a86787b60914709375b3f)
* libsysdecode: Add regression tests for sysdecode_cap_rights(3)Mark Johnston2022-04-223-0/+160
| | | | | | | Reviewed by: jhb, emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit d0f245d21f47c55ed40b34a17d5caf08aba1952f)
* libsysdecode: Include required headers in sysdecode.hMark Johnston2022-04-2217-39/+4
| | | | | | | | | | Make sysdecode.h self-contained rather than forcing all consumers to include dependencies. No functional change intended. Reviewed by: pauamma_gundo.com, jhb, emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit 354efc4c94078c3c83ea45d467c6377f3f92926e)
* libsysdecode: Fix decoding of Capsicum rightsMark Johnston2022-04-223-5/+73
| | | | | | | | | | | | | | | | | | | | | | | Capsicum rights are a bit tricky since some of them are subsets of others, and one can have rights R1 and R2 such that R1 is a subset of R2, but there is no collection of named rights whose union is R2. So, they don't behave like most other flag sets. sysdecode_cap_rights(3) does not handle this properly and so can emit misleading decodings. Try to fix all of these problems: - Include composite rights in the caprights table. - Use a constructor to sort the caprights table such that "larger" rights appear first and thus are matched first. - Don't print rights that are a subset of rights already printed, so as to minimize the length of the output. - Print a trailing message if some of the specific rights are not matched by the table. PR: 263165 Reviewed by: pauamma_gundo.com (doc), jhb, emaste Sponsored by: The FreeBSD Foundation (cherry picked from commit 869199d9922c7dee92c1c24f95b90f1d1319433e)
* fd: add close_range(..., CLOSE_RANGE_CLOEXEC)Mateusz Guzik2022-03-074-1/+13
| | | | | | | | | | For compatibility with Linux. MFC after: 3 days Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D34424 (cherry picked from commit f3f3e3c44d3b1776653bbf19eab17ce006a815d8)
* Remove PT_GET_SC_ARGS_ALLKonstantin Belousov2022-02-211-1/+1
| | | | | | | | | | | | | | | | Reimplement bdf0f24bb16d556a5b by checking for the caller' ABI in the implementation of PT_GET_SC_ARGS, and copying out everything if it is Linuxolator. Also fix a minor information leak: if PT_GET_SC_ARGS_ALL is done on the thread reused after other process, it allows to read some number of that thread last syscall arguments. Clear td_sa.args in thread_alloc(). Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D31968 (cherry picked from commit f575573ca57716395ad88b962388a55d755cf6a7)
* linux: implement PTRACE_GET_SYSCALL_INFOEdward Tomasz Napierala2022-02-211-1/+1
| | | | | | | | | | | This is one of the pieces required to make modern (ie Focal) strace(1) work. Reviewed By: jhb (earlier version) Sponsored by: EPSRC Differential Revision: https://reviews.freebsd.org/D28212 (cherry picked from commit bdf0f24bb16d556a5b1e01cdfc087d08e91ac572)
* libsysdecode: Decode sendmsg/recvmsg flags containing an underscoreMark Johnston2022-01-111-1/+1
| | | | | | | | Otherwise MSG_CMSG_CLOEXEC is not decoded. Sponsored by: The FreeBSD Foundation (cherry picked from commit e2576591b9bdccc187bcd509be760c18c96a7790)
* sysdecode_enum.3: Fix a typo: SIGBTRAP -> SIGTRAP.John Baldwin2021-10-191-1/+1
| | | | | | Sponsored by: DARPA (cherry picked from commit 680d70b59e0379ded0cc94e3772bc47be2163c7f)
* libsysdecode: fix decoding of TCP_NOPUSH and TCP_MD5SIGMichael Tuexen2021-03-021-1/+1
| | | | | | | | | | | TCP_FASTOPEN_MIN_COOKIE_LEN was incorrectly registered as a name of a IPPROTO_TCP level socket option, which overwrote TCP_NOPUSH. TCP_FASTOPEN_PSK_LEN was incorrectly registered as a name of an IPPROTO_TCP level socket option, which overwrote TCP_MD5SIG. Sponsored by: Netflix, Inc. (cherry picked from commit f25266bee7dafb10f03e06537c8127cc17335bed)
* libsysdecode: decode _UMTX_OP flagsKyle Evans2020-12-093-1/+17
| | | | | | | | | | | | Assume that UMTX_OP with a double underbar following is a flag, while any underbar+alphanumeric combination immeiately following is an op. This was a part of D27325. Reviewed by: kib Notes: svn path=/head/; revision=368480
* libsysdecode: account for invalid protection flagsPawel Biernacki2020-11-261-1/+1
| | | | | | | | Reported by: jhb MFC with: r368022 Notes: svn path=/head/; revision=368053
* libsysdecode: correctly decode mmap flagsPawel Biernacki2020-11-251-1/+1
| | | | | | | | | | | | | | r352913 added decoding of mmap PROT_MAX()'d flags but didn’t account for the case where different values were specified for PROT_MAX and regular flags. Fix it. Submitted by: sigsys_gmail.com Reported by: sigsys_gmail.com MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D27312 Notes: svn path=/head/; revision=368022
* Make linux_errtbl[] static.Edward Tomasz Napierala2020-11-031-1/+0
| | | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27004 Notes: svn path=/head/; revision=367301
* Add defines for Linux errno values and use them to make linux_errtbl[]Edward Tomasz Napierala2020-10-291-0/+1
| | | | | | | | | | | | | more readable. While here, add linux_check_errtbl() function to make sure we don't leave holes. No objections: emaste (earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26972 Notes: svn path=/head/; revision=367132
* Fix a few mandoc issuesGordon Bergling2020-10-091-3/+3
| | | | | | | | | | - skipping paragraph macro: Pp after Sh - sections out of conventional order: Sh EXAMPLES - whitespace at end of input line - normalizing date format Notes: svn path=/head/; revision=366583
* Fix compilation of libsysdecode after r365522, should have been part of it.Konstantin Belousov2020-09-091-0/+1
| | | | | | | | | | | Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Notes: svn path=/head/; revision=365523
* Add MSG_TLSAPPDATA to lib/libsysdecode/mktables.Rick Macklem2020-08-201-1/+1
| | | | | | | | | I have no idea what this does (and until now that it even existed), but apparently it needs this entry changed for the MSG_TLSAPPDATA, since it is kernel only. Notes: svn path=/head/; revision=364415
* 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
* libsysdecode: grab shmflags from sys/mman.h, add decode methodKyle Evans2020-02-193-0/+9
| | | | | | | | | | | | Any SHM_* flag here is (and likely will continue to be) a shmflag that may be passed to shm_open2(), with exception to SHM_ANON. This is a prereq to adding appropriate support to truss/kdump. Reviewed by: kaktus (slightly earlier version) Differential Revision: https://reviews.freebsd.org/D23733 Notes: svn path=/head/; revision=358115
* Update libssp paths in various Makefile.depend* filesKyle Evans2020-01-061-1/+1
| | | | | | | | | I've been advised that the model that uses these are fairly resilient, but we do know the proper path to use (or remove, in the case of ^/targets/...), so go ahead and update them to reflect that. Notes: svn path=/head/; revision=356422
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-4/+9
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* libsysdecode: decode PROT_MAX flagsPawel Biernacki2019-09-301-1/+11
| | | | | | | | | | | | | | | | | | | | | | | Extend libsysdecode to pretty-print PROT_MAX flags and fix decoding of regular protection flags broken since r349240. before: truss: mmap(0x0,40960,0x30000,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000) kdump: 11439 protmax CALL mmap(0,0xa000,0x30000<><invalid>196608,0x21002<MAP_PRIVATE|MAP_ANON|MAP_NOCORE>,0xffffffff,0) after: truss: mmap(0x0,40960,PROT_MAX(PROT_READ|PROT_WRITE)|PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34366234624 (0x800632000) kdump: 11439 protmax CALL mmap(0,0xa000,0x30000<PROT_MAX(PROT_READ|PROT_WRITE)|PROT_READ|PROT_WRITE>,0x21002<MAP_PRIVATE|MAP_ANON|MAP_NOCORE>,0xffffffff,0) Reviewed by: kib (mentor) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D21706 Notes: svn path=/head/; revision=352913
* 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-162-12/+18
| | | | | | | | | | | | | | | | | 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
* Drop "All rights reserved" from my copyright statements.John Baldwin2019-03-0618-18/+0
| | | | | | | | | Reviewed by: rgrimes MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19485 Notes: svn path=/head/; revision=344855
* Add missing SCTP_EOR entry.Michael Tuexen2019-02-041-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=343742
* Fix regex for extracting SHM_* values for libsysdecodeAlex Richardson2018-10-232-3/+4
| | | | | | | | | | | | | | | | | 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