aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/ktrdump
Commit message (Collapse)AuthorAgeFilesLines
* 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
* usr.bin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+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 $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\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-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\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
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-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
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-2/+1
|
* ktrdump: properly parse %% in the format stringGleb Smirnoff2021-12-301-0/+2
| | | | Discovered by: 27ca37acb7c25
* Fix warning about signed comparison and drop WARNS for ktrdump(8).Dmitry Chagin2021-03-242-9/+7
| | | | | | Reviewed By: jhb, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29381
* capsicum: use a new capsicum helpers in toolsMariusz Zaborski2018-11-041-2/+1
| | | | | | | Use caph_{rights,ioctls,fcntls}_limit to simplify the code. Notes: svn path=/head/; revision=340138
* Add a "live" mode to ktrdump.John Baldwin2018-10-222-14/+62
| | | | | | | | | | | | | | | | | | | | | | | Support a "live" mode in ktrdump enabled via the -l flag. In this mode, ktrdump polls the kernel's trace buffer periodically (currently hardcoded as a 50 millisecond interval) and dumps any newly added entries. Fancier logic for the timeout (e.g. a command line option or some kind of backoff based on the time since the last entry) can be added later as the need arises. While here, fix some bugs from when this was Capsicum-ized: - Use caph_limit_stream() for the output stream so that isatty() works and the output can be line-buffered (especially useful for live mode). - Use caph_limit_stderr() to permit error messages to be displayed if an error occurs after cap_enter(). Reviewed by: kib, 0mp (manpage) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D17315 Notes: svn path=/head/; revision=339620
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-191-1/+1
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. 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. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Provide an error message if KTR symbols in a vmcore cannot be resolved.Mark Johnston2017-09-111-2/+7
| | | | | | | | | | libkvm does not set an error string in this case, so we were previously failing silently. MFC after: 1 week Notes: svn path=/head/; revision=323439
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-05-091-0/+1
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318000
* ktrdump(8): CapsicumifyConrad Meyer2016-12-161-0/+32
| | | | | | | | | | | | | | | We restrict the (optional) input file and output files. It would be nice to restrict the KVM files, but that's up to libkvm. We wait until after kvm_nlist() is invoked to cap_enter() because kldsym() isn't supported in the Capsicum sandbox. Feedback from: emaste@ (earlier versions) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D7921 Notes: svn path=/head/; revision=310142
* Update dependencies after r291406 added libelf to libkvm.Bryan Drewery2015-12-011-0/+1
| | | | | | | | | | | Unfortunately filemon/meta mode tracks all indirect dependencies here since ld(1) is reading libelf when linking in libkvm. Churn would be reduced if this was able to be limited to direct dependencies. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291558
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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 sync of headSimon J. Gerraty2015-05-273-16/+17
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge head from 7/28Simon J. Gerraty2014-08-191-2/+2
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | 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
| * | Merge headSimon J. Gerraty2014-04-281-7/+19
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * | | 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 with HEAD.David E. O'Brien2013-02-081-2/+4
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246555
| * \ \ \ Sync from headSimon J. Gerraty2012-11-041-2/+2
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | Change ktrdump to use the more standard -M/-N flags to specify the pathJohn Baldwin2015-02-062-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to a crash dump and kernel, respectively. The existing -m/-e flags are still supported for backwards compatiblity but are no longer documented. Requested by: np MFC after: 2 weeks Notes: svn path=/head/; revision=278327
* | | | | | Convert to usr.bin/ to LIBADDBaptiste Daroussin2014-11-251-2/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275042
* | | | | use .Mt to mark up email addresses consistently (part3)Baptiste Daroussin2014-06-231-2/+2
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de> Notes: svn path=/head/; revision=267773
* | | | Don't dump entries that were modified during the time the KTR buffer was beingNeel Natu2014-03-141-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | copied to userspace. Failing to do this would result in entries at the bottom of the ktrdump output to be more recent than entries at the top. With this change the timestamps are monotonically decreasing going from the top to the bottom of the ktrdump output. Notes: svn path=/head/; revision=263196
* | | | Fix an issue with ktrdump(8) where it would not print all entries in theNeel Natu2014-03-141-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KTR buffer. This happens when 'i' tries to wrap around from 0 to 'entries - 1'. Since 'i' is a signed integer the modulo operation actually returns a negative number. Fix this by computing the next index to use "by hand" instead of relying on the modulo operator. Notes: svn path=/head/; revision=263194
* | | | Print the ktr(4) format line that caused a failure.Gleb Smirnoff2014-01-171-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=260810
* | | - Implement run-time expansion of the KTR buffer via sysctl.Jeff Roberson2012-11-151-2/+4
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | - Implement a function to ensure that all preempted threads have switched back out at least once. Use this to make sure there are no stale references to the old ktr_buf or the lock profiling buffers before updating them. Reviewed by: marius (sparc64 parts), attilio (earlier patch) Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=243046
* | Catch up with r238925. ktr_entries may not be a power of 2.Navdeep Parhar2012-10-301-2/+2
|/ | | | Notes: svn path=/head/; revision=242378
* Add -H flag to print thread id.Dmitry Chagin2011-01-262-3/+15
| | | | Notes: svn path=/head/; revision=217873
* 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
* Remove unnecessary opt* definations.Xin LI2009-02-211-3/+0
| | | | Notes: svn path=/head/; revision=188890
* Skip format flags, when parsing ktr_desc.Gleb Smirnoff2006-01-121-1/+7
| | | | Notes: svn path=/head/; revision=154274
* Really fix the relative timestamp bug. It was only incorrect for the ALQNate Lawson2005-12-091-1/+2
| | | | | | | | | | | case. It seems entries are in reverse order when read from the kernel memory but in the right order when read from a file (i.e. ALQ). Handle both cases. MFC after: 1 day Notes: svn path=/head/; revision=153270
* Fix -r flag to actually work. "now" comes after "then", not vice versa.Nate Lawson2005-12-061-1/+1
| | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=153170
* Markup and wording fixes.Ruslan Ermilov2005-06-141-1/+1
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=147370
* Append a newline character to the usage string.Christian S.J. Peron2005-06-051-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=147034
* Sync program's usage() with manpage's SYNOPSIS.Ruslan Ermilov2005-05-211-2/+4
| | | | Notes: svn path=/head/; revision=146466
* Document the '-i' option which allows the user to specify a ktr eventsHiten Pandya2005-03-081-0/+5
| | | | | | | log file. Notes: svn path=/head/; revision=143275
* Don't use an uninitialised variable when reading from a ktr alq file.Julian Elischer2004-09-271-1/+1
| | | | Notes: svn path=/head/; revision=135842