summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-07-20 15:07:52 +0000
committerkib <kib@FreeBSD.org>2016-07-20 15:07:52 +0000
commita7dc4a2738219ada64b9a821a01152a5643fe0c4 (patch)
tree6c76fcbd1393de31c8b439fbded43e0d17c7f850 /sys/kern
parent93e4d330694dc61a6ea4f3c3d78656d9cce70698 (diff)
downloadFreeBSD-src-a7dc4a2738219ada64b9a821a01152a5643fe0c4.zip
FreeBSD-src-a7dc4a2738219ada64b9a821a01152a5643fe0c4.tar.gz
MFC r302770:
Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_time.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 6ae0fb1..7f481b3 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -32,6 +32,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_ktrace.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/limits.h>
@@ -54,6 +56,9 @@ __FBSDID("$FreeBSD$");
#include <sys/timers.h>
#include <sys/timetc.h>
#include <sys/vnode.h>
+#ifdef KTRACE
+#include <sys/ktrace.h>
+#endif
#include <vm/vm.h>
#include <vm/vm_extern.h>
@@ -699,6 +704,10 @@ kern_getitimer(struct thread *td, u_int which, struct itimerval *aitv)
*aitv = p->p_stats->p_timer[which];
PROC_ITIMUNLOCK(p);
}
+#ifdef KTRACE
+ if (KTRPOINT(td, KTR_STRUCT))
+ ktritimerval(aitv);
+#endif
return (0);
}
@@ -740,6 +749,10 @@ kern_setitimer(struct thread *td, u_int which, struct itimerval *aitv,
if (which > ITIMER_PROF)
return (EINVAL);
+#ifdef KTRACE
+ if (KTRPOINT(td, KTR_STRUCT))
+ ktritimerval(aitv);
+#endif
if (itimerfix(&aitv->it_value) ||
aitv->it_value.tv_sec > INT32_MAX / 2)
return (EINVAL);
@@ -784,6 +797,10 @@ kern_setitimer(struct thread *td, u_int which, struct itimerval *aitv,
p->p_stats->p_timer[which] = *aitv;
PROC_ITIMUNLOCK(p);
}
+#ifdef KTRACE
+ if (KTRPOINT(td, KTR_STRUCT))
+ ktritimerval(oitv);
+#endif
return (0);
}
OpenPOWER on IntegriCloud