Module Name:    src
Committed By:   dholland
Date:           Sat Mar 19 17:15:13 UTC 2016

Modified Files:
        src/lib/libc/sys: ktrace.2

Log Message:
Sync documentation of struct ktr_header with reality:
   - there is a ktr_version field
   - the ordering of ktr_type and ktr_version is byte-order dependent
   - ktr_time is now a timespec, not a timeval
   - there's now a ktr_lid field
   - there is no such thing as a ktr_buf field and it's certainly not
     a caddr_t.

XXX: I would appreciate it if someone who knows how this stuff works
XXX: could review this file in case it's still lying in some more
XXX: subtle way.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/sys/ktrace.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/sys/ktrace.2
diff -u src/lib/libc/sys/ktrace.2:1.19 src/lib/libc/sys/ktrace.2:1.20
--- src/lib/libc/sys/ktrace.2:1.19	Sat Mar 19 17:05:36 2016
+++ src/lib/libc/sys/ktrace.2	Sat Mar 19 17:15:13 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ktrace.2,v 1.19 2016/03/19 17:05:36 dholland Exp $
+.\"	$NetBSD: ktrace.2,v 1.20 2016/03/19 17:15:13 dholland Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -104,36 +104,40 @@ The generic header is:
 struct ktr_header {
 	int	ktr_len;		/* length of buf */
 	short	ktr_type;		/* trace record type */
+	short	ktr_version;		/* trace record version */
 	pid_t	ktr_pid;		/* process id */
 	char	ktr_comm[MAXCOMLEN+1];	/* command name */
-	struct	timeval ktr_time;	/* timestamp */
-	caddr_t	ktr_buf;
+	struct	timespec ktr_time;	/* timestamp */
+	lwpid_t	ktr_lid;
 };
 .Ed
 .Pp
 The
 .Nm ktr_len
-field specifies the length of the
+field specifies the length of the data that follows this header.
+The
 .Nm ktr_type
-data that follows this header.
+and
+.Nm ktr_version
+fields (whose ordering in the structure depends on byte order)
+specify the format of this data.
 The
-.Nm ktr_pid
+.Nm ktr_pid ,
+.Nm ktr_lid ,
 and
 .Nm ktr_comm
 fields specify the process and command generating the record.
 The
 .Nm ktr_time
-field gives the time (with microsecond resolution)
+field gives the time (with nanosecond resolution)
 that the record was generated.
-The
-.Nm ktr_buf
-is an internal kernel pointer and is not useful.
 .Pp
 The generic header is followed by
 .Nm ktr_len
 bytes of a
 .Nm ktr_type
-record.
+record of version
+.Nm ktr_version .
 The type specific records are defined in the
 .Pa \*[Lt]sys/ktrace.h\*[Gt]
 include file.

Reply via email to