summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2012-07-09 17:51:09 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2012-07-09 17:51:09 +0000
commitee5667bbdafc676f295a875b619dffb13cb3b764 (patch)
treec3ccd6af712005c61f4afb950dd14504f8cbcf72 /sys
parent344afb9efb830b908e56a08735801d7c25bb4176 (diff)
Print the fd_set used by select in kdump.
OK guenther@ and deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sys_generic.c16
-rw-r--r--sys/sys/ktrace.h4
2 files changed, 18 insertions, 2 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index c975e9622e1..8c9a8acc204 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.77 2012/07/09 10:47:29 claudio Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.78 2012/07/09 17:51:08 claudio Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -574,6 +574,13 @@ sys_select(struct proc *p, void *v, register_t *retval)
getbits(ou, 1);
getbits(ex, 2);
#undef getbits
+#ifdef KTRACE
+ if (ni > 0 && KTRPOINT(p, KTR_STRUCT)) {
+ if (SCARG(uap, in)) ktrfdset(p, pibits[0], ni);
+ if (SCARG(uap, ou)) ktrfdset(p, pibits[1], ni);
+ if (SCARG(uap, ex)) ktrfdset(p, pibits[2], ni);
+ }
+#endif
if (SCARG(uap, tv)) {
error = copyin(SCARG(uap, tv), &atv, sizeof (atv));
@@ -638,6 +645,13 @@ done:
putbits(ou, 1);
putbits(ex, 2);
#undef putbits
+#ifdef KTRACE
+ if (ni > 0 && KTRPOINT(p, KTR_STRUCT)) {
+ if (SCARG(uap, in)) ktrfdset(p, pobits[0], ni);
+ if (SCARG(uap, ou)) ktrfdset(p, pobits[1], ni);
+ if (SCARG(uap, ex)) ktrfdset(p, pobits[2], ni);
+ }
+#endif
}
if (pibits[0] != (fd_set *)&bits[0])
diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h
index ceb453a802c..0e7c96fb13c 100644
--- a/sys/sys/ktrace.h
+++ b/sys/sys/ktrace.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ktrace.h,v 1.14 2012/04/10 20:39:37 mikeb Exp $ */
+/* $OpenBSD: ktrace.h,v 1.15 2012/07/09 17:51:08 claudio Exp $ */
/* $NetBSD: ktrace.h,v 1.12 1996/02/04 02:12:29 christos Exp $ */
/*
@@ -207,5 +207,7 @@ void ktrstruct(struct proc *, const char *, const void *, size_t);
ktrstruct((p), "sigaction", (s), sizeof(struct sigaction))
#define ktrrlimit(p, s) \
ktrstruct((p), "rlimit", (s), sizeof(struct rlimit))
+#define ktrfdset(p, s, l) \
+ ktrstruct((p), "fdset", (s), l)
#endif /* !_KERNEL */