aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/ktrace.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2003-03-13 18:31:15 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2003-03-13 18:31:15 +0000
commit75768576cca9653b0748032d47eb6a106eb04cd8 (patch)
tree9533d789396319349383bc4ddbfd90a306d3e4d1 /sys/sys/ktrace.h
parenta5881ea55a2c554fd584cf985d99e92ad1db8737 (diff)
downloadsrc-75768576cca9653b0748032d47eb6a106eb04cd8.tar.gz
src-75768576cca9653b0748032d47eb6a106eb04cd8.zip
Add a new userland-visible ktrace flag KTR_DROP and an internal ktrace flag
KTRFAC_DROP to track instances when ktrace events are dropped due to the request pool being exhausted. When a thread tries to post a ktrace event and is unable to due to no available ktrace request objects, it sets KTRFAC_DROP in its process' p_traceflag field. The next trace event to successfully post from that process will set the KTR_DROP flag in the header of the request going out and clear KTRFAC_DROP. The KTR_DROP flag is the high bit in the type field of the ktr_header structure. Older kdump binaries will simply complain about an unknown type when seeing an entry with KTR_DROP set. Note that KTR_DROP being set on a record in a ktrace file does not tell you anything except that at least one event from this process was dropped prior to this event. The user has no way of knowing what types of events were dropped nor how many were dropped. Requested by: phk
Notes
Notes: svn path=/head/; revision=112199
Diffstat (limited to 'sys/sys/ktrace.h')
-rw-r--r--sys/sys/ktrace.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h
index 2970ce0fe69a..8fffcaf6925d 100644
--- a/sys/sys/ktrace.h
+++ b/sys/sys/ktrace.h
@@ -145,6 +145,12 @@ struct ktr_csw {
#define KTR_USER 7
/*
+ * KTR_DROP - If this bit is set in ktr_type, then at least one event
+ * between the previous record and this record was dropped.
+ */
+#define KTR_DROP 0x8000
+
+/*
* kernel trace points (in p_traceflag)
*/
#define KTRFAC_MASK 0x00ffffff
@@ -160,6 +166,7 @@ struct ktr_csw {
*/
#define KTRFAC_ROOT 0x80000000 /* root set this trace */
#define KTRFAC_INHERIT 0x40000000 /* pass trace flags to children */
+#define KTRFAC_DROP 0x20000000 /* last event was dropped */
#ifdef _KERNEL
extern struct mtx ktrace_mtx;