aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/ktrace/subr.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2008-02-23 01:01:49 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2008-02-23 01:01:49 +0000
commit60e15db9920e1f90f14d143a96f1b230f1d0da59 (patch)
treef964310d3ee2e43cfebd6c2b2628bc7056a3aa02 /usr.bin/ktrace/subr.c
parente75f77ece7aac1d5153ee4d43e6ee353ca2c7ed3 (diff)
downloadsrc-60e15db9920e1f90f14d143a96f1b230f1d0da59.tar.gz
src-60e15db9920e1f90f14d143a96f1b230f1d0da59.zip
This patch adds a new ktrace(2) record type, KTR_STRUCT, whose payload
consists of the null-terminated name and the contents of any structure you wish to record. A new ktrstruct() function constructs and emits a KTR_STRUCT record. It is accompanied by convenience macros for struct stat and struct sockaddr. In kdump(1), KTR_STRUCT records are handled by a dispatcher function that runs stringent sanity checks on its contents before handing it over to individual decoding funtions for each type of structure. Currently supported structures are struct stat and struct sockaddr for the AF_INET, AF_INET6 and AF_UNIX families; support for AF_APPLETALK and AF_IPX is present but disabled, as I am unable to test it properly. Since 's' was already taken, the letter 't' is used by ktrace(1) to enable KTR_STRUCT trace points, and in kdump(1) to enable their decoding. Derived from patches by Andrew Li <andrew2.li@citi.com>. PR: kern/117836 MFC after: 3 weeks
Notes
Notes: svn path=/head/; revision=176471
Diffstat (limited to 'usr.bin/ktrace/subr.c')
-rw-r--r--usr.bin/ktrace/subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c
index 01d7b43a3fcb..cfc4f3ae0eeb 100644
--- a/usr.bin/ktrace/subr.c
+++ b/usr.bin/ktrace/subr.c
@@ -74,6 +74,9 @@ getpoints(char *s)
case 's':
facs |= KTRFAC_PSIG;
break;
+ case 't':
+ facs |= KTRFAC_STRUCT;
+ break;
case 'u':
facs |= KTRFAC_USER;
break;