Home | History | Annotate | only in /src/usr.bin/ktrace
History log of /src/usr.bin/ktrace
RevisionDateAuthorComments
 1.15 14-Apr-2009  lukem Enable WARNS=4 by default for usr.bin, except for:
awk bdes checknr compile_et error gss hxtool kgetcred kinit
klist ldd less lex locale login m4 man menuc mk_cmds
mklocale msgc openssl rpcgen rpcinfo sdiff spell ssh
string2key telnet tn3270 verify_krb5_conf xlint
 1.14 16-Jul-2005  christos branches: 1.14.32;
WARNS=3
 1.13 27-Aug-2002  lukem Implement MKDYNAMICROOT, which currently defaults to "no", but will
be changed in the future to "yes".

If MKDYNAMICROOT == "no", there is no change from existing behaviour
of a static /bin and /sbin (and a few programs in elsewhere).

If MKDYNAMICROOT == "yes", the following changes occur:
in <bsd.own.mk>:
SHLIBDIR?= /lib
SHLINKDIR?= /lib
in various Makefiles, the following entry is DISABLED.
LDSTATIC?=-static
This results in all programs (except those "standalone" programs built
in sys/arch/*/stand) are linked dynamically, the shared linker is moved
from /usr/libexec to /lib (with a compat symlink), and the shared
libraries used by /bin and /sbin programs are moved from /usr/lib to
/lib (with compat symlinks).
 1.12 14-Nov-2000  jdolecek back out previous change - this needs to be discussed first at least
 1.11 13-Nov-2000  jdolecek don't link these static; if shared libraries are hosed, these utilities would
surely not save the situation, not help to recover from it
 1.10 28-Jul-1999  enami - remove duplicated setting for LDSTATIC in ktruss/Makefile.
- fix command name in SYNOPSIS section of man page.
- link ktrace man page to ktruss man page.
- add executable and man page for ktruss in distrib sets.
 1.9 02-Mar-1998  cgd allow LDSTATIC definition to be overridden by bsd.own.mk/mk.conf
 1.8 19-Oct-1997  lukem don't define WARNS=1 here
 1.7 23-Jul-1997  mikel set WARNS?=1, cleanup
 1.6 09-Jan-1997  tls RCS ID police
 1.5 06-Dec-1994  deraadt Link these statically to make shared library debugging easier
 1.4 06-Oct-1994  mycroft Add RCS ids.
 1.3 11-May-1994  cgd clean up import
 1.2 31-Jul-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 11-May-1994  cgd updated ktrace
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.14.32.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.49 12-Feb-2024  gutteridge ktrace.1: apply minor spelling consistency

Use "tracepoint" consistently, rather than a mix with "trace point",
sometimes in the same paragraph. "Breakpoint" and "tracepoint" are
most commonly rendered without the space in tech documentation, AFAIK.
 1.48 06-May-2023  uwe ktrace(1): tweak -c wording for clarity
 1.47 02-Sep-2022  gutteridge ktrace.1: correct historical reference and minor grammar tweak
 1.46 18-Nov-2020  wiz Sort options.

Prompted by pgoyette.
 1.45 29-Mar-2020  sevan tense
 1.44 29-Mar-2020  sevan Document ktrace history
 1.43 08-Jan-2015  riastradh branches: 1.43.16;
Omit no longer existing l, m from default trace points.
 1.42 01-Jun-2011  wiz branches: 1.42.4; 1.42.20;
Bump date for previous.
 1.41 01-Jun-2011  alnsn kern/42030 - tracking of file descriptors by ktrace/kdump
 1.40 27-Apr-2011  joerg branches: 1.40.2;
Remove Mach specific trace points.
 1.39 27-Aug-2007  dsl Remove 'U' (was scheduler activations) from the list of default trace points.
 1.38 02-Mar-2007  wiz Fix typo.
 1.37 27-Feb-2007  ad Remove ref to SA.
 1.36 08-Jan-2007  wiz Remove dot and end of SEE ALSO.
 1.35 07-Jan-2007  rillig See also: ktrace(2).
 1.34 24-Sep-2006  wiz Bump date for previous.
 1.33 23-Sep-2006  manu Add a -t+S flag to ktrace for tracing activity related to sysctl. MIB
names will be displayed, with data readen and written as well.
 1.32 07-Feb-2006  skrll Add scheduler activations upcall data to the default list of trace
points.

OK'd by christos.
 1.31 12-Dec-2005  wiz Improve -v description slightly.
 1.30 11-Dec-2005  christos add a trace facility for upcalls.
 1.29 11-Dec-2005  christos Learn about ktrace v1 records.
 1.28 24-Jun-2004  wiz Drop trailing whitespace, and bump date for previous.
 1.27 24-Jun-2004  christos Fix a bug in ktruss and ktrace, where they would randomly stop tracing if
the write to the ktraced file descriptor (when they used fktrace internally)
would block. Fix by clearing the non-blocking bit in the file descriptor by
default, so that the writes will block. This has the side effect of stopping
the traced process. Add a flag to override (-n) this behavior and have the
trace stop without blocking the traced process (the previous behavior).
Fix lint, add checks to failed syscalls, ansify.
 1.26 24-Nov-2003  wiz Bump date for previous (hi manu!).
 1.25 24-Nov-2003  manu Enable tracing of out of line data sent with Mach messages
 1.24 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.23 24-Jul-2003  wiz Sort translation options list.
 1.22 17-Jul-2003  dsl Grok KTR_EXEC_ENV and KTR_EXEC_ARG.
Make ktrace -c default to removing all trace points (not just the default ones).
Make kdump default to dumping everything in the trace file.
Add 'A' (all) and '-' (remove following) to valid -t arguments.
Dump data block of UNKNOWN trace points in hex + ascii.
Make first time output with -R 0 (instead of time since epoch).
Use svis() instead of vis() to get " escaped (as \") (needs fixed libc)
Correctly pass unsigned values to svis()
Update man pages.
 1.21 06-May-2003  wiz Grammar and mdoc fixes. Bump date for last two.
 1.20 02-May-2003  gmcgarry Some more ktruss documentation from Christian Biere <christianbiere@gmx.de>
in PR#17111.
 1.19 02-May-2003  gmcgarry Explain what ktruss does. Document -l, -R and -T options.
Addresses PR#10458.
 1.18 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.17 18-Dec-2002  wiz Bump date for some recent mach changes, fix two nits.
 1.16 09-Dec-2002  manu Added support for dumping mach messages in ktrace/kdump. While we are
there, KNFify a few functions.
 1.15 26-Oct-2001  jdolecek actually document trstr 'u' - user data and note it's included by default
kill some trailing whitespace
 1.14 04-May-2001  simonb Add a -s option to open the trace file with O_SYNC.
 1.13 10-Apr-2000  jdolecek add description for -e argument (for ktruss)
 1.12 28-Jul-1999  enami - remove duplicated setting for LDSTATIC in ktruss/Makefile.
- fix command name in SYNOPSIS section of man page.
- link ktrace man page to ktruss man page.
- add executable and man page for ktruss in distrib sets.
 1.11 12-Jul-1999  darrenr include comments for ktruss
 1.10 22-Mar-1999  garbled More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Many more to
come.
 1.9 27-Jun-1998  nathanw Sync to reality; add missing tracepoint options.
 1.8 19-Oct-1997  lukem fix up .Nm usage
 1.7 23-Jul-1997  mikel nuke duplicate RCSid
 1.6 25-May-1997  cjs PR 3666 from Thorsten Frueauf <frueauf@ira.uka.de>
Fix formatting.
 1.5 07-Feb-1997  mikel fix typo; from Saitoh Masanobu in PR misc/3195.
 1.4 09-Jan-1997  tls RCS ID police
 1.3 19-Jul-1995  christos Add support for displaying and switching between
different OS system call emulations
 1.2 06-Oct-1994  mycroft Add RCS ids.
 1.1 11-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 11-May-1994  cgd updated ktrace
 1.40.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.42.20.1 18-Mar-2015  snj Pull up following revision(s) (requested by riastradh in ticket #604):
usr.bin/ktrace/ktrace.1: revision 1.43
Omit no longer existing l, m from default trace points.
 1.42.4.1 14-Apr-2015  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1276):
usr.bin/ktrace/ktrace.1: revision 1.43
Omit no longer existing l, m from default trace points.
 1.43.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.46 24-Jan-2013  christos use O_CLOEXEC.
 1.45 16-Sep-2011  joerg branches: 1.45.2; 1.45.8;
Use __dead
 1.44 05-Feb-2011  yamt update usage
 1.43 11-Jan-2009  christos branches: 1.43.4;
merge christos-time_t
 1.42 21-Jul-2008  lukem branches: 1.42.6;
Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.41 08-Feb-2007  drochner branches: 1.41.12;
include <signal.h> where signal(3) is used
 1.40 17-Jan-2007  hubertf Remove duplicate #includes
From Slava Semushin <slava.semushin@gmail.com>, via private mail
 1.39 12-Dec-2005  wiz Sync usage with man page.
 1.38 11-Dec-2005  christos Learn about ktrace v1 records.
 1.37 16-Jul-2004  enami - If fktrace(2) failed, just exit rather than waiting for trace output.
- Reduce #ifdef a bit.
 1.36 10-Jul-2004  enami No need to pretty print the errno with err() or warn().
 1.35 24-Jun-2004  christos Fix a bug in ktruss and ktrace, where they would randomly stop tracing if
the write to the ktraced file descriptor (when they used fktrace internally)
would block. Fix by clearing the non-blocking bit in the file descriptor by
default, so that the writes will block. This has the side effect of stopping
the traced process. Add a flag to override (-n) this behavior and have the
trace stop without blocking the traced process (the previous behavior).
Fix lint, add checks to failed syscalls, ansify.
 1.34 28-Feb-2004  enami Replace rest of exit status `1' with EXIT_FAILURE.
 1.33 28-Feb-2004  enami Fix usage:
- ktrace(1) takes -s.
- ktruss(1) takes -l.
- -C/-c and commands are exclusive.
- make output fits 80 column.
 1.32 28-Feb-2004  enami - Make ktruss(1) works as expected when -c or -C is specified.
- Include pid or file descriptor in error message when
ktrace(2)/fktrace(2) failed.
- Remove unnecessary cast.
 1.31 28-Feb-2004  enami Fix whitespace usage.
 1.30 05-Jan-2004  jmmv Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
 1.29 24-Nov-2003  manu Enable tracing of out of line data sent with Mach messages
 1.28 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.27 17-Jul-2003  dsl Grok KTR_EXEC_ENV and KTR_EXEC_ARG.
Make ktrace -c default to removing all trace points (not just the default ones).
Make kdump default to dumping everything in the trace file.
Add 'A' (all) and '-' (remove following) to valid -t arguments.
Dump data block of UNKNOWN trace points in hex + ascii.
Make first time output with -R 0 (instead of time since epoch).
Use svis() instead of vis() to get " escaped (as \") (needs fixed libc)
Correctly pass unsigned values to svis()
Update man pages.
 1.26 09-Dec-2002  manu Added support for dumping mach messages in ktrace/kdump. While we are
there, KNFify a few functions.
 1.25 19-Jul-2002  christos PR/17643: Jared D. McNeill: ktrace leaves ktrace.out file with a kernel
that does not support ktrace.
 1.24 02-Sep-2001  assar repair command-line parsing so that an error is generated if no pid or
program is given (or input file for ktruss)
 1.23 04-May-2001  simonb Add a -s option to open the trace file with O_SYNC.
 1.22 01-May-2001  simonb Don't assume pipes are implemented as sockets -- don't call setsockopt()
on the pipe descriptors.
 1.21 19-Feb-2001  cgd convert to use getprogname()
 1.20 13-Nov-2000  jdolecek constify
 1.19 07-Jul-2000  itojun errx?/warnx? audit. do not pass variable alone, use %s. idea from openbsd
 1.18 03-Jul-2000  matt Make gcc 2.96 (and maybe earlier) happier. Include <stdlib.h>,<string.>,
etc. as appropriate to get exit,srncmp,abs,abort,etc.
Add -I${.CURDIR} to a few Makefiles
 1.17 27-May-2000  sommerfeld branches: 1.17.4;
Two tweaks:
- For cleaner subprocess traces, malloc something before
spawning, so the syscalls malloc does while initializing don't gunk up
the trace.
- Increase pipe buffer sizes.
 1.16 13-Apr-2000  itohy [ktruss] Use fork(2), not vfork(2).
The child process of do_ktrace() does return and the stack is
changed by another function call (execvp()).
By using vfork() (my previous change), the execution of the parent
process resumes on the modified stack. Oops.
We could use vfork() carefully, but for now use fork().

Problem reported and investigated by Ethan Solomita <ethan@geocast.com>.
Thanks.
 1.15 10-Apr-2000  jdolecek DTRT vs setemul() (for ktruss, similar to kdump.c)
 1.14 10-Apr-2000  jdolecek update to setemul() changes
 1.13 29-Oct-1999  itohy Make ktrace(1) not affect interactions between processes.
Following examples show the cases.

% ktrace -f - false >/dev/null && echo wrong
wrong
% ktrace -f - -i /usr/sbin/update >/dev/null
(does not return to command line)

That is, back out last change and restore the roles of parent/child for
ktrace(1). The ktruss(1) stuff still remains.
Yes, ktruss(1) has the problems. Better implementation is expected.
 1.12 30-Jul-1999  darrenr branches: 1.12.2;
Change behaviour from running the command as the parent and ktrace/ktruss as
the child to be ktruss/ktrace is the parent. This fixes a problem with ktruss
where the prompt would be returned in the middle of output.
 1.11 23-Jul-1999  itohy Fix fowllowing problems:

1. If fork()ing, the program is executed twice.
2. If the ktruss(1) output is bufferd, the final output is not flushed
(because it is executing).

% ktrace -f - rm >/dev/null
usage: rm [-dfiPRrW] file ...
usage: rm [-dfiPRrW] file ...
% ktruss date | cat
Fri Jul 23 12:09:45 JST 1999
Fri Jul 23 12:09:46 JST 1999
%
 1.10 11-Jan-1999  kleink In userland, pull in <errno.h> instead of <sys/errno.h> for the declaration
of errno.
 1.9 14-Jul-1998  nathanw Make "ktrace -f" work again. Slightly klugy because of the
#ifdef's for KTRUSS.
 1.8 27-Jun-1998  christos Appease gcc on arm32
 1.7 27-Jun-1998  christos fktrace support / ktruss additions.
 1.6 27-Jun-1998  nathanw Make "ktrace -c" work as documented.
Update usage message to match reality.

Closes PR bin/5358.
 1.5 23-Jul-1997  mikel add explicit return types and prototypes for local functions
use __COPYRIGHT and __RCSID macros, fix other gcc -Wall warnings
 1.4 31-Aug-1995  jtc Sync with 4.4lite2
 1.3 03-Jan-1995  glass reapplied patch that made ktrace behave well when kernel subsystem wasn't
installed.
some KNFing.
fixes PR 663 as reported by muir@idiom.com
 1.2 06-Oct-1994  mycroft Add RCS ids.
 1.1 11-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 31-Aug-1995  jtc imported from 44lite2
 1.1.1.1 11-May-1994  cgd updated ktrace
 1.12.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.4.1 28-Jul-2000  itojun pullup (approved by releng-1-5)
printf-like format pedant. do not pass string variable alone. use "%s".
from openbsd.

/cvsroot/basesrc/usr.bin/biff/biff.c 1.6 -> 1.7
/cvsroot/basesrc/usr.bin/chpass/chpass.c 1.18 -> 1.19
/cvsroot/basesrc/usr.bin/finger/net.c 1.13 -> 1.14
/cvsroot/basesrc/usr.bin/finger/util.c 1.15 -> 1.16
/cvsroot/basesrc/usr.bin/hexdump/display.c 1.8 -> 1.9
/cvsroot/basesrc/usr.bin/ktrace/ktrace.c 1.18 -> 1.19
/cvsroot/basesrc/usr.bin/mail/lex.c 1.14 -> 1.15
/cvsroot/basesrc/usr.bin/modstat/modstat.c 1.14 -> 1.15
/cvsroot/basesrc/usr.bin/tcopy/tcopy.c 1.9 -> 1.10
/cvsroot/basesrc/usr.bin/tn3270/ascii/map3270.c 1.7 -> 1.8
/cvsroot/basesrc/usr.bin/tn3270/tools/mkmake/mkmake.y 1.7 -> 1.8
/cvsroot/basesrc/usr.bin/vmstat/dkstats.c 1.8 -> 1.9
 1.41.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.42.6.2 29-Dec-2008  christos adjust for version 2.
 1.42.6.1 21-Jul-2008  christos file ktrace.c was added on branch christos-time_t on 2008-12-29 01:14:15 +0000
 1.43.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.45.8.1 25-Feb-2013  tls resync with head
 1.45.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.21 02-Apr-2020  christos Add the ability to:
1. list all ioctls (-l)
2. print the internal definition symbolically
3. search by name

$ ioctlprint -f "%n %E %e\n" TIOCGETA
TIOCGETA _IOR('t', 19, struct termios) _IOR('t',0x13,0x2c)
 1.20 27-Apr-2011  joerg branches: 1.20.44;
Remove Mach specific trace points.
 1.19 16-Feb-2008  matt siginfocodename returns const char *, not char *.
 1.18 09-Feb-2007  ad branches: 1.18.4;
Sync with kernel changes introduced by merging the newlock2 branch.
 1.17 07-Feb-2006  skrll Add scheduler activations upcall data to the default list of trace
points.

OK'd by christos.
 1.16 16-Jul-2005  christos WARNS=3
 1.15 24-Nov-2003  manu Enable tracing of out of line data sent with Mach messages
 1.14 19-Sep-2003  christos declaration for siginfo code number to name converter function.
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.12 17-Jul-2003  dsl Grok KTR_EXEC_ENV and KTR_EXEC_ARG.
Make ktrace -c default to removing all trace points (not just the default ones).
Make kdump default to dumping everything in the trace file.
Add 'A' (all) and '-' (remove following) to valid -t arguments.
Dump data block of UNKNOWN trace points in hex + ascii.
Make first time output with -R 0 (instead of time since epoch).
Use svis() instead of vis() to get " escaped (as \") (needs fixed libc)
Correctly pass unsigned values to svis()
Update man pages.
 1.11 09-Dec-2002  manu Added support for dumping mach messages in ktrace/kdump. While we are
there, KNFify a few functions.
 1.10 17-Dec-2000  jdolecek add support for KTR_USER records
 1.9 13-Nov-2000  jdolecek constify
 1.8 10-Apr-2000  jdolecek remove prototype for setemul(), it's in kdump/setemul.h now
 1.7 10-Apr-2000  jdolecek update to setemul() changes
 1.6 27-Jun-1998  christos fktrace support / ktruss additions.
 1.5 23-Jul-1997  mikel nuke duplicate RCSid, prototype getpoints()
 1.4 09-Jan-1997  tls RCS ID police
 1.3 19-Jul-1995  christos Add support for displaying and switching between
different OS system call emulations
 1.2 06-Oct-1994  mycroft Add RCS ids.
 1.1 11-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 11-May-1994  cgd updated ktrace
 1.18.4.1 23-Mar-2008  matt sync with HEAD
 1.20.44.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.18 01-Jun-2011  alnsn kern/42030 - tracking of file descriptors by ktrace/kdump
 1.17 27-Apr-2011  joerg branches: 1.17.2;
Remove Mach specific trace points.
 1.16 09-Feb-2007  ad Sync with kernel changes introduced by merging the newlock2 branch.
 1.15 23-Sep-2006  manu Add a -t+S flag to ktrace for tracing activity related to sysctl. MIB
names will be displayed, with data readen and written as well.
 1.14 11-May-2006  yamt #include a necessary header directly, rather than via user.h.
while i'm here, remove unnecessary #include.
 1.13 11-Dec-2005  christos add a trace facility for upcalls.
 1.12 24-Nov-2003  manu Enable tracing of out of line data sent with Mach messages
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.10 17-Jul-2003  dsl Grok KTR_EXEC_ENV and KTR_EXEC_ARG.
Make ktrace -c default to removing all trace points (not just the default ones).
Make kdump default to dumping everything in the trace file.
Add 'A' (all) and '-' (remove following) to valid -t arguments.
Dump data block of UNKNOWN trace points in hex + ascii.
Make first time output with -R 0 (instead of time since epoch).
Use svis() instead of vis() to get " escaped (as \") (needs fixed libc)
Correctly pass unsigned values to svis()
Update man pages.
 1.9 09-Dec-2002  manu Added support for dumping mach messages in ktrace/kdump. While we are
there, KNFify a few functions.
 1.8 17-Dec-2000  jdolecek add support for KTR_USER records
 1.7 23-Jul-1997  mikel provide explicit return type for getpoints(), use __RCSID macro
 1.6 31-Aug-1995  jtc Sync with 4.4lite2
 1.5 19-Jul-1995  christos Add support for displaying and switching between
different OS system call emulations
 1.4 21-Mar-1995  mycroft Update to use timer{add,sub}().
 1.3 03-Jan-1995  glass some knf
 1.2 06-Oct-1994  mycroft Add RCS ids.
 1.1 11-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 31-Aug-1995  jtc imported from 44lite2
 1.1.1.1 11-May-1994  cgd updated ktrace
 1.17.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.

RSS XML Feed