Module Name: src Committed By: christos Date: Sat Mar 7 16:34:55 UTC 2015
Modified Files: src/sys/sys: param.h proc.h systm.h Log Message: add dtrace syscall glue: - adds 2 members to sysent: these are the entry and exit probe ids they are non-zero only when dtrace is loaded - add an emul specific probe for dtrace: this is NULL unless the emulation supports dtrace and is loaded - adjust the syscall stub call trace_enter/exit if needed for systrace - add more info to trace_enter and exit needed by systrace To generate a diff of this commit: cvs rdiff -u -r1.465 -r1.466 src/sys/sys/param.h cvs rdiff -u -r1.320 -r1.321 src/sys/sys/proc.h cvs rdiff -u -r1.266 -r1.267 src/sys/sys/systm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.465 src/sys/sys/param.h:1.466 --- src/sys/sys/param.h:1.465 Sat Feb 14 07:59:02 2015 +++ src/sys/sys/param.h Sat Mar 7 11:34:55 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.465 2015/02/14 12:59:02 he Exp $ */ +/* $NetBSD: param.h,v 1.466 2015/03/07 16:34:55 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -63,7 +63,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 799000500 /* NetBSD 7.99.5 */ +#define __NetBSD_Version__ 799000600 /* NetBSD 7.99.6 */ #define __NetBSD_Prereq__(M,m,p) (((((M) * 100000000) + \ (m) * 1000000) + (p) * 100) <= __NetBSD_Version__) Index: src/sys/sys/proc.h diff -u src/sys/sys/proc.h:1.320 src/sys/sys/proc.h:1.321 --- src/sys/sys/proc.h:1.320 Fri Feb 21 17:06:48 2014 +++ src/sys/sys/proc.h Sat Mar 7 11:34:55 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: proc.h,v 1.320 2014/02/21 22:06:48 skrll Exp $ */ +/* $NetBSD: proc.h,v 1.321 2015/03/07 16:34:55 christos Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -177,6 +177,11 @@ struct emul { size_t e_ucsize; /* size of ucontext_t */ void (*e_startlwp)(void *); + + /* Dtrace syscall probe */ + void (*e_dtrace_syscall)(uint32_t, register_t, + const struct sysent *, const void *, + const register_t *, int); }; /* Index: src/sys/sys/systm.h diff -u src/sys/sys/systm.h:1.266 src/sys/sys/systm.h:1.267 --- src/sys/sys/systm.h:1.266 Sun Aug 3 08:49:32 2014 +++ src/sys/sys/systm.h Sat Mar 7 11:34:55 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: systm.h,v 1.266 2014/08/03 12:49:32 wiz Exp $ */ +/* $NetBSD: systm.h,v 1.267 2015/03/07 16:34:55 christos Exp $ */ /*- * Copyright (c) 1982, 1988, 1991, 1993 @@ -57,6 +57,7 @@ struct clockframe; struct lwp; struct proc; +struct sysent; struct timeval; struct tty; struct uio; @@ -120,6 +121,8 @@ extern struct sysent { /* system call t short sy_argsize; /* total size of arguments */ int sy_flags; /* flags. see below */ sy_call_t *sy_call; /* implementing function */ + uint32_t sy_entry; /* DTrace entry ID for systrace. */ + uint32_t sy_return; /* DTrace return ID for systrace. */ } sysent[]; extern int nsysent; #if BYTE_ORDER == BIG_ENDIAN @@ -388,8 +391,9 @@ void doforkhooks(struct proc *, struct p */ #ifdef _KERNEL bool trace_is_enabled(struct proc *); -int trace_enter(register_t, const register_t *, int); -void trace_exit(register_t, register_t [], int); +int trace_enter(register_t, const struct sysent *, const void *); +void trace_exit(register_t, const struct sysent *, const void *, + register_t [], int); #endif int uiomove(void *, size_t, struct uio *);