aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/ktrace
Commit message (Collapse)AuthorAgeFilesLines
* ktrace: Only enable EXTERROR traces for 'x'John Baldwin2025-11-061-0/+1
| | | | | | | Add a missing break statement to avoid falling through to the '+' case. Fixes: 96f4be881e8e ("ktrace(1): teach about KTR_EXTERR")
* ktrace(1): teach about KTR_EXTERRKonstantin Belousov2025-06-033-2/+8
| | | | | | | Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633
* ktrace: Make -t t trace struct arrays as well as structsMark Johnston2025-01-072-2/+2
| | | | | | Otherwise there is no specific -t option which captures struct arrays. MFC after: 1 week
* ktrace.1: Add ARGS and ENVS as default trace pointsJose Luis Duran2024-11-171-2/+2
| | | | | | | | | | After commit 65a4daeaf324 ("ktrace: log execve(2) arguments and environment"), "a" and "e" are part of the default set of trace points. Reviewed by: markj Approved by: emaste (mentor) Fixes: 65a4daeaf324 ("ktrace: log execve(2) arguments and environment") Differential Revision: https://reviews.freebsd.org/D47648
* ktrace: log execve(2) arguments and environmentArtem Hevorhian2024-11-113-2/+17
| | | | | | | | Two new events KTR_ARGS and KTR_ENV can be used to trace arguments of execve(2). Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D47127
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* ktrace(1): add more xrefsEd Maste2024-06-111-4/+12
| | | | | | | | | | Following commit a87651e2ff18 add xrefs to intro(2) and sigaction(2), and use a consistent form. Suggested by: kib, arrowd Reviewed by: kib (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45555
* ktrace(1): add xref to namei(9)Ed Maste2024-06-101-3/+5
| | | | | | | | | namei was mistaken for a typo (see GitHub pull request #1284). Add an xref to make it clear. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45546
* ktrace: Remove CAPFAIL from default trace pointsJake Freeland2024-04-242-5/+4
| | | | | | | | | | | | | | | | | | | | | | The CAPFAIL tracepoint was recently extended to report ECAPMODE capability violations for processes that do not enter capability mode. This allows developers that are interested in Capsicumizing their programs to determine where violations are being raised. Previously, CAPFAIL only produced output for processes using Capsicum(4) capabilties. Thus, most ktrace users never received log output from the trace point. With the recent changes, this is no longer the case. Having this trace point enabled by default will produce output for all processes that use syscalls that are not permitted in capability mode. This may lead to confusion for users that are not familiar with the feature. Remove KTRFAC_CAPFAIL from ktrace's default points to avoid this. Approved by: markj (mentor) Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D44887
* ktrace: Describe CAPFAIL trace point in man pageJake Freeland2024-04-241-2/+18
| | | | | | | | | | Update the ktrace(1) man page to describe the recently improved capability failure tracing. Approved by: markj (mentor) Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D44886
* usr.bin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-4/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-10/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-275-11/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-162-4/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Mark usage function as __dead2 in programs where it does not returnAlfonso Gregory2023-07-071-1/+1
| | | | | | | | In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/735
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* Make it clear what the userland traces are in the ktrace(1) man page.Edward Tomasz Napierala2019-08-261-3/+5
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=351509
* Decode kevent structures logged via ktrace(2) in kdump.John Baldwin2017-11-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-203-0/+6
| | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Improve the ktrace(1) man page to make it slightly more obvious that thereEdward Tomasz Napierala2017-07-241-3/+11
| | | | | | | | | | | | are _two_ options that control its behaviour wrt child processes; slightly improve the example[1], and add Xrefs. Discussed with: wblock [1] MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=321422
* Use more usual formatting for the EXAMPLES section of ktrace(1).Edward Tomasz Napierala2017-07-211-11/+11
| | | | | | | | MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=321327
* Renumber copyright clause 4Warner Losh2017-02-284-4/+4
| | | | | | | | | | | | 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
* Add a cross reference to ktrace(2).Brooks Davis2016-03-311-2/+3
| | | | | | | | | Obtained from: CheriBSD (9cb420d6b7f04c1b7d2006180b80932e5d3fe50e) MFC after: 1 week Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=297476
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge from head@274682Simon J. Gerraty2014-11-191-4/+6
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=274683
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | Clarify that the -c argument clears the list of tracepoints specified byJohn Baldwin2014-08-261-4/+6
|/ | | | | | | | | | -t (it does not clear all tracepoints). Submitted by: jmg, Eric van Gyzen <eric@vangyzen.net> MFC after: 1 week Notes: svn path=/head/; revision=270674
* Don't trace or dump page fault records in the default set of tracepointsJohn Baldwin2012-05-312-5/+5
| | | | | | | | | | as they can be quite noisy. Requested by: Peter Jeremy MFC after: 3 days Notes: svn path=/head/; revision=236357
* Add new ktrace records for the start and end of VM faults. This givesJohn Baldwin2012-04-053-3/+9
| | | | | | | | | | | | | a pair of records similar to syscall entry and return that a user can use to determine how long page faults take. The new ktrace records are enabled via the 'p' trace type, and are enabled in the default set of trace points. Reviewed by: kib MFC after: 2 weeks Notes: svn path=/head/; revision=233925
* Make ktrace(1) build cleanly at WARNS level 6 by completely rethinking theDag-Erling Smørgrav2011-10-182-40/+73
| | | | | | | | | way in which it handles the -C, -c, -g and -p options. MFC after: 3 weeks Notes: svn path=/head/; revision=226504
* Add a new trace point, KTRFAC_CAPFAIL, which traces capability checkDag-Erling Smørgrav2011-10-113-5/+10
| | | | | | | failures. It is included in the default set for ktrace(1) and kdump(1). Notes: svn path=/head/; revision=226269
* Remove duplicated header filesKevin Lo2011-06-241-1/+0
| | | | Notes: svn path=/head/; revision=223493
* Teach kdump to understand sv_flags records in the trace files.Dmitry Chagin2011-02-252-1/+5
| | | | | | | MFC after: 1 Month. Notes: svn path=/head/; revision=219043
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-114-16/+0
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* - Sort list of trace points.John Baldwin2010-07-141-3/+3
| | | | | | | | | - Note that 'y' (sysctl requests) is in the default set of trace points. MFC after: 3 days Notes: svn path=/head/; revision=210068
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-0/+2
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
* Revert most part of 200420 as requested, as more review and polish isXin LI2009-12-131-0/+2
| | | | | | | needed. Notes: svn path=/head/; revision=200462
* Remove unneeded header includes from usr.bin/ except contributed code.Xin LI2009-12-111-2/+0
| | | | | | | Tested with: make universe Notes: svn path=/head/; revision=200420
* Add a new type of KTRACE record for sysctl(3) invocations. It uses theJohn Baldwin2009-03-113-1/+9
| | | | | | | | | | | internal sysctl_sysctl_name() handler to map the MIB array to a string name and logs this name in the trace log. This can be useful to see exactly which sysctls a thread is invoking. MFC after: 1 month Notes: svn path=/head/; revision=189707
* Spell -t option's argument by name.Ruslan Ermilov2008-04-022-5/+5
| | | | Notes: svn path=/head/; revision=177856
* Fix usage string.Dag-Erling Smørgrav2008-03-201-2/+2
| | | | Notes: svn path=/head/; revision=177446